Configuration reference

The reference below documents the released constructor and payload fields that are safe to explain publicly today.

CslClientOptions

Released package surface

Every SDK HTTP request sends x-csl-wrapper-version: <wrapper_version>. decisionDelivery defaults to "auto", and timing values are clamped to safe ranges.

FieldTypeRequiredDefaultDescription
baseUrlstringyesnoneBase CSL URL. A trailing slash is normalized away.
getApiKey() => string | Promise<string>server onlynoneServer-side secret key resolver for wrapper-authenticated requests.
getPublishableKey() => string | Promise<string>browser onlynoneBrowser-safe publishable key resolver. The SDK exchanges this for an activation token before runtime calls.
publishableKeystringbrowser onlynoneStatic browser-safe publishable key alternative to getPublishableKey.
decisionDelivery"auto" | "websocket" | "polling" | "callback"no"auto"Decision delivery strategy for the client.
publisher{ app_name?: string; app_domain?: string; app_bundle?: string; categories?: string[] }nononeOptional publisher metadata automatically merged into every createJob() request.
options.timeout_msnumberno2000Base request timeout. Values are clamped to the documented safe range.
options.decision_timeout_msnumberno30000Decision wait budget. Values are clamped to the documented safe range.
options.long_poll_wait_msnumberno1500Long-poll wait_ms used by decision reads.
options.short_poll_interval_msnumberno250Short-poll interval used after long-poll attempts are exhausted.
options.onError(error: CslSdkError) => voidnononeObservation hook for structured SDK errors surfaced through onError rather than thrown as hard failures.
options.wrapper_versionstringno"sdk"Optional wrapper version label. Sent as x-csl-wrapper-version on every SDK request.

JobRequest

Released public types

job_type is required and slots_requested defaults to 1. When decisionDelivery: "callback" is used without callback_url, createJob() returns null and onError receives CslSdkError with code sdk_internal.

FieldTypeRequiredDefaultDescription
job_typestringyesnoneApp job type.
slots_requestednumberno1Number of requested slots.
model_idstringno"unknown"Optional model identifier for the job.
localestringno"en"Optional app locale.
predicted_latency_msnumbernononeOptional latency hint.
client_idstringnoruntime-derived if omittedOptional client id.
chat_session_idstringnononeOptional chat session id.
prompt{ text?: string; token_count_estimate?: number } | stringnononeOptional prompt payload. Sent to the CSL for topic extraction only when you choose to provide it. The data firewall reduces this to an abstract category and language before any signal reaches a configured partner path. Raw text is never forwarded.
context.topicstringnononeOptional topic hint when you do not want to share prompt text.
context.prompt_textstringnononeOptional prompt alias for integrations that separate explicit context from prompt capture.
consentConsentFlagsnoserver defaultsOptional consent flags for semantic targeting, prompt sharing, GDPR, wrapper-CMP TCF, GPP, and legacy US privacy.
publisher{ app_name?: string; app_domain?: string; app_bundle?: string; categories?: string[] }noconstructor defaults if configuredOptional publisher metadata automatically merged from the client constructor when configured.
slot_config{ allowed_formats?: ("banner" | "clip" | "native")[]; max_width?: number; max_height?: number; position_hint?: string; bidfloor?: number; bidfloorcur?: string }nononeOptional format, size, placement, and bidfloor hints.
brand_safety{ blocked_categories?: string[]; blocked_domains?: string[] }nononeOptional blocking controls for categories and advertiser domains.
ssp_partner_idstringnononeLegacy single-partner selector for advanced routing cases.
routing.preferred_partner_idstringnononePreferred routing hint for new integrations.
routing.candidate_partner_idsstring[]nononeOptional routing hint list for candidate partners.
callback_urlstringnononeCallback target for callback delivery.

GenerationRequest

Released public types

FieldTypeRequiredDefaultDescription
generation_idstringnononeIdentifier for the model generation.
model_idstringnononeReported model identifier.
usage_jsonunknownnononeUsage payload for finished or failed.
errorstringnononeFailure detail for the failed path.

BeaconRequest

Released public types

FieldTypeRequiredDefaultDescription
beacon_idstringyesnoneIdempotency input for the beacon.
asset_tokenstringyesnoneAsset authenticator for fill beacons.
beacon_type"rendered" | "visible_started" | "visible_ended" | "heartbeat" | "play_started" | "play_completed" | "clicked"yesnoneBeacon type for render, visibility, playback, or click events.
occurred_at_ms_clientnumberyesnoneClient timestamp for the event.
measurementsRecord<string, unknown>nononeOptional measurements bag.

Configuration changes

Updating your project's app_domain in the dashboard immediately rewrites allowed_origins on active publishable keys for that project.

Secret keys remain valid because browser origin checks do not apply to server-side auth. If the same domain update also reflects a server deployment or ownership change, rotate the affected secret keys in the dashboard so consumers pick up a replacement key while the previous key stays valid for 24 hours.

Use this when your wrapper domain changes between preview and production, or when you move to a new canonical app host.

Rate limits

Each API key has a configurable rate limit. The default is 100 requests per minute per key. When the limit is exceeded, createJob() does not throw. It returns a typed fail-soft result instead:

rate-limit.json

json

429
{
  "error": "rate_limit_exceeded",
  "retry_after_ms": 1000
}

View and adjust rate limits in the dashboard under Settings → API Keys → Advanced.

Related docs: Testing and Troubleshooting.

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.