Browser entry
TESTEDDirect browser usage of @csl/wrapper-sdk/browser with the same CslClient surface.
It fits when the browser can talk to CSL directly and your token-delivery plus CORS setup supports that boundary.
The browser entry is tested and verified as part of the released package.
Included today
@csl/wrapper-sdk/browserdecisionDelivery: "auto"- job creation and decision retrieval in browser code
Verified source
README browser exampleBrowser export testsPackage smoke
browser.ts
typescript
BROWSER ENTRY
import { CslClient } from "@csl/wrapper-sdk/browser";
const client = new CslClient({
baseUrl: "http://127.0.0.1:3000",
getApiKey: async () => (await fetch("/api/csl-token")).text(),
decisionDelivery: "auto",
});
const job = await client.createJob({
job_type: "chat",
model_id: "gpt-4o-mini",
locale: "en-US",
consent: {
semantic_targeting: true,
session_persistence: false,
cross_session_persistence: false,
},
prompt: { text: "I want a travel deal for a weekend trip." },
slots_requested: 1,
});
const decision = job?.slot_ids[0] ? await client.getDecision(job.slot_ids[0]) : null;
console.log(decision);Ask about integration
Ask about integration
Start with Node direct for the recommended production-ready integration path.