# Kontext Documentation ## Conversational Ads ### Get Started - [Overview](https://docs.kontext.so/overview.md): Transform your app into a revenue engine with native, AI-powered ads. - [Advertisers](https://docs.kontext.so/advertisers.md): Reach your ideal audience with contextually relevant, AI-powered native ads. - [Publishers](https://docs.kontext.so/publishers.md): Transform your app into a revenue engine with native, AI-powered ads. ### Concepts - [How it works](https://docs.kontext.so/concepts/how-it-works.md): The session-to-render flow that powers every Kontext integration. - [Session lifecycle](https://docs.kontext.so/concepts/session.md): How a Kontext session is created, fed messages, listened to, and closed. - [IDs and tokens](https://docs.kontext.so/concepts/ids-and-tokens.md): publisherToken, placement code, userId, conversationId, IFA, IDFV — what each is, who generates it, and what it is used for. - [Messages](https://docs.kontext.so/concepts/messages.md): What the SDK needs from each chat message and why stable, unique IDs matter. - [Displaying ads](https://docs.kontext.so/concepts/displaying-ads.md): Where the ad slot goes, which message id to bind it to, and the common 'latest assistant message' pattern. - [Ad formats](https://docs.kontext.so/concepts/ad-formats.md): Image, video, interstitial, and banner — what each format is and how the ad server picks which one to deliver. - [Ad engine](https://docs.kontext.so/concepts/ad-engine.md): How Kontext's ad engine serves ads from direct partners and programmatic DSPs. - [Ad lifecycle events](https://docs.kontext.so/concepts/events.md): Every event the SDK can emit — filled, no-fill, viewed, clicked, render-*, video.*, reward.granted — what triggers them and what to do with them. - [Pacing](https://docs.kontext.so/concepts/pacing.md): How often ads appear in a conversation — paced by us, or overridden per message with trackOnly. ### Guides - [Testing](https://docs.kontext.so/guides/testing.md): Use the development publisher token to integrate and test without usage limits. - [Debugging](https://docs.kontext.so/guides/debugging.md): Use onEvent for ad-lifecycle signals and onDebugEvent for a detailed internal log. - [IFA & ATT](https://docs.kontext.so/guides/ifa.md): How the SDK reads the device advertising identifier on iOS and Android, and the one-time configuration each platform needs. - [SKAdNetwork](https://docs.kontext.so/guides/skadnetwork.md): Configure SKAdNetwork identifiers on iOS so DSPs can attribute installs from your ads. - [ads.txt & app-ads.txt](https://docs.kontext.so/guides/ads-txt.md): Host the IAB authorized-sellers file at your domain so demand partners trust your traffic. - [TCF & CMP](https://docs.kontext.so/guides/tcf-cmp.md): How the SDK reads IAB TCF v2.2 consent from your CMP automatically, plus the regulatory object for manual control. - [Advertiser pixel](https://docs.kontext.so/guides/advertiser-pixel.md): Track conversions and custom events on your website and attribute them to clicks on your Kontext ads. - [Best practices](https://docs.kontext.so/guides/best-practices.md): Pre-launch checklist for publishers integrating the Kontext SDK. ### SDKs - [Flutter SDK](https://docs.kontext.so/sdk/flutter.md): Get started with our SDK built for iOS and Android apps using Flutter - [React Native SDK](https://docs.kontext.so/sdk/react-native.md): Get started with our SDK built for iOS and Android apps using React Native - [React SDK](https://docs.kontext.so/sdk/react.md): Get started with our SDK built for React applications #### Swift SDK - [Swift SDK](https://docs.kontext.so/sdk/swift.md): Integrate Kontext ads into your iOS app with the Swift SDK. - [Installation](https://docs.kontext.so/sdk/swift/installation.md): Add the Swift SDK to your iOS project and configure ATT + SKAdNetwork. - [Showing your first ad](https://docs.kontext.so/sdk/swift/first-ad.md): Create a session, feed messages, mount InlineAdUIView, and observe events. - [API reference](https://docs.kontext.so/sdk/swift/api.md): Every type and method exposed by the Swift SDK. - [Guides](https://docs.kontext.so/sdk/swift/guides.md): Patterns and recipes for common Swift SDK integration tasks. - [Example app](https://docs.kontext.so/sdk/swift/example.md): Run the bundled UIKit demo against your own publisher token. #### Kotlin SDK - [Kotlin SDK](https://docs.kontext.so/sdk/kotlin.md): Integrate Kontext ads into your Android app with the Kotlin SDK. - [Installation](https://docs.kontext.so/sdk/kotlin/installation.md): Add the Kotlin SDK to your Android project and configure GAID. - [Showing your first ad](https://docs.kontext.so/sdk/kotlin/first-ad.md): Create a session, feed messages, mount InlineAd, and observe events. - [API reference](https://docs.kontext.so/sdk/kotlin/api.md): Every type and method exposed by the Kotlin SDK. - [Guides](https://docs.kontext.so/sdk/kotlin/guides.md): Patterns and recipes for common Kotlin SDK integration tasks. - [Example app](https://docs.kontext.so/sdk/kotlin/example.md): Run the bundled Compose demo against your own publisher token. #### Vue SDK - [Vue SDK](https://docs.kontext.so/sdk/vue.md): Integrate Kontext ads into your Vue 3 app with the Vue SDK. - [Installation](https://docs.kontext.so/sdk/vue/installation.md): Install @kontextso/sdk-vue. - [Showing your first ad](https://docs.kontext.so/sdk/vue/first-ad.md): Install the Kontext plugin, feed messages, mount , observe events. - [API reference](https://docs.kontext.so/sdk/vue/api.md): Plugin options, composable, components, and events exposed by the Vue SDK. - [Guides](https://docs.kontext.so/sdk/vue/guides.md): Patterns and recipes for common Vue SDK integration tasks. - [Example app](https://docs.kontext.so/sdk/vue/example.md): Run the Vite + Vue 3 demo against your own publisher token. #### JavaScript SDK - [JavaScript SDK](https://docs.kontext.so/sdk/js.md): A lightweight JavaScript SDK that lets you integrate Kontext ads into any web app. - [Installation](https://docs.kontext.so/sdk/js/installation.md): Install @kontextso/sdk-js via npm or load it from CDN. - [Showing your first ad](https://docs.kontext.so/sdk/js/first-ad.md): Create a session, feed messages, mount an ad, observe events. - [API reference](https://docs.kontext.so/sdk/js/api.md): createSession, Session, Ad, and the full event list. - [Guides](https://docs.kontext.so/sdk/js/guides.md): Patterns and recipes for common JavaScript SDK integration tasks. - [Example app](https://docs.kontext.so/sdk/js/example.md): Run the Vite demo against your own publisher token. ### Resources - [Changelog](https://docs.kontext.so/resources/changelog.md): Version history for each Kontext SDK. - [Demos](https://docs.kontext.so/resources/demos.md): Runnable example apps for every Kontext SDK. - [Compliance](https://docs.kontext.so/resources/compliance.md): OMID certification, IAB Tech Lab posture, privacy regulations, and platform policies. - [Subprocessors](https://docs.kontext.so/resources/subprocessors.md): The third-party subprocessors Kontext engages to help deliver its services. - [Support](https://docs.kontext.so/resources/support.md): Get in touch with the Kontext team. ## Video Ads ### Get Started - [Video Ads](https://docs.kontext.so/video/overview.md): Overlay, pause and linear ads for short-drama and other video-first apps. ### Concepts - [How it works](https://docs.kontext.so/video/concepts/how-it-works.md): From the request to the last event: what your app does, what the SDK does, and what our server does. - [Ad formats](https://docs.kontext.so/video/concepts/ad-formats.md): Overlay, pause and linear: where each one appears and how it ends. - [Ad lifecycle](https://docs.kontext.so/video/concepts/lifecycle.md): Ask, load or reject, show, end. What the SDK holds for you, when it lets go, and the one callback you implement. - [Targeting](https://docs.kontext.so/video/concepts/targeting.md): What you tell the SDK about the episode, the viewer and consent, and why each field raises fill and price. ### Guides - [Testing](https://docs.kontext.so/video/guides/testing.md): Integrate and test with the development token, test creatives for every format, and the example app. - [Debugging](https://docs.kontext.so/video/guides/debugging.md): Reading the SDK's log, checking its state, and what each error means. - [IFA & ATT](https://docs.kontext.so/video/guides/ifa.md): How the Video SDK reads the advertising identifier, and the one-time setup your app needs on iOS. - [SKAdNetwork](https://docs.kontext.so/video/guides/skadnetwork.md): Configure SKAdNetwork identifiers on iOS so advertisers can attribute installs from your video ads. - [app-ads.txt](https://docs.kontext.so/video/guides/ads-txt.md): Host the IAB authorized-sellers file at your developer site so demand partners trust your traffic. - [TCF & CMP](https://docs.kontext.so/video/guides/tcf-cmp.md): How the Video SDK reads IAB TCF v2.2 consent from your CMP automatically, and how to set consent yourself. - [Best practices](https://docs.kontext.so/video/guides/best-practices.md): The pre-launch checklist for a video app: moments, prefetching, consent, attribution and the things that raise fill. ### SDKs #### Swift Video SDK - [Swift Video SDK](https://docs.kontext.so/video/sdk/swift.md): Overlay, pause and linear video ads for short-drama and other video-first iOS apps. - [Installation](https://docs.kontext.so/video/sdk/swift/installation.md): Add the Video SDK to your iOS project, initialize it at launch, and configure ATT and SKAdNetwork. - [Showing your first ad](https://docs.kontext.so/video/sdk/swift/first-ad.md): Create the video's ads, get an ad, load it early, and show it at the right moment: overlay, pause or linear. - [API reference](https://docs.kontext.so/video/sdk/swift/api.md): Every type, method, callback and error of the Swift Video SDK. - [Example app](https://docs.kontext.so/video/sdk/swift/example.md): Run the bundled SwiftUI player, one video per ad format, against your own publisher token. ##### Players - [Your player](https://docs.kontext.so/video/sdk/swift/players.md): Give the SDK your content player: built-in support for some players, and ContentPlayer for any other. - [AVPlayer](https://docs.kontext.so/video/sdk/swift/avplayer.md): Hand an AVPlayer to the SDK: ads.track(player). - [TTSDK player](https://docs.kontext.so/video/sdk/swift/ttsdk.md): Hand a TTSDK engine (TTVideoEngine) to the SDK with the KontextVideoTTSDK product. ##### UI - [SwiftUI](https://docs.kontext.so/video/sdk/swift/swiftui.md): Show video ads from SwiftUI with VideoAdHost: set an ad to show it, nil to dismiss it. ##### Guides - [Loading several ads at once](https://docs.kontext.so/video/sdk/swift/guides/several-ads.md): To have several formats ready at once, ask for them and load them concurrently. - [Running your own auction](https://docs.kontext.so/video/sdk/swift/guides/auction.md): Compare an ad's price with your other networks before it renders, then load it or reject it. - [Handling no-fill](https://docs.kontext.so/video/sdk/swift/guides/no-fill.md): What to do when there is no ad for a format: the reasons, and when to ask again. - [Keeping the ad clear of your controls](https://docs.kontext.so/video/sdk/swift/guides/insets.md): An overlay strip sits at the bottom or top of the player view, a pause card at the top; the SDK keeps both inside the view's safe area. - [Ads in a feed](https://docs.kontext.so/video/sdk/swift/guides/feeds.md): In a vertical feed (a paging `UICollectionView`, a SwiftUI paging `ScrollView` or `TabView`), show an overlay or pause ad in the current cell only. - [The next episode](https://docs.kontext.so/video/sdk/swift/guides/next-episode.md): Create the next episode's `VideoAds` while the current one plays, prefetch its ads, and destroy the current one when the viewer leaves. - [Who the viewer is](https://docs.kontext.so/video/sdk/swift/guides/viewer.md): Tell the SDK what you know about the viewer: user, consent, and what never to send. #### Kotlin Video SDK - [Kotlin Video SDK](https://docs.kontext.so/video/sdk/kotlin.md): Overlay, pause and linear video ads for short-drama and other video-first Android apps. - [Installation](https://docs.kontext.so/video/sdk/kotlin/installation.md): Add the Video SDK to your Android project, initialize it at launch, and see what it adds to your manifest. - [Showing your first ad](https://docs.kontext.so/video/sdk/kotlin/first-ad.md): Create the video's ads, get an ad, load it early, and show it at the right moment: overlay, pause or linear. - [API reference](https://docs.kontext.so/video/sdk/kotlin/api.md): Every type, method, callback and error of the Kotlin Video SDK. - [Example app](https://docs.kontext.so/video/sdk/kotlin/example.md): Run the bundled ExoPlayer app, one video per ad format, against your own publisher token. ##### Players - [Your player](https://docs.kontext.so/video/sdk/kotlin/players.md): Give the SDK your content player: built-in support for some players, and ContentPlayer for any other. - [Media3 player](https://docs.kontext.so/video/sdk/kotlin/media3.md): Hand a Media3 player (ExoPlayer, MediaController) to the SDK with so.kontext:video-media3. - [TTSDK player](https://docs.kontext.so/video/sdk/kotlin/ttsdk.md): Hand a TTSDK engine (TTVideoEngine) to the SDK with so.kontext:video-ttsdk. ##### UI - [Jetpack Compose](https://docs.kontext.so/video/sdk/kotlin/compose.md): Show video ads from Jetpack Compose with so.kontext:video-compose: rememberVideoAds and VideoAdHost. ##### Guides - [Loading several ads at once](https://docs.kontext.so/video/sdk/kotlin/guides/several-ads.md): To have several formats ready at once, ask for them and load them concurrently. - [Running your own auction](https://docs.kontext.so/video/sdk/kotlin/guides/auction.md): Compare an ad's price with your other networks before it renders, then load it or reject it. - [Handling no-fill](https://docs.kontext.so/video/sdk/kotlin/guides/no-fill.md): What to do when there is no ad for a format: the reasons, and when to ask again. - [Keeping the ad clear of your controls](https://docs.kontext.so/video/sdk/kotlin/guides/insets.md): An overlay strip sits at the bottom or top of the container, a pause card at the top; the SDK keeps both clear of the system bars and display cutout that overlap the container. - [Ads in a feed](https://docs.kontext.so/video/sdk/kotlin/guides/feeds.md): In a vertical feed (a `ViewPager2`, a paging `RecyclerView`, a Compose pager), show an overlay or pause ad on the current page only. - [The next episode](https://docs.kontext.so/video/sdk/kotlin/guides/next-episode.md): Create the next episode's `VideoAds` while the current one plays, prefetch its ads, and destroy the current one when the viewer leaves. - [Who the viewer is](https://docs.kontext.so/video/sdk/kotlin/guides/viewer.md): Tell the SDK what you know about the viewer: user, consent, and what never to send. - [Following the screen's lifecycle](https://docs.kontext.so/video/sdk/kotlin/guides/lifecycle.md): Who owns the episode's VideoAds, and when to destroy it: an Activity, a Fragment, a ViewModel or Compose. ### Resources - [Changelog](https://docs.kontext.so/video/resources/changelog.md): Version history of the Video SDKs. - [Demos](https://docs.kontext.so/video/resources/demos.md): Runnable example apps for the Video SDKs. - [Compliance](https://docs.kontext.so/video/resources/compliance.md): Viewability, IAB Tech Lab standards, privacy regulations and platform policies for the Video SDK. - [Subprocessors](https://docs.kontext.so/video/resources/subprocessors.md): The third-party subprocessors Kontext engages to help deliver its services. - [Support](https://docs.kontext.so/video/resources/support.md): Get in touch with the Kontext team. > The links below point to documentation indexes. Follow each `/_llms/` index recursively until you reach documentation pages. ## Indexes - [Chinese (100 pages)](https://docs.kontext.so/_llms/zh.txt): Documentation for Chinese. This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.