Get started with our general purpose JS SDK built for any browser-based app
To get started, you will need to set up a publisher account to get a
publisherToken
and code
In case fetchAd
can’t be accessed in downstream code, you might need to make fetchAd
available globally.
Prepare a list of messages exchanged between the assistant and the user. These messages help determine the most relevant ad to display. The order matters—messages should be listed chronologically and must end with the assistant’s latest reply.
If you’re integrating Kontext into a human-to-human messaging app, assign the “assistant” role to all participants except the current user. This approach works reliably in both 1:1 and group chat scenarios.
Use this object to call the fetchAd
function. The parameters help the ad server decide which product and ad copy to
return based on the context of the conversation.
To understand how the ad request works, check out our fetchAd docs.
At this point, you are all set. You can now call the fetchAd
function which accepts optional callbacks to support
debugging, analytics tracking, or custom rendering logic at various stages of the ad lifecycle.
Get started with our general purpose JS SDK built for any browser-based app
To get started, you will need to set up a publisher account to get a
publisherToken
and code
In case fetchAd
can’t be accessed in downstream code, you might need to make fetchAd
available globally.
Prepare a list of messages exchanged between the assistant and the user. These messages help determine the most relevant ad to display. The order matters—messages should be listed chronologically and must end with the assistant’s latest reply.
If you’re integrating Kontext into a human-to-human messaging app, assign the “assistant” role to all participants except the current user. This approach works reliably in both 1:1 and group chat scenarios.
Use this object to call the fetchAd
function. The parameters help the ad server decide which product and ad copy to
return based on the context of the conversation.
To understand how the ad request works, check out our fetchAd docs.
At this point, you are all set. You can now call the fetchAd
function which accepts optional callbacks to support
debugging, analytics tracking, or custom rendering logic at various stages of the ad lifecycle.