Quickstart
Start building awesome documentation in under 5 minutes
1. Create an account
To get started, get in touch with us via Calendly or email. We will onboard you personally into the Kontext platform and help you get started.
During onboarding you will receive your publisherToken
and a code
that’s needed in the next steps.
2. Installation
Install the SDK
Initialize AdsProvider
We will now need to set up AdsProvider
. This component handles all data fetching logic and needs to have access to messages in chat so far. Essentially, you want to place it somewhere in the component tree where you already have messages available and also high enough so it contains all ad placements (places where ads are rendered).
It has several props:
publisherToken
- Your unique publisher tokenisLoading
- Loading state of your application. Should be set totrue
if there is a network request in progress to get assistant responsemessages
- List of messages between assistant and useruserId
- Unique ID of the user who will have the ads served, can be e.g. a hashconversationId
- Unique ID of the conversation
3. Show your first ad
An ad slot is the element or place in your interface where an ad will be displayed. During onboarding, you will receive a code
that you need to use for each ad slot or ad format you want to display.
You can see all of our ad formats here, we will be using an InlineAd
in this example.
Copy the markup <InlineAd />
and place it in your application where it should be rendered. Don’t forget to assign messageId
as a unique identifier. For example, if you have a MessageList
component, you can show an ad after each message like this (every message will have a unique ad displayed because of messageId
).
Style your ads
Style your ads to match your app’s look and feel.