CoworkkitProvider is the one component you mount. It needs one session source, tokenUrl (or its alternative, getToken): how it reaches your closed-loop token route. Every other prop is optional and ships with a sensible default, so a Provider with just tokenUrl works out of the box. This page is the complete list.
<CoworkkitProvider tokenUrl="/api/coworkkit/session">
{children}
</CoworkkitProvider>Session source
Exactly one of the two; passing both, or neither, is an error.
tokenUrl: string; // your token route's path, e.g. "/api/coworkkit/session"
getToken: (context?: GetTokenContext) => Promise<CoworkkitSession>; // or fetch the session yourselftokenUrl: the path of your token route. The SDK posts the user'slanguageandtimeZoneto it as JSON hints and relays what it returns: the session ({ token, serverUrl, cloudUrl }) unchanged, or the route's{ error, reason }and status, so the button can say why. Use a same-origin path; the browser's own cookies go with the request. The wiring itself is in Getting started.getToken: the alternative, for custom headers or a cross-origin API. An async function that returns a minted session from your server, unchanged. It receives an optionalcontextcarrying the same hints (itslanguageis the language the user picked in the button, or their browser locale); forward it to your route to honour it, see Languages. The reference implementation is under Custom getToken.
Either way the tenant key stays server-side; it never reaches the browser. tokenUrl and the other plain-value props can be set straight from a Server Component layout. Function props (getToken, fallbackSurface, onActionRecord) can't be passed from a Server Component, so a Provider that uses them lives in a client component, such as your own Providers.
Placement & behavior
Where the button sits and how it moves.
fabPosition?: "bottom-right" | "bottom-left" | "top-right" | "top-left"; // default "bottom-right"
draggable?: boolean; // default true
zIndex?: number; // default 2147483640fabPosition: which corner the button anchors to. Default"bottom-right".draggable: let the user drag the button off its anchor; the new position persists across reloads. Defaulttrue. Setfalseto pin it.zIndex: the stacking order of the button, its ring, and the page-edge glow. The default,2147483640, sits just under the 32-bit maximum so the overlays float above almost everything. Lower it only if the button covers an overlay of your own that legitimately needs to sit on top.
Confirmation & control
How actions are gated. Both are covered in depth under Control & confirmation; here are the two Provider-level knobs.
confirmationTimeout?: number; // default 60 (seconds)
defaultControl?: "open" | "soft" | "hard"; // default "open"confirmationTimeout: how many seconds ahardconfirmation may stay pending before the SDK resolves it astimeout(the handler never runs). Default60.defaultControl: the app-wide baseline for actions that declare nocontrolof their own and aren't caught by the destructive-name fail-safe. Default"open"(reads and benign actions run freely). Set"soft"to make the whole app ask-first; an explicit per-actioncontrolalways wins.
Appearance & language
look?: string | LookSpec; // brand the button (a look code from the Appearance tab, or an inline spec)
intensity?: "default" | "subtle" | "off"; // default "default"
locale?: string; // default: follows the session languagelook: brand the button with your accent and dot style, via a look code from your Coworker's Appearance tab or an inline spec. See Appearance.intensity: the visual prominence of the button. Default"default"."subtle"dials it down (a fainter ring and a softer shadow);"off"removes the button entirely, an escape hatch to keep the Provider mounted without rendering the surface.locale: pins the language of the SDK's own interface text (tooltips, the "enable sound" prompt, caption labels, the Confirm / Cancel buttons) to a BCP-47 tag such as"de-DE". When omitted, that text follows the language the session resolved to, so a German session already gets a German "Confirm". This never changes what the agent speaks; that is resolved server-side. See Languages.
Wiring
Rarely set; the defaults are right for the common case.
cloudUrl?: string; // fallback control base
fallbackSurface?: (pathname: string) => Surface; // derive a surface from the URL
onActionRecord?: (record: ActionRecord) => void; // observe every settled action
resume?: boolean; // default false — server-rendered sitescloudUrl: normally omitted. A live session already carries the control base it was minted against, and that value wins while a session is running; this prop is only the fallback for pre-session and session-less (dev) configs.fallbackSurface: derive a surface from the current pathname when a route declares nouseSurfaceof its own.onActionRecord: called once per settled action with a record of what ran, how it was gated, and the outcome. The SDK emits; you persist it (your DB or SIEM). The Watch panel shows the same record in dev with no wiring.resume: boolean, defaultfalse. For server-rendered sites where every navigation is a full page load: the session is remembered for this tab and rejoined on the next page instead of ending. See Advanced → Server-rendered sites.
Note there is no apiKey prop. The tenant key is secret and server-side, held by your token route. Putting it in the browser is exactly what the closed-loop model exists to prevent.