> ## Documentation Index
> Fetch the complete documentation index at: https://sidenet.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Install the Sidenet AI SDK via npm or CDN.

## NPM (React/Next.js/Vite)

```bash theme={null}
npm install sidenetai-sdk
```

```typescript theme={null}
import { initSidenet } from 'sidenetai-sdk';

// `tokens` is the body your backend got from POST /v1/token — see Authentication.
initSidenet({
  copilotId: 'your-copilot-id',
  auth: { ...tokens },
});
```

**Peer dependencies (NPM package only):** the only peers are `react` and `react-dom` (`>=18`) — which your React/Next/Vite app already has. Everything else (assistant-ui, the AI SDK, Radix, animation, icons, syntax highlighting, etc.) is bundled into the package, so there's nothing else to install. The SDK renders in its own React root inside a Shadow DOM and never shares those libraries with your app — this is what avoids version-skew crashes (e.g. duplicate React contexts blanking the panel).

<Note>
  Using the **CDN standalone bundle** below instead? It bundles React too — so it has **no peer dependencies at all** and works in Vue, Angular, or vanilla JS with nothing else installed.
</Note>

## CDN (Static sites, WordPress, vanilla JS)

```html theme={null}
<script src="https://unpkg.com/sidenetai-sdk@latest/dist/sidenetai-sdk.standalone.umd.js"></script>
<script>
  Sidenet.initSidenet({
    copilotId: 'your-copilot-id',
    auth: { ...tokens },   // from your backend — see Authentication
  });
</script>
```

The standalone bundle (\~13MB uncompressed, \~2.8MB gzipped) includes React and all dependencies. Use the NPM package if you already have React.

<Note>
  Next step: [mint a session token](/docs/sdk/authentication) on your backend. It is the one thing the SDK cannot start without.
</Note>
