Skip to main content
Two update functions, separated by what they change:
  • updateSidenetConfig(options) — SDK behaviour and chrome. Accepts every init option except copilotId (see below), the callbacks (onOpen / onClose / onResize / onReady), and the one-shot init-only fields (customCSS, customStyles, sdkUi, defaultOpen). Concretely: auth, width, height, position, layout, offset, zIndex, theme ('light' | 'dark'), agentId, agentVersionId, showAgentDropdown, keyboardShortcut, threadId, read_only, use_routing, groupName, groupId, firstMessage, context, variables, lastThread, debug, showClose, closeOnOutsideClick. Three null sentinels: keyboardShortcut: null disables the shortcut, threadId: null clears the pinned thread, agentVersionId: null clears the pinned agent version.
  • updateSidenetStyledConfig(styleConfig) — visual content. Accepts Partial<SidebarSDKConfig> — the same shape the backend returns as sdk_ui. Use it to override text (greeting / placeholder / suggestions) and theme design tokens. Partial calls merge into the current config, so passing only text.suggestions keeps text.greeting and the loaded theme intact.
  • getRuntimeConfig() — synchronous read of the current merged { text, theme }. Useful for snapshotting the resolved config (defaults + backend sdk_ui + your overrides) without subscribing via useSidebarConfig.
Rule of thumb: “where the sidebar is and how it behaves” → updateSidenetConfig. “what the sidebar looks like and what copy it shows” → updateSidenetStyledConfig.
context and variables are updatable here too — each call replaces the whole value rather than merging into it, and applies to the next send. See Prompt Variables for both.

copilotId is init-only

It binds the whole session to a set of backend resources — the thread list, the agent list, the copilot’s sdk_ui config, and the id of every thread created since init. Swapping it in place would leave all of that pointing at the previous copilot, so updateSidenetConfig() ignores a changed value and warns:
To switch, tear down and start again:
Re-passing the current value is a silent no-op, so handing the SDK your whole config object on every update is safe — only an actual change warns.

Swapping the session

Everything else about identity — who the user is, which billing group they belong to, which tool credentials their tools use — lives in the session token. So none of it needs a teardown. Mint a new session and pass it as a unit:
The open conversation is preserved: messages stay on screen, the thread stays selected, and any in-flight response keeps streaming on the old credential. The new one applies to the next outgoing request — chat sends as well as thread-list, message-history, and vote calls.
You rarely need this for expiry alone. While a refresh_token is present the SDK refreshes on its own. Reach for this when you mint a different session — a new user, or updated tool credentials — or after a fatal onError.
auth is replaced wholesale, with no validation. Pass the complete object, including onRefresh / onError if you want them to keep firing — omitting the field entirely is what leaves the current session untouched.