CoworkkitDocs
Sign inCreate account
© 2026 CoworkkitTerms of ServiceRefund PolicyData Processing AddendumPrivacy PolicyCookie PolicyData & Security

Start here

  • Getting started
  • The setup prompt
  • How it works

Declaring your app

  • Actions, surfaces & elements
  • Hand mode
  • Control & confirmation
  • Show while it talks
  • Patterns & best practices

Integrate

  • Backends
  • Usage, quotas & webhooks
  • Multiple coworkers
  • Connect your coding agent

Polish & operate

  • Appearance
  • Languages
  • Typing and reading
  • The Watch panel
  • Development mode

Reference

  • Advanced
  • Configuration
  • Browser & framework support
  • Network requirements
  • Regions
  • Browser storage
  • Troubleshooting & FAQ
  • Error codes
All docs

Docs

Configuration

Every CoworkkitProvider prop and its default: button position and drag, the z-index escape valve, the confirmation timeout, the app-wide control baseline, locale, and the wiring props.

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.

tsx
<CoworkkitProvider tokenUrl="/api/coworkkit/session">
  {children}
</CoworkkitProvider>

Session source

Exactly one of the two; passing both, or neither, is an error.

tsx
tokenUrl: string;                                                    // your token route's path, e.g. "/api/coworkkit/session"
getToken: (context?: GetTokenContext) => Promise<CoworkkitSession>; // or fetch the session yourself
  • tokenUrl: the path of your token route. The SDK posts the user's language and timeZone to 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 optional context carrying the same hints (its language is 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.

tsx
fabPosition?: "bottom-right" | "bottom-left" | "top-right" | "top-left"; // default "bottom-right"
draggable?: boolean; // default true
zIndex?: number;     // default 2147483640
  • fabPosition: 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. Default true. Set false to 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.

tsx
confirmationTimeout?: number;              // default 60 (seconds)
defaultControl?: "open" | "soft" | "hard"; // default "open"
  • confirmationTimeout: how many seconds a hard confirmation may stay pending before the SDK resolves it as timeout (the handler never runs). Default 60.
  • defaultControl: the app-wide baseline for actions that declare no control of 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-action control always wins.

Appearance & language

tsx
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 language
  • look: 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.

tsx
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 sites
  • cloudUrl: 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 no useSurface of 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, default false. 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.

PreviousAdvancedNextBrowser & framework support

Machine-readable: this page as Markdown · all docs (llms.txt) · everything in one file (llms-full.txt)