> ## 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.

# JavaScript SDK

> Add the Adopt JS SDK to your application to initialize the Copilot experience. This one-time setup allows your app to securely load the right UI, theme, and targeting rules—all dynamically managed from the Adopt platform.

The **Adopt AI JavaScript SDK** allows you to embed the Agent Experience directly into your web application. It connects the agents you've built in the Agent Builder to your live product environment—enabling real users to interact with your Copilot in production.

This SDK powers everything from rendering the UI to personalizing responses and executing actions securely in the right user context.

## Why Use the SDK?

Before you deploy the Agent Experience to end users, you need to install the SDK in your web app. The SDK handles:

* Initializing the Copilot with your org's configuration
* Displaying the Sidebar or Spotlight (or both)
* Targeting users based on properties or rules
* Securing API communication through headers and tokens
* Supporting complex environments like SPAs or apps with CSPs

Whether you're deploying on a simple marketing site or a multi-user SaaS platform, the SDK gives you the flexibility and control to make the Copilot feel like a native part of your product.

## Integration Options

Adopt supports **two ways to install the SDK →**

### **1. Script/CDN Integration (Recommended for Most Teams)**

* Easiest setup—just add a script tag
* Automatically handles initialization
* Use the global `window.AdoptAI` object to trigger functionality

### **2. NPM Package Integration (Recommended for modern frameworks like React, Vue)**

* Full control over when and how the SDK loads
* Better suited for TypeScript or Webpack/Vite-based projects
* You'll manually import methods like `init()`, `boot()`, `shutdown()` etc.

## What This Guide Covers

This SDK guide is organized into sub-pages based on what you'll need to set up and customize the experience →

1. [Installation](/javascript-sdk/installation)
2. [SDK Lifecycle](/javascript-sdk/sdk-lifecycle)
3. [Components](/javascript-sdk/components)
4. [Configuration](/javascript-sdk/configuration)
5. [Security](/javascript-sdk/security)
6. [Single Page Apps (SPA's)](/javascript-sdk/single-page-applications)
7. [API Reference](/javascript-sdk/api-reference)
8. [Troubleshooting](/javascript-sdk/troubleshooting)
9. [FAQ's](/javascript-sdk/faq)
10. [Usage Examples](/javascript-sdk/usage-examples)
