Skip to main content
The sdk-js-demo repo ships a minimal Vite app you can run end-to-end against your own publisher token.

Clone and configure

git clone https://github.com/kontextso/sdk-js-demo.git
cd sdk-js-demo
npm install
# Edit main.js and set PUBLISHER_TOKEN to your real token.
npm run dev
The repo ships PUBLISHER_TOKEN preset to a shared demo token, so it runs out of the box. Replace it with your own token from the publisher dashboard to test against your account — an invalid token makes the SDK return ad.error on /init.

What you should see

After npm run dev, open the printed local URL in a browser. The demo presents a chat interface with seeded user + assistant messages. As you send a message, the SDK fires /preload in the background and renders an ad below the assistant’s reply.