Let the agent act on your page during the call: open a page, show a product, fill in a form.
A client event is a tool that runs on your page instead of your server. When the agent calls it, the event and its
arguments go straight to the page your widget or iframe is on,
and your code reacts: open the pricing page, show a product, fill in a form, highlight a slot in a calendar.
Tool on Your server
Client event (Your page)
Goes to
Your HTTPS endpoint
The page your widget or iframe is on
The agent
Waits for your reply (up to 10 seconds) and uses it
Carries on right away
Use it to
Look things up, take actions: an order’s status, a booking, your CRM
Change what the caller sees
Set one up
Open the agent’s Tools tab and click Add tool.
Set Runs on to Your page.
Fill in the Function name (such as show_pricing), When to use it (the agent reads it to decide when to call
it) and its Parameters.
Click Save changes.
Parameters work like a tool’s: one row each in Simple (a name, a type, a
description, required or not), or a JSON Schema object in JSON Schema, for choices, lists and nested objects. For
example, show_pricing with a choice of plan:
{ "type": "object", "properties": { "plan": { "type": "string", "enum": ["starter", "pro", "enterprise"], "description": "The plan the caller asked about" } }, "required": ["plan"]}
Mention it in the agent’s prompt too, such as When the caller asks about pricing, show the
plan with show_pricing while you explain it.
Listen on your page
Add one listener to the page your widget or iframe is on. It works the same for both.
The arguments the agent collected, matching the parameters
How it behaves
Fire-and-forget. The agent learns Done. as soon as the event is sent, and the conversation carries on. Your
page’s reply doesn’t reach the agent: to give it an answer, use a tool on your server.
Only around a call. Events are sent while a call is live, once per tool call. The agent may call the same tool
more than once.
Only in an embed. The widget and the iframe send them to your page. The share link (no page around it) and test
calls in the dashboard don’t.
Check event.origin, so only the agent’s call page can send you events. Your page gets the arguments as the agent
wrote them, from the conversation: treat them like user input, and check them before you act on them.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Talking Avatar","description":"Realistic talking avatars for voice agents, no-code AI voice agents, and a free open-source 3D talking avatar for the browser.","colors":{"primary":"#5B50D6","light":"#8E85F2","dark":"#463CC0"},"logo":{"light":"https://mintcdn.com/talking-avatar-dev/XqO5mCje4YpyAVum/logo/light.png?fit=max\u0026auto=format\u0026n=XqO5mCje4YpyAVum\u0026q=85\u0026s=854bf1c09eeeda085b9cbc8f69233292","dark":"https://mintcdn.com/talking-avatar-dev/XqO5mCje4YpyAVum/logo/dark.png?fit=max\u0026auto=format\u0026n=XqO5mCje4YpyAVum\u0026q=85\u0026s=30fb5eebac1f8074448a1834e6cb7bd5","href":"https://talking-avatar.dev"},"favicon":"https://mintcdn.com/talking-avatar-dev/XqO5mCje4YpyAVum/favicon.svg?fit=max\u0026auto=format\u0026n=XqO5mCje4YpyAVum\u0026q=85\u0026s=371e30ce3bd4e77ac5ec8e1a9dd7fd7c","api":{"playground":{"display":"interactive"},"examples":{"autogenerate":false},"mdx":{"auth":{"method":"bearer"},"server":"https://backend.talking-avatar.dev/api/talking-avatar"}},"background":{"color":{"light":"#FCFCFD","dark":"#0F0E1A"}},"navbar":{"links":[{"href":"https://talking-avatar.dev/demo","label":"Live demo"},{"href":"mailto:support@talking-avatar.dev","label":"Support"}],"primary":{"type":"button","label":"Dashboard","href":"https://app.talking-avatar.dev"}},"footer":{"socials":{"github":"https://github.com/interviewflowai/talking-avatar","website":"https://talking-avatar.dev"}},"seo":{"metatags":{"og:site_name":"Talking Avatar Docs"}},"styling":{"latex":true},"navigation":{"global":{"anchors":[{"anchor":"Website","icon":"globe","href":"https://talking-avatar.dev"},{"anchor":"GitHub","icon":"github","href":"https://github.com/interviewflowai/talking-avatar"},{"anchor":"npm","icon":"npm","href":"https://www.npmjs.com/package/@talkingavatar/sdk"},{"anchor":"Slack community","icon":"slack","href":"https://join.slack.com/t/talking-avatar/shared_invite/zt-4e3u9h2ts-JqpSZc~U1ScpKM_IrOq9Ow"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"talking-avatar-dev","hasAudioNarration":false,"actualSubdomain":"talking-avatar-dev","customDomains":["docs.talking-avatar.dev"],"gitSource":{"type":"github","owner":"tushar1357","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":"","_id":"6adf4e40d9bc4ba6afb7e61a"},"entitlements":{},"buildId":"6af700c2e0d078336552b942","clientVersion":"0.0.4143","searchFilterCounts":[{"language":"default","tag":"Guides","count":45},{"language":"default","tag":"API reference","count":26},{"language":"default","tag":"Voice Agents (no code)","count":15},{"language":"default","tag":"Realistic Avatars (API)","count":10},{"language":"default","tag":"Open Source (3D, free)","count":7},{"language":"default","tag":"SDK reference","count":7},{"language":"default","tag":"Your account","count":5},{"language":"default","tag":"Knowledge bases","count":5},{"language":"default","tag":"Voice agents","count":5},{"language":"default","tag":"Realtime avatar API","count":4}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"voice-agents/client-events","slug":"/voice-agents/client-events","pageMetadata":{"title":"Client events","description":"Let the agent act on your page during the call: open a page, show a product, fill in a form.","icon":"browser","href":"/voice-agents/client-events"},"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: \"Let the agent act on your page during the call: open a page, show a product, fill in a form.\"\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`,em:`em`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,CodeGroup,Heading,Table,Tip,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`A client event is a tool that runs on `,_jsx(_components.strong,{children:`your page`}),` instead of your server. When the agent calls it, the event and its\narguments go straight to the page your `,_jsx(_components.a,{href:`/voice-agents/share-and-embed#embed-on-your-website`,children:`widget or iframe`}),` is on,\nand your code reacts: open the pricing page, show a product, fill in a form, highlight a slot in a calendar.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{}),_jsxs(_components.th,{children:[`Tool on `,_jsx(_components.strong,{children:`Your server`})]}),_jsxs(_components.th,{children:[`Client event (`,_jsx(_components.strong,{children:`Your page`}),`)`]})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Goes to`}),_jsx(_components.td,{children:`Your HTTPS endpoint`}),_jsx(_components.td,{children:`The page your widget or iframe is on`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`The agent`}),_jsx(_components.td,{children:`Waits for your reply (up to 10 seconds) and uses it`}),_jsx(_components.td,{children:`Carries on right away`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Use it to`}),_jsx(_components.td,{children:`Look things up, take actions: an order’s status, a booking, your CRM`}),_jsx(_components.td,{children:`Change what the caller sees`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`set-one-up`,children:`Set one up`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Open the agent’s `,_jsx(_components.strong,{children:`Tools`}),` tab and click `,_jsx(_components.strong,{children:`Add tool`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`Set `,_jsx(_components.strong,{children:`Runs on`}),` to `,_jsx(_components.strong,{children:`Your page`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`Fill in the `,_jsx(_components.strong,{children:`Function name`}),` (such as `,_jsx(_components.code,{children:`show_pricing`}),`), `,_jsx(_components.strong,{children:`When to use it`}),` (the agent reads it to decide when to call\nit) and its `,_jsx(_components.strong,{children:`Parameters`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`Click `,_jsx(_components.strong,{children:`Save changes`}),`.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Parameters work like a `,_jsx(_components.a,{href:`/voice-agents/tools#add-a-custom-tool`,children:`tool’s`}),`: one row each in `,_jsx(_components.strong,{children:`Simple`}),` (a name, a type, a\ndescription, required or not), or a JSON Schema object in `,_jsx(_components.strong,{children:`JSON Schema`}),`, for choices, lists and nested objects. For\nexample, `,_jsx(_components.code,{children:`show_pricing`}),` with a choice of plan:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`11`,language:`json`,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:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`11`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"object\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"properties\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"plan\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"string\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"enum\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"starter\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"pro\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"enterprise\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"description\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"The plan the caller asked about\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"required\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"plan\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`Mention it in the agent’s `,_jsx(_components.a,{href:`/voice-agents/prompting`,children:`prompt`}),` too, such as `,_jsx(_components.em,{children:`When the caller asks about pricing, show the\nplan with show_pricing while you explain it`}),`.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`listen-on-your-page`,children:`Listen on your page`}),`\n`,_jsx(_components.p,{children:`Add one listener to the page your widget or iframe is on. It works the same for both.`}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`JavaScript`,numberOfLines:`7`,language:`javascript`,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:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`window`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`addEventListener`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, (`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`origin`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` !==`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://app.talking-avatar.dev\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`?.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`type`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` !==`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"talking-avatar:client-event\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`tool`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`arguments`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`args`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` event`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`tool`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ===`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"show_pricing\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`showPricing`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`args`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`plan`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`); `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// { plan: \"pro\" }`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`React`,numberOfLines:`15`,language:`jsx`,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:`jsx`,children:_jsxs(_components.code,{language:`jsx`,numberOfLines:`15`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`useEffect`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"react\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`export`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` useClientEvents`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`handlers`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` useEffect`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(() `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` onMessage`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`origin`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` !==`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://app.talking-avatar.dev\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`?.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`type`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` !==`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"talking-avatar:client-event\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` handlers`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`tool`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]?.(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`arguments`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` };`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` window`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`addEventListener`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`onMessage`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` () `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` window`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`removeEventListener`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`onMessage`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }, [`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`handlers`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// useClientEvents({ show_pricing: ({ plan }) => setPlan(plan) });`})}),`\n`]})})})]}),`\n`,_jsx(Heading,{level:`2`,id:`what-your-page-receives`,children:`What your page receives`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`json`,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:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"talking-avatar:client-event\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"tool\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"show_pricing\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"arguments\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"plan\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"pro\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`type`})}),_jsxs(_components.td,{children:[`Always `,_jsx(_components.code,{children:`talking-avatar:client-event`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`tool`})}),_jsx(_components.td,{children:`The function name`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`arguments`})}),_jsx(_components.td,{children:`The arguments the agent collected, matching the parameters`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`how-it-behaves`,children:`How it behaves`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Fire-and-forget.`}),` The agent learns `,_jsx(_components.code,{children:`Done.`}),` as soon as the event is sent, and the conversation carries on. Your\npage’s reply doesn’t reach the agent: to give it an answer, use a `,_jsx(_components.a,{href:`/voice-agents/tools`,children:`tool on your server`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Only around a call.`}),` Events are sent while a call is live, once per tool call. The agent may call the same tool\nmore than once.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Only in an embed.`}),` The widget and the iframe send them to your page. The share link (no page around it) and test\ncalls in the dashboard don’t.`]}),`\n`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Check `,_jsx(_components.code,{children:`event.origin`}),`, so only the agent’s call page can send you events. Your page gets the arguments as the agent\nwrote them, from the conversation: treat them like user input, and check them before you act on them.`]})})]})}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":"Client events","description":"Let the agent act on your page during the call: open a page, show a product, fill in a form.","icon":"browser","href":"/voice-agents/client-events"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Set one up","slug":"set-one-up","depth":2,"children":[]},{"title":"Listen on your page","slug":"listen-on-your-page","depth":2,"children":[]},{"title":"What your page receives","slug":"what-your-page-receives","depth":2,"children":[]},{"title":"How it behaves","slug":"how-it-behaves","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"talking-avatar-dev","siteName":"Talking Avatar","title":"Client events - Talking Avatar","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-13T08:45:56.692Z","originalFileLocation":"voice-agents/client-events.mdx"},"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=\"Let the agent act on your page during the call: open a page, show a product, fill in a form.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Talking Avatar\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/talking-avatar-dev/zAkMraVcQjMTumKa/_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/talking-avatar-dev/zAkMraVcQjMTumKa/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/talking-avatar-dev/zAkMraVcQjMTumKa/_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/talking-avatar-dev/zAkMraVcQjMTumKa/_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/talking-avatar-dev/zAkMraVcQjMTumKa/_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/talking-avatar-dev/zAkMraVcQjMTumKa/_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/talking-avatar-dev/zAkMraVcQjMTumKa/_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/talking-avatar-dev/zAkMraVcQjMTumKa/_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/talking-avatar-dev/zAkMraVcQjMTumKa/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Client events - Talking Avatar\">\u003cmeta data-mint-head property=\"og:description\" content=\"Let the agent act on your page during the call: open a page, show a product, fill in a form.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Talking Avatar Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.talking-avatar.dev/voice-agents/client-events\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://talking-avatar-dev.mintlify.site/_mintlify/api/og/v2?division=Voice+Agents+%28no+code%29\u0026amp;title=Client+events\u0026amp;description=Let+the+agent+act+on+your+page+during+the+call%3A+open+a+page%2C+show+a+product%2C+fill+in+a+form.\u0026amp;theme=19f6956ab966387e8922eba2\u0026amp;signature=5cd48a0e280db14f908aa08089bd23278f4b63c7a7f0c2fac556f4959431db53\">\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=\"Client events - Talking Avatar\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Let the agent act on your page during the call: open a page, show a product, fill in a form.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://talking-avatar-dev.mintlify.site/_mintlify/api/og/v2?division=Voice+Agents+%28no+code%29\u0026amp;title=Client+events\u0026amp;description=Let+the+agent+act+on+your+page+during+the+call%3A+open+a+page%2C+show+a+product%2C+fill+in+a+form.\u0026amp;theme=19f6956ab966387e8922eba2\u0026amp;signature=5cd48a0e280db14f908aa08089bd23278f4b63c7a7f0c2fac556f4959431db53\">\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/talking-avatar-dev/zAkMraVcQjMTumKa/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Talking Avatar\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#5B50D6\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.talking-avatar.dev/voice-agents/client-events\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/voice-agents/client-events.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.talking-avatar.dev/#organization\",\"name\":\"Talking Avatar\",\"url\":\"https://docs.talking-avatar.dev\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/talking-avatar-dev/XqO5mCje4YpyAVum/logo/light.png?fit=max\u0026auto=format\u0026n=XqO5mCje4YpyAVum\u0026q=85\u0026s=854bf1c09eeeda085b9cbc8f69233292\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.talking-avatar.dev#website\",\"name\":\"Talking Avatar\",\"url\":\"https://docs.talking-avatar.dev\",\"publisher\":{\"@id\":\"https://docs.talking-avatar.dev/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.talking-avatar.dev/voice-agents/client-events#webpage\",\"url\":\"https://docs.talking-avatar.dev/voice-agents/client-events\",\"name\":\"Client events\",\"description\":\"Let the agent act on your page during the call: open a page, show a product, fill in a form.\",\"dateModified\":\"2026-11-13T08:45:56.692Z\",\"isPartOf\":{\"@id\":\"https://docs.talking-avatar.dev#website\"},\"breadcrumb\":{\"@id\":\"https://docs.talking-avatar.dev/voice-agents/client-events#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.talking-avatar.dev/voice-agents/client-events#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Voice Agents (no code)\",\"item\":\"https://docs.talking-avatar.dev/voice-agents/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Client events\",\"item\":\"https://docs.talking-avatar.dev/voice-agents/client-events\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.talking-avatar.dev/voice-agents/client-events#article\",\"headline\":\"Client events\",\"name\":\"Client events\",\"description\":\"Let the agent act on your page during the call: open a page, show a product, fill in a form.\",\"url\":\"https://docs.talking-avatar.dev/voice-agents/client-events\",\"mainEntityOfPage\":{\"@id\":\"https://docs.talking-avatar.dev/voice-agents/client-events#webpage\"},\"dateModified\":\"2026-11-13T08:45:56.692Z\",\"publisher\":{\"@id\":\"https://docs.talking-avatar.dev/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.talking-avatar.dev#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Talking Avatar\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Talking Avatar\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/voice-agents/client-events.md","siteName":"Talking Avatar","nav":{"global":{"anchors":[{"anchor":"Website","icon":"globe","href":"https://talking-avatar.dev"},{"anchor":"GitHub","icon":"github","href":"https://github.com/interviewflowai/talking-avatar"},{"anchor":"npm","icon":"npm","href":"https://www.npmjs.com/package/@talkingavatar/sdk"},{"anchor":"Slack community","icon":"slack","href":"https://join.slack.com/t/talking-avatar/shared_invite/zt-4e3u9h2ts-JqpSZc~U1ScpKM_IrOq9Ow"}]},"tabs":[{"tab":"Guides","groups":[{"group":"Get started","pages":[{"title":"Introduction","icon":"house","href":""},{"title":"Quickstart","icon":"rocket","href":"/get-started/quickstart"},{"title":"Choose a product","icon":"signs-post","href":"/get-started/choose-a-product"},{"title":"Pricing","icon":"credit-card","href":"/get-started/pricing"}]},{"group":"Your account","pages":[{"title":"Create an account and sign in","icon":"user-plus","href":"/dashboard/sign-up"},{"title":"Dashboard tour","icon":"table-columns","href":"/dashboard/overview"},{"title":"API keys","icon":"key","href":"/dashboard/api-keys"},{"title":"Usage","icon":"chart-line","href":"/dashboard/usage"},{"title":"Billing and credits","icon":"wallet","href":"/dashboard/billing"}]},{"group":"Voice Agents (no code)","pages":[{"title":"Voice Agents overview","icon":"wand-magic-sparkles","href":"/voice-agents/overview"},{"title":"Create a voice agent","icon":"plus","href":"/voice-agents/create-an-agent"},{"title":"Templates","icon":"copy","href":"/voice-agents/templates"},{"title":"Write a good prompt","icon":"pen-to-square","href":"/voice-agents/prompting"},{"title":"Avatar and voice","icon":"user","href":"/voice-agents/avatar-and-voice"},{"title":"Your own voices","icon":"microphone","href":"/voice-agents/your-own-voices"},{"title":"Conversation settings","icon":"comments","href":"/voice-agents/conversation-settings"},{"title":"Tools","description":"Let the agent look things up and take actions during the call through your HTTPS endpoints, or send events to your page.","icon":"wrench","href":"/voice-agents/tools"},{"title":"Client events","icon":"browser","href":"/voice-agents/client-events"},{"title":"Knowledge bases","description":"Give the agent your documents (FAQs, policies, product details) to answer callers from during the call.","icon":"book-open","href":"/voice-agents/knowledge-bases"},{"title":"Post-call webhook","icon":"webhook","href":"/voice-agents/webhooks"},{"title":"Share and embed","icon":"share-nodes","href":"/voice-agents/share-and-embed"},{"title":"Private agents","icon":"lock","href":"/voice-agents/private-agents"},{"title":"Calls and transcripts","icon":"phone","href":"/voice-agents/calls"},{"title":"What callers see","icon":"mobile-screen","href":"/voice-agents/caller-experience"}]},{"group":"Realistic Avatars (API)","pages":[{"title":"Realistic Avatars overview","icon":"code","href":"/realistic-avatars/overview"},{"title":"Quickstart","icon":"rocket","href":"/realistic-avatars/quickstart"},{"title":"LiveKit","icon":"tower-broadcast","href":"/realistic-avatars/livekit"},{"title":"Stream audio","icon":"waveform-lines","href":"/realistic-avatars/streaming-audio"},{"title":"Interruptions and speech events","icon":"hand","href":"/realistic-avatars/interruptions"},{"title":"Sessions and errors","icon":"circle-exclamation","href":"/realistic-avatars/sessions"},{"title":"Avatars","icon":"users","href":"/realistic-avatars/avatars"},{"title":"Custom avatars","icon":"wand-magic-sparkles","href":"/realistic-avatars/custom-avatars"},{"title":"Set up with a coding agent","icon":"robot","href":"/realistic-avatars/coding-agent"},{"title":"Production checklist","icon":"list-check","href":"/realistic-avatars/production-checklist"}]},{"group":"Open Source (3D, free)","pages":[{"title":"Open Source overview","icon":"github","href":"/open-source/overview"},{"title":"Quickstart","icon":"rocket","href":"/open-source/quickstart"},{"title":"Audio sources","icon":"waveform-lines","href":"/open-source/audio-sources"},{"title":"3D avatars","icon":"cube","href":"/open-source/avatars"},{"title":"Self-host the model and avatars","icon":"server","href":"/open-source/self-hosting-the-model"},{"title":"How it works","icon":"gears","href":"/open-source/how-it-works"},{"title":"Troubleshooting","icon":"screwdriver-wrench","href":"/open-source/troubleshooting"}]},{"group":"Help","pages":[{"title":"Troubleshooting","icon":"screwdriver-wrench","href":"/help/troubleshooting"},{"title":"FAQ","icon":"circle-question","href":"/help/faq"},{"title":"Security and privacy","icon":"shield-halved","href":"/help/security-and-privacy"},{"title":"Support","icon":"life-ring","href":"/help/support"}]}]},{"tab":"SDK reference","pages":[{"title":"SDK reference","href":"/sdk/installation"}]},{"tab":"API reference","pages":[{"title":"API reference","href":"/api-reference/introduction"}]}]},"basePath":"","title":"Client events - Talking Avatar","buildId":"dpl_Fyv1NbzwP68g2bEH2Roy98uY1zmE","deploymentId":"dpl_Fyv1NbzwP68g2bEH2Roy98uY1zmE","dynamics":[],"chunks":[]}