Lifecycle Methods Covered
init()boot()shutdown()setUserProperties()
1. init()
Used only with the NPM package. Initializes the SDK with your license key and optional configuration (like CSP settings).
NPM Package:
Optional config:
**Important **- You must call init() before using boot() or any other method.
2. boot()
Starts the Copilot for a logged-in user. This is what makes the agent visible and interactive.
Script/CDN:
NPM Package:
userId– required (string): unique ID for the current useruserProperties– optional: user-level data (name, plan, etc.)instanceAttributes– optional: product config, API URLs, and auth headers
3. shutdown()
Hides the Copilot from view. Usually called when the user logs out or switches accounts.
Script/CDN:
NPM Package:
Best practice: always call shutdown() before calling boot() again for a different user.
4. setUserProperties()
Updates user properties after boot()—useful for real-time changes like plan upgrades or preference updates.
Script/CDN:
NPM Package:
Summary Table
Now that you know how to initialize and control the agent experience, you can move on to:
Components → Learn how to enable and customize the Sidebar or Spotlight (or both) in your application.
This is where you’ll decide how the Copilot appears to users—and how it fits into your product’s overall UX.