This page lists all the available methods provided by the Adopt AI SDK, along with their parameters and usage structure. You can use these methods to control how and when the agent appears, manage sessions, update user data, and integrate with your app’s navigation or backend. Whether you’re using the Script tag (Documentation Index
Fetch the complete documentation index at: https://docs.adopt.ai/llms.txt
Use this file to discover all available pages before exploring further.
window.AdoptAI) or the NPM package (import { ... } from '@adoptai/sdk), the method signatures remain consistent.
Global Object
When using the Script/CDN approach, all SDK methods are available via:Method Reference
init(licenseKey: string, opts?: InitConfig): Promise<void>
Initializes the SDK (required for NPM installs only).
boot(userId: string, userProperties?: object, instanceAttributes?: object): Promise<void>
Starts the Copilot for a specific user session.
shutdown(): void
Hides the Copilot UI. Typically called on logout or user switch.
setUserProperties({ userProperties: object }): void
Updates user-specific properties after boot.
addRouter(callback: (url: string) => void): void
Registers your app’s router so Adopt can track and respond to route changes in SPAs.
setCopilotHeaders(headers: Record<string, string>): void
Dynamically updates API headers—useful for refreshing tokens mid-session.
Error Handling
All async methods return Promises. Usetry/catch blocks to gracefully handle issues during init or boot: