Browser Integration

TESTED

Direct browser usage of @csl/wrapper-sdk/browser with the same CslClient surface.

It fits when you explicitly need browser-side package orchestration with a publishable key and activation handshake, rather than the Script Tag or hosted-renderer path.

The browser entry is tested and verified as part of the released package. Browser package usage relies on publishable-key activation and allowed-origin checks. Secret keys remain server-only, and new browser work should prefer the Script Tag unless the package surface is explicitly needed.

Included today

  • @csl/wrapper-sdk/browser
  • decisionDelivery: "auto"
  • getPublishableKey() or publishableKey
  • job creation and decision retrieval in browser code

Verified source

  • README browser example
  • Browser export tests
  • Package smoke

browser.ts

typescript

BROWSER
import { CslClient } from "@csl/wrapper-sdk/browser";

const client = new CslClient({
  baseUrl: "https://api.wavebird.ai",
  getPublishableKey: async () => (await fetch("/api/wavebird/publishable-key")).text(),
  publisher: {
    app_name: "MyAIChatApp",
    app_domain: "mychatapp.com",
    categories: ["IAB19"],
  },
  decisionDelivery: "auto",
});

const job = await client.createJob({
  job_type: "chat",
});

const decision = job?.slot_ids[0] ? await client.getDecision(job.slot_ids[0]) : null;
console.log(decision);

API first, Script Tag second, SDK third

Back to API docsContact the team

These pages are the advanced package layer for teams that intentionally choose @csl/wrapper-sdk. Primary onboarding still lives in the API docs, and browser-first installs should start with the Script Tag. Use contact only when you want rollout review, enterprise coordination, or help with non-standard integration constraints. Beacon billing rules live in SDK Concepts.