Skip to main content

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.

The example module in the SDK repo ships a working Jetpack Compose chat demo you can run end-to-end against your own publisher token.

Clone and configure

git clone https://github.com/kontextso/sdk-kotlin.git
cd sdk-kotlin
cp local.properties.example local.properties
# Edit local.properties and set `publisherToken` to your real token.
./gradlew :example:installDebug
Then launch the Kontext v4 — Kotlin app on a connected device or emulator.
local.properties is gitignored, so your token won’t be committed. The example reads publisherToken (and an optional adServerUrl override) via BuildConfig at build time. If the file is missing, the build falls back to placeholder strings and /preload will fail until a real token is configured.
The default placeholder publisherToken won’t return real ads — replace it with your token from the publisher dashboard.

What you should see

After launch, 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. The top app bar exposes a “Track only” toggle that flips AddMessageOptions(trackOnly = true) on outgoing messages — useful for verifying the Kontextso-Is-Disabled header behavior.