Plugin options, composable, components, and events exposed by the Vue SDK.
Plugin / AdsProvider options
string
required
Your unique publisher token.
string
required
Unique identifier that remains the same for the user’s lifetime (used for retargeting and rewarded ads).
string
Email of the user.
string
required
Unique ID of the conversation.
array
Placement codes enabled for the conversation. Defaults to ['inlineAd'].
object
Character object used in this conversation.
Show Properties
string
required
Unique ID of the character.
string
required
Name of the character.
string
required
URL of the character’s avatar.
boolean
Indicates whether the character is NSFW.
string
The character’s greeting.
string
Description of the character’s personality.
array
Tags describing the character.
object
Regulatory object used in this conversation.
Show Properties
integer
Indicates whether the request is subject to GDPR regulations. (0 = No, 1 = Yes, null = Unknown)
string
The IAB Transparency and Consent Framework (TCF) consent string.
integer
Indicates whether the request is subject to COPPA. (0 = No, 1 = Yes, null = Unknown)
string
Global Privacy Platform (GPP) consent string.
array
IDs of the GPP sections that apply to this transaction.
string
Signals regarding consumer privacy under US privacy regulations (e.g., CCPA, LSPA).
string
Publisher-provided identifier for the user cohort (for A/B testing).
function
Callback triggered when an event occurs. See Supported events below.
function
Callback for SDK-internal diagnostic events. Receives (name, data?) — useful when investigating preload/session behaviour during integration. Off by default.
useAds() composable
Returns addMessage, a forwarder that always routes to the current session. If <AdsProvider> swaps the session (e.g. publisherToken change), the next call hits the new one automatically.
function
required
(message: Message, options?: AddMessageOptions) => void — register a new chat message with the SDK. The next preload is scheduled automatically.AddMessageOptions currently exposes one flag:
Show AddMessageOptions
boolean
When true, the preload request still goes out for analytics but no ad will be shown for this message. Use this to suppress ads without losing tracking data.
Message shape
string
required
Unique ID of the message.
string
required
Role of the message (user or assistant).
string
required
Message text.
Date
required
Timestamp when the message was created.
InlineAd properties
string
required
Unique ID of the message this ad belongs to.
string
Placement code provided during onboarding. Defaults to 'inlineAd'.
string
Theme of the ad, e.g. light or dark.
Slots
slot
Render-prop slot that lets you wrap the ad iframe in your own markup. The slot receives the rendered ad as ad:
<InlineAd :messageId="m.id"> <template #wrapper="{ ad }"> <div class="my-ad-card">{{ ad }}</div> </template></InlineAd>
Supported events
ad.clicked
The user has clicked the ad.
Show Payload
string
Ad ID.
string
Generated ad content.
string
Message ID.
string
Click URL.
string
Ad format.
string
Region of the creative the user clicked (e.g. 'cta', 'banner').
ad.viewed
The user has viewed the ad.
Show Payload
string
Ad ID.
string
Generated ad content.
string
Message ID.
string
Ad format.
number
The revenue of the ad (eCPM in USD).
ad.filled
Ad is available.
Show Payload
string
Ad ID.
string
Placement code this ad was matched to.
number
The revenue of the ad (eCPM in USD).
ad.no-fill
Ad is not available.
Show Payload
string
The code indicating the reason why the ad was skipped.
ad.render-started
Triggered before the first token is received.
Show Payload
string
Ad ID.
ad.render-completed
Triggered after the last token is received.
Show Payload
string
Ad ID.
ad.error
Triggered when an error occurs.
Show Payload
string
Error message.
string
Error code.
video.started
Triggered when the video playback starts.
Show Payload
string
Ad ID.
video.completed
Triggered when the video playback finishes.
Show Payload
string
Ad ID.
reward.granted
Triggered when a rewarded-ad reward is granted to the user.
Show Payload
string
Ad ID.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Kontext Documentation","colors":{"primary":"#FF682F","light":"#FF682F","dark":"#FF682F"},"logo":{"light":"https://mintcdn.com/kontext/cSTBM3iNvsT_Fm-X/logo/light.svg?fit=max\u0026auto=format\u0026n=cSTBM3iNvsT_Fm-X\u0026q=85\u0026s=31c1ad1d9c273a4f7ae529ee4ef3bedb","dark":"https://mintcdn.com/kontext/cSTBM3iNvsT_Fm-X/logo/dark.svg?fit=max\u0026auto=format\u0026n=cSTBM3iNvsT_Fm-X\u0026q=85\u0026s=22c43eed074c01e3ffb02e7028b8ae5b"},"favicon":"https://mintcdn.com/kontext/cSTBM3iNvsT_Fm-X/favicon.svg?fit=max\u0026auto=format\u0026n=cSTBM3iNvsT_Fm-X\u0026q=85\u0026s=7fcf8285ddde4170884f9cc8f6141b71","navbar":{"links":[{"href":"mailto:support@kontext.so","label":"Support"}],"primary":{"type":"button","label":"Go to kontext.so","href":"https://kontext.so"}},"styling":{"latex":false},"navigation":{"languages":[{"language":"en","href":"overview"},{"language":"zh","href":"zh/overview"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"kontext","hasAudioNarration":false,"actualSubdomain":"kontext","customDomains":["docs.kontext.so"],"gitSource":{"type":"github","owner":"kontextso","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6af2488cd4107adac0a78a43","clientVersion":"0.0.4167","searchFilterCounts":[{"language":"en","tag":"SDKs","count":61},{"language":"zh","tag":"SDK","count":61},{"language":"en","tag":"Conversational Ads","count":52},{"language":"en","tag":"Video Ads","count":51},{"language":"zh","tag":"对话广告","count":51},{"language":"zh","tag":"视频广告","count":50},{"language":"en","tag":"Guides","count":30},{"language":"en","tag":"Kotlin Video SDK","count":18},{"language":"zh","tag":"Kotlin 视频 SDK","count":18},{"language":"en","tag":"Swift Video SDK","count":16},{"language":"zh","tag":"Swift 视频 SDK","count":16},{"language":"zh","tag":"实践指南","count":15},{"language":"zh","tag":"指南","count":15},{"language":"en","tag":"Concepts","count":13},{"language":"zh","tag":"核心概念","count":13},{"language":"en","tag":"Resources","count":10},{"language":"zh","tag":"资源","count":8},{"language":"en","tag":"Players","count":7},{"language":"zh","tag":"播放器","count":7},{"language":"en","tag":"JavaScript SDK","count":6}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"sdk/vue/api","slug":"/sdk/vue/api","pageMetadata":{"title":"API reference","description":"Plugin options, composable, components, and events exposed by the Vue SDK.","href":"/sdk/vue/api"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Plugin options, composable, components, and events exposed by the Vue SDK.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{CodeBlock,Expandable,Heading,ParamField}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);return _jsxs(_Fragment,{children:[_jsxs(Heading,{level:`2`,id:`plugin-/-adsprovider-options`,children:[`Plugin / `,_jsx(_components.code,{children:`AdsProvider`}),` options`]}),`\n`,_jsx(ParamField,{path:`publisherToken`,type:`string`,required:true,id:`param-publisher-token`,children:_jsx(_components.p,{children:`Your unique publisher token.`})}),`\n`,_jsx(ParamField,{path:`userId`,type:`string`,required:true,id:`param-user-id`,children:_jsx(_components.p,{children:`Unique identifier that remains the same for the user’s lifetime (used for retargeting and rewarded ads).`})}),`\n`,_jsx(ParamField,{path:`userEmail`,type:`string`,optional:true,id:`param-user-email`,children:_jsx(_components.p,{children:`Email of the user.`})}),`\n`,_jsx(ParamField,{path:`conversationId`,type:`string`,required:true,id:`param-conversation-id`,children:_jsx(_components.p,{children:`Unique ID of the conversation.`})}),`\n`,_jsx(ParamField,{path:`enabledPlacementCodes`,type:`array`,optional:true,id:`param-enabled-placement-codes`,children:_jsxs(_components.p,{children:[`Placement codes enabled for the conversation. Defaults to `,_jsx(_components.code,{children:`['inlineAd']`}),`.`]})}),`\n`,_jsxs(ParamField,{path:`character`,type:`object`,optional:true,id:`param-character`,children:[_jsx(_components.p,{children:`Character object used in this conversation.`}),_jsxs(Expandable,{title:`Properties`,children:[_jsx(ParamField,{path:`id`,type:`string`,required:true,id:`param-id`,children:_jsx(_components.p,{children:`Unique ID of the character.`})}),_jsx(ParamField,{path:`name`,type:`string`,required:true,id:`param-name`,children:_jsx(_components.p,{children:`Name of the character.`})}),_jsx(ParamField,{path:`avatarUrl`,type:`string`,required:true,id:`param-avatar-url`,children:_jsx(_components.p,{children:`URL of the character’s avatar.`})}),_jsx(ParamField,{path:`isNsfw`,type:`boolean`,optional:true,id:`param-is-nsfw`,children:_jsx(_components.p,{children:`Indicates whether the character is NSFW.`})}),_jsx(ParamField,{path:`greeting`,type:`string`,optional:true,id:`param-greeting`,children:_jsx(_components.p,{children:`The character’s greeting.`})}),_jsx(ParamField,{path:`persona`,type:`string`,optional:true,id:`param-persona`,children:_jsx(_components.p,{children:`Description of the character’s personality.`})}),_jsx(ParamField,{path:`tags`,type:`array`,optional:true,id:`param-tags`,children:_jsx(_components.p,{children:`Tags describing the character.`})})]})]}),`\n`,_jsxs(ParamField,{path:`regulatory`,type:`object`,optional:true,id:`param-regulatory`,children:[_jsx(_components.p,{children:`Regulatory object used in this conversation.`}),_jsxs(Expandable,{title:`Properties`,children:[_jsx(ParamField,{path:`gdpr`,type:`integer`,optional:true,id:`param-gdpr`,children:_jsx(_components.p,{children:`Indicates whether the request is subject to GDPR regulations. (0 = No, 1 = Yes, null = Unknown)`})}),_jsx(ParamField,{path:`gdprConsent`,type:`string`,optional:true,id:`param-gdpr-consent`,children:_jsx(_components.p,{children:`The IAB Transparency and Consent Framework (TCF) consent string.`})}),_jsx(ParamField,{path:`coppa`,type:`integer`,optional:true,id:`param-coppa`,children:_jsx(_components.p,{children:`Indicates whether the request is subject to COPPA. (0 = No, 1 = Yes, null = Unknown)`})}),_jsx(ParamField,{path:`gpp`,type:`string`,optional:true,id:`param-gpp`,children:_jsx(_components.p,{children:`Global Privacy Platform (GPP) consent string.`})}),_jsx(ParamField,{path:`gppSid`,type:`array`,optional:true,id:`param-gpp-sid`,children:_jsx(_components.p,{children:`IDs of the GPP sections that apply to this transaction.`})}),_jsx(ParamField,{path:`usPrivacy`,type:`string`,optional:true,id:`param-us-privacy`,children:_jsx(_components.p,{children:`Signals regarding consumer privacy under US privacy regulations (e.g., CCPA, LSPA).`})})]})]}),`\n`,_jsx(ParamField,{path:`variantId`,type:`string`,optional:true,id:`param-variant-id`,children:_jsx(_components.p,{children:`Publisher-provided identifier for the user cohort (for A/B testing).`})}),`\n`,_jsx(ParamField,{path:`onEvent`,type:`function`,optional:true,id:`param-on-event`,children:_jsxs(_components.p,{children:[`Callback triggered when an event occurs. See `,_jsx(_components.a,{href:`#supported-events`,children:`Supported events`}),` below.`]})}),`\n`,_jsx(ParamField,{path:`onDebugEvent`,type:`function`,optional:true,id:`param-on-debug-event`,children:_jsxs(_components.p,{children:[`Callback for SDK-internal diagnostic events. Receives `,_jsx(_components.code,{children:`(name, data?)`}),` — useful when investigating preload/session behaviour during integration. Off by default.`]})}),`\n`,_jsxs(Heading,{level:`2`,id:`useads-composable`,children:[_jsx(_components.code,{children:`useAds()`}),` composable`]}),`\n`,_jsxs(_components.p,{children:[`Returns `,_jsx(_components.code,{children:`addMessage`}),`, a forwarder that always routes to the current session. If `,_jsx(_components.code,{children:`\u003cAdsProvider>`}),` swaps the session (e.g. `,_jsx(_components.code,{children:`publisherToken`}),` change), the next call hits the new one automatically.`]}),`\n`,_jsxs(ParamField,{path:`addMessage`,type:`function`,required:true,id:`param-add-message`,children:[_jsxs(_components.p,{children:[_jsx(_components.code,{children:`(message: Message, options?: AddMessageOptions) => void`}),` — register a new chat message with the SDK. The next preload is scheduled automatically.`]}),_jsxs(_components.p,{children:[_jsx(_components.code,{children:`AddMessageOptions`}),` currently exposes one flag:`]}),_jsx(Expandable,{title:`AddMessageOptions`,children:_jsx(ParamField,{path:`trackOnly`,type:`boolean`,optional:true,id:`param-track-only`,children:_jsxs(_components.p,{children:[`When `,_jsx(_components.code,{children:`true`}),`, the preload request still goes out for analytics but no ad will be shown for this message. Use this to suppress ads without losing tracking data.`]})})})]}),`\n`,_jsxs(Heading,{level:`2`,id:`message-shape`,children:[_jsx(_components.code,{children:`Message`}),` shape`]}),`\n`,_jsx(ParamField,{path:`id`,type:`string`,required:true,id:`param-id-1`,children:_jsx(_components.p,{children:`Unique ID of the message.`})}),`\n`,_jsx(ParamField,{path:`role`,type:`string`,required:true,id:`param-role`,children:_jsxs(_components.p,{children:[`Role of the message (`,_jsx(_components.code,{children:`user`}),` or `,_jsx(_components.code,{children:`assistant`}),`).`]})}),`\n`,_jsx(ParamField,{path:`content`,type:`string`,required:true,id:`param-content`,children:_jsx(_components.p,{children:`Message text.`})}),`\n`,_jsx(ParamField,{path:`createdAt`,type:`Date`,required:true,id:`param-created-at`,children:_jsx(_components.p,{children:`Timestamp when the message was created.`})}),`\n`,_jsxs(Heading,{level:`2`,id:`inlinead-properties`,children:[_jsx(_components.code,{children:`InlineAd`}),` properties`]}),`\n`,_jsx(ParamField,{path:`messageId`,type:`string`,required:true,id:`param-message-id`,children:_jsx(_components.p,{children:`Unique ID of the message this ad belongs to.`})}),`\n`,_jsx(ParamField,{path:`code`,type:`string`,optional:true,id:`param-code`,children:_jsxs(_components.p,{children:[`Placement code provided during onboarding. Defaults to `,_jsx(_components.code,{children:`'inlineAd'`}),`.`]})}),`\n`,_jsx(ParamField,{path:`theme`,type:`string`,optional:true,id:`param-theme`,children:_jsxs(_components.p,{children:[`Theme of the ad, e.g. `,_jsx(_components.code,{children:`light`}),` or `,_jsx(_components.code,{children:`dark`}),`.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`slots`,children:`Slots`}),`\n`,_jsxs(ParamField,{path:`wrapper`,type:`slot`,optional:true,id:`param-wrapper`,children:[_jsxs(_components.p,{children:[`Render-prop slot that lets you wrap the ad iframe in your own markup. The slot receives the rendered ad as `,_jsx(_components.code,{children:`ad`}),`:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`vue`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`vue`,children:_jsxs(_components.code,{language:`vue`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`InlineAd`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` :`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:`messageId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`m`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`>`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` \u003ctemplate #wrapper=\"{ ad }\">`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` \u003cdiv class=\"my-ad-card\">{{ ad }}\u003c/div>`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c/template>`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`\u003c/`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`InlineAd`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`>`})]}),`\n`]})})})]}),`\n`,_jsx(Heading,{level:`2`,id:`supported-events`,children:`Supported events`}),`\n`,_jsx(Heading,{level:`3`,id:`ad-clicked`,children:_jsx(_components.code,{children:`ad.clicked`})}),`\n`,_jsx(_components.p,{children:`The user has clicked the ad.`}),`\n`,_jsxs(Expandable,{title:`Payload`,children:[_jsx(ParamField,{path:`id`,type:`string`,id:`param-id-2`,children:`Ad ID.`}),_jsx(ParamField,{path:`content`,type:`string`,id:`param-content-1`,children:`Generated ad content.`}),_jsx(ParamField,{path:`messageId`,type:`string`,id:`param-message-id-1`,children:`Message ID.`}),_jsx(ParamField,{path:`url`,type:`string`,id:`param-url`,children:`Click URL.`}),_jsx(ParamField,{path:`format`,type:`string`,id:`param-format`,children:`Ad format.`}),_jsxs(ParamField,{path:`area`,type:`string`,id:`param-area`,children:[`Region of the creative the user clicked (e.g. `,_jsx(_components.code,{children:`'cta'`}),`, `,_jsx(_components.code,{children:`'banner'`}),`).`]})]}),`\n`,_jsx(Heading,{level:`3`,id:`ad-viewed`,children:_jsx(_components.code,{children:`ad.viewed`})}),`\n`,_jsx(_components.p,{children:`The user has viewed the ad.`}),`\n`,_jsxs(Expandable,{title:`Payload`,children:[_jsx(ParamField,{path:`id`,type:`string`,id:`param-id-3`,children:`Ad ID.`}),_jsx(ParamField,{path:`content`,type:`string`,id:`param-content-2`,children:`Generated ad content.`}),_jsx(ParamField,{path:`messageId`,type:`string`,id:`param-message-id-2`,children:`Message ID.`}),_jsx(ParamField,{path:`format`,type:`string`,id:`param-format-1`,children:`Ad format.`}),_jsx(ParamField,{path:`revenue`,type:`number`,optional:true,id:`param-revenue`,children:`The revenue of the ad (eCPM in USD).`})]}),`\n`,_jsx(Heading,{level:`3`,id:`ad-filled`,children:_jsx(_components.code,{children:`ad.filled`})}),`\n`,_jsx(_components.p,{children:`Ad is available.`}),`\n`,_jsxs(Expandable,{title:`Payload`,children:[_jsx(ParamField,{path:`id`,type:`string`,id:`param-id-4`,children:`Ad ID.`}),_jsx(ParamField,{path:`code`,type:`string`,id:`param-code-1`,children:`Placement code this ad was matched to.`}),_jsx(ParamField,{path:`revenue`,type:`number`,optional:true,id:`param-revenue-1`,children:`The revenue of the ad (eCPM in USD).`})]}),`\n`,_jsx(Heading,{level:`3`,id:`ad-no-fill`,children:_jsx(_components.code,{children:`ad.no-fill`})}),`\n`,_jsx(_components.p,{children:`Ad is not available.`}),`\n`,_jsx(Expandable,{title:`Payload`,children:_jsx(ParamField,{path:`skipCode`,type:`string`,id:`param-skip-code`,children:`The code indicating the reason why the ad was skipped.`})}),`\n`,_jsx(Heading,{level:`3`,id:`ad-render-started`,children:_jsx(_components.code,{children:`ad.render-started`})}),`\n`,_jsx(_components.p,{children:`Triggered before the first token is received.`}),`\n`,_jsx(Expandable,{title:`Payload`,children:_jsx(ParamField,{path:`id`,type:`string`,id:`param-id-5`,children:`Ad ID.`})}),`\n`,_jsx(Heading,{level:`3`,id:`ad-render-completed`,children:_jsx(_components.code,{children:`ad.render-completed`})}),`\n`,_jsx(_components.p,{children:`Triggered after the last token is received.`}),`\n`,_jsx(Expandable,{title:`Payload`,children:_jsx(ParamField,{path:`id`,type:`string`,id:`param-id-6`,children:`Ad ID.`})}),`\n`,_jsx(Heading,{level:`3`,id:`ad-error`,children:_jsx(_components.code,{children:`ad.error`})}),`\n`,_jsx(_components.p,{children:`Triggered when an error occurs.`}),`\n`,_jsxs(Expandable,{title:`Payload`,children:[_jsx(ParamField,{path:`message`,type:`string`,id:`param-message`,children:`Error message.`}),_jsx(ParamField,{path:`errCode`,type:`string`,id:`param-err-code`,children:`Error code.`})]}),`\n`,_jsx(Heading,{level:`3`,id:`video-started`,children:_jsx(_components.code,{children:`video.started`})}),`\n`,_jsx(_components.p,{children:`Triggered when the video playback starts.`}),`\n`,_jsx(Expandable,{title:`Payload`,children:_jsx(ParamField,{path:`id`,type:`string`,id:`param-id-7`,children:`Ad ID.`})}),`\n`,_jsx(Heading,{level:`3`,id:`video-completed`,children:_jsx(_components.code,{children:`video.completed`})}),`\n`,_jsx(_components.p,{children:`Triggered when the video playback finishes.`}),`\n`,_jsx(Expandable,{title:`Payload`,children:_jsx(ParamField,{path:`id`,type:`string`,id:`param-id-8`,children:`Ad ID.`})}),`\n`,_jsx(Heading,{level:`3`,id:`reward-granted`,children:_jsx(_components.code,{children:`reward.granted`})}),`\n`,_jsx(_components.p,{children:`Triggered when a rewarded-ad reward is granted to the user.`}),`\n`,_jsx(Expandable,{title:`Payload`,children:_jsx(ParamField,{path:`id`,type:`string`,id:`param-id-9`,children:`Ad ID.`})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"API reference","description":"Plugin options, composable, components, and events exposed by the Vue SDK.","href":"/sdk/vue/api"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Plugin / AdsProvider options","slug":"plugin-/-adsprovider-options","depth":2,"children":[]},{"title":"useAds() composable","slug":"useads-composable","depth":2,"children":[]},{"title":"Message shape","slug":"message-shape","depth":2,"children":[]},{"title":"InlineAd properties","slug":"inlinead-properties","depth":2,"children":[{"title":"Slots","slug":"slots","depth":3,"children":[]}]},{"title":"Supported events","slug":"supported-events","depth":2,"children":[{"title":"ad.clicked","slug":"ad-clicked","depth":3,"children":[]},{"title":"ad.viewed","slug":"ad-viewed","depth":3,"children":[]},{"title":"ad.filled","slug":"ad-filled","depth":3,"children":[]},{"title":"ad.no-fill","slug":"ad-no-fill","depth":3,"children":[]},{"title":"ad.render-started","slug":"ad-render-started","depth":3,"children":[]},{"title":"ad.render-completed","slug":"ad-render-completed","depth":3,"children":[]},{"title":"ad.error","slug":"ad-error","depth":3,"children":[]},{"title":"video.started","slug":"video-started","depth":3,"children":[]},{"title":"video.completed","slug":"video-completed","depth":3,"children":[]},{"title":"reward.granted","slug":"reward-granted","depth":3,"children":[]}]}],"codeExamples":{}},"jsLinks":[],"subdomain":"kontext","siteName":"Kontext Documentation","title":"API reference - Kontext Documentation","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"en":{"href":"/sdk/vue/api","matchLevel":0},"zh":{"href":"/zh/sdk/vue/api","matchLevel":1}}},"lastModified":"2026-05-19T17:21:06.326Z","originalFileLocation":"sdk/vue/api.mdx","locale":"en"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Plugin options, composable, components, and events exposed by the Vue SDK.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Kontext Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/kontext/3zw6PkR8hX7T_tb1/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/kontext/3zw6PkR8hX7T_tb1/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/kontext/3zw6PkR8hX7T_tb1/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/kontext/3zw6PkR8hX7T_tb1/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/kontext/3zw6PkR8hX7T_tb1/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/kontext/3zw6PkR8hX7T_tb1/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/kontext/3zw6PkR8hX7T_tb1/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/kontext/3zw6PkR8hX7T_tb1/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/kontext/3zw6PkR8hX7T_tb1/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"API reference - Kontext Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Plugin options, composable, components, and events exposed by the Vue SDK.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Kontext Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.kontext.so/sdk/vue/api\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://kontext.mintlify.site/_mintlify/api/og/v2?division=Vue+SDK\u0026amp;title=API+reference\u0026amp;description=Plugin+options%2C+composable%2C+components%2C+and+events+exposed+by+the+Vue+SDK.\u0026amp;theme=44e9612051797cc564ea14ef\u0026amp;signature=132199667c8a909d031341e928ccaaf83a60730d0c15917765ba4e10c23c9d84\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"API reference - Kontext Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Plugin options, composable, components, and events exposed by the Vue SDK.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://kontext.mintlify.site/_mintlify/api/og/v2?division=Vue+SDK\u0026amp;title=API+reference\u0026amp;description=Plugin+options%2C+composable%2C+components%2C+and+events+exposed+by+the+Vue+SDK.\u0026amp;theme=44e9612051797cc564ea14ef\u0026amp;signature=132199667c8a909d031341e928ccaaf83a60730d0c15917765ba4e10c23c9d84\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/kontext/3zw6PkR8hX7T_tb1/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Kontext Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#FF682F\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.kontext.so/sdk/vue/api\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/sdk/vue/api.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://docs.kontext.so/sdk/vue/api\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"zh\" href=\"https://docs.kontext.so/zh/sdk/vue/api\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://docs.kontext.so/sdk/vue/api\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.kontext.so/#organization\",\"name\":\"Kontext Documentation\",\"url\":\"https://docs.kontext.so\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/kontext/cSTBM3iNvsT_Fm-X/logo/light.svg?fit=max\u0026auto=format\u0026n=cSTBM3iNvsT_Fm-X\u0026q=85\u0026s=31c1ad1d9c273a4f7ae529ee4ef3bedb\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.kontext.so#website\",\"name\":\"Kontext Documentation\",\"url\":\"https://docs.kontext.so\",\"publisher\":{\"@id\":\"https://docs.kontext.so/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.kontext.so/sdk/vue/api#webpage\",\"url\":\"https://docs.kontext.so/sdk/vue/api\",\"name\":\"API reference\",\"description\":\"Plugin options, composable, components, and events exposed by the Vue SDK.\",\"dateModified\":\"2026-05-19T17:21:06.326Z\",\"isPartOf\":{\"@id\":\"https://docs.kontext.so#website\"},\"breadcrumb\":{\"@id\":\"https://docs.kontext.so/sdk/vue/api#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.kontext.so/sdk/vue/api#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"SDKs\",\"item\":\"https://docs.kontext.so/sdk/swift\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Vue SDK\",\"item\":\"https://docs.kontext.so/sdk/vue\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"API reference\",\"item\":\"https://docs.kontext.so/sdk/vue/api\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.kontext.so/sdk/vue/api#article\",\"headline\":\"API reference\",\"name\":\"API reference\",\"description\":\"Plugin options, composable, components, and events exposed by the Vue SDK.\",\"url\":\"https://docs.kontext.so/sdk/vue/api\",\"mainEntityOfPage\":{\"@id\":\"https://docs.kontext.so/sdk/vue/api#webpage\"},\"dateModified\":\"2026-05-19T17:21:06.326Z\",\"publisher\":{\"@id\":\"https://docs.kontext.so/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.kontext.so#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Kontext Documentation\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Kontext Documentation\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/sdk/vue/api.md","siteName":"Kontext Documentation","nav":{"global":null,"languages":[{"language":"en","tabs":[{"tab":"Conversational Ads","groups":[{"group":"Get Started","pages":[{"title":"Overview","href":"/overview"},{"title":"Advertisers","href":"/advertisers"},{"title":"Publishers","href":"/publishers"}]},{"group":"Concepts","pages":[{"title":"How it works","href":"/concepts/how-it-works"},{"title":"Session lifecycle","href":"/concepts/session"},{"title":"IDs and tokens","href":"/concepts/ids-and-tokens"},{"title":"Messages","href":"/concepts/messages"},{"title":"Displaying ads","href":"/concepts/displaying-ads"},{"title":"Ad formats","href":"/concepts/ad-formats"},{"title":"Ad engine","href":"/concepts/ad-engine"},{"title":"Ad lifecycle events","href":"/concepts/events"},{"title":"Pacing","href":"/concepts/pacing"}]},{"group":"Guides","pages":[{"title":"Testing","href":"/guides/testing"},{"title":"Debugging","href":"/guides/debugging"},{"title":"IFA \u0026 ATT","href":"/guides/ifa"},{"title":"SKAdNetwork","href":"/guides/skadnetwork"},{"title":"ads.txt \u0026 app-ads.txt","href":"/guides/ads-txt"},{"title":"TCF \u0026 CMP","href":"/guides/tcf-cmp"},{"title":"Advertiser pixel","href":"/guides/advertiser-pixel"},{"title":"Best practices","href":"/guides/best-practices"}]},{"group":"SDKs","pages":[{"group":"Swift SDK","pages":[{"title":"Swift SDK","sidebarTitle":"Overview","href":"/sdk/swift"},{"title":"Installation","href":"/sdk/swift/installation"},{"title":"Showing your first ad","href":"/sdk/swift/first-ad"},{"title":"API reference","href":"/sdk/swift/api"},{"title":"Guides","href":"/sdk/swift/guides"},{"title":"Example app","href":"/sdk/swift/example"}]},{"group":"Kotlin SDK","pages":[{"title":"Kotlin SDK","sidebarTitle":"Overview","href":"/sdk/kotlin"},{"title":"Installation","href":"/sdk/kotlin/installation"},{"title":"Showing your first ad","href":"/sdk/kotlin/first-ad"},{"title":"API reference","href":"/sdk/kotlin/api"},{"title":"Guides","href":"/sdk/kotlin/guides"},{"title":"Example app","href":"/sdk/kotlin/example"}]},{"title":"Flutter SDK","href":"/sdk/flutter"},{"title":"React Native SDK","href":"/sdk/react-native"},{"title":"React SDK","href":"/sdk/react"},{"group":"Vue SDK","pages":[{"title":"Vue SDK","sidebarTitle":"Overview","href":"/sdk/vue"},{"title":"Installation","href":"/sdk/vue/installation"},{"title":"Showing your first ad","description":"Install the Kontext plugin, feed messages, mount \u003cInlineAd>, observe events.","href":"/sdk/vue/first-ad"},{"title":"API reference","href":"/sdk/vue/api"},{"title":"Guides","description":"Patterns and recipes for common Vue SDK integration tasks.","href":"/sdk/vue/guides"},{"title":"Example app","href":"/sdk/vue/example"}]},{"group":"JavaScript SDK","pages":[{"title":"JavaScript SDK","sidebarTitle":"Overview","href":"/sdk/js"},{"title":"Installation","href":"/sdk/js/installation"},{"title":"Showing your first ad","href":"/sdk/js/first-ad"},{"title":"API reference","href":"/sdk/js/api"},{"title":"Guides","href":"/sdk/js/guides"},{"title":"Example app","href":"/sdk/js/example"}]}]},{"group":"Resources","pages":[{"title":"Changelog","href":"/resources/changelog"},{"title":"Demos","href":"/resources/demos"},{"title":"Compliance","href":"/resources/compliance"},{"title":"Subprocessors","href":"/resources/subprocessors"},{"title":"Support","href":"/resources/support"}]}]},{"tab":"Video Ads","pages":[{"title":"Video Ads","href":"/video/overview"}]}]},{"language":"zh","pages":[{"title":"zh","href":"/zh/sdk/vue/api"}]}]},"basePath":"","title":"API reference - Kontext Documentation","buildId":"dpl_9RFrWkXdFTJCytfx6jAofvAaEXr6","deploymentId":"dpl_9RFrWkXdFTJCytfx6jAofvAaEXr6","dynamics":[],"chunks":[]}