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

# JavaScript SDK

> A lightweight JavaScript SDK that lets you integrate Kontext ads into any web app.

> [card] [JavaScript Demo](https://github.com/kontextso/sdk-js-demo)
>
> See how easy it is to integrate high-performance ads into your web app using our lightweight SDK.

## Requirements

* A modern browser environment (the SDK is framework-agnostic — works in static pages, custom chat UIs, or any SPA).

> [!NOTE]
>
> You'll need a [publisher account](https://docs.kontext.so/publishers.md#getting-started-is-easy) to obtain your `publisherToken` and placement codes.

> [card] [Installation](https://docs.kontext.so/sdk/js/installation.md)
>
> Install via npm or load from CDN.

> [card] [Showing your first ad](https://docs.kontext.so/sdk/js/first-ad.md)
>
> Create a session, feed messages, mount an ad — the 5-minute integration.

> [card] [API reference](https://docs.kontext.so/sdk/js/api.md)
>
> `createSession`, `Session`, `Ad`, and the full event list.

> [card] [Guides](https://docs.kontext.so/sdk/js/guides.md)
>
> Patterns and recipes: no-fill, character switching, restoring history, and more.

> [card] [Example app](https://docs.kontext.so/sdk/js/example.md)
>
> Run the Vite demo end-to-end against your own publisher token.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.