Skip to main content

Overview

The Oration Widget SDK is a lightweight, embeddable web component (<oration-widget>) that adds AI voice and chat agents to any website. No framework or build step required — just a script tag.

Quick start

Widget initial view - Ready to talk button

Getting your keys

  1. Public key — copy your workspace public key from the Oration Dashboard
  2. Agent ID — create an agent and copy its ID from the agents section

Configuration

Required attributes

Optional attributes

Conversation types

Web mode (default)

Real-time voice conversation.
Widget in voice conversation mode with live transcript

Chat mode

Text-based chat interface.
Widget in chat mode with text conversation

User choice mode

Lets users pick between voice and chat.
Widget conversation type selector - Voice or Chat options

Widget sizes

Tiny widget size during voice conversation

Multi-language support

Map BCP-47 language codes to specific agent IDs. A language selector will appear in the widget when the map contains at least one entry.
Widget with language selector dropdown showing English and Hindi options Agent selection logic:
  • If agent-language-id-map is provided, the map takes priority over default-agent-id
  • If default-agent-id exists as a value in the map, it is pre-selected
  • Otherwise the first entry in the map is used as the default

Dynamic variables

Pass context to your agent using the dynamic-variables attribute. Values must be a JSON object of string key-value pairs.
Variables are available in session metadata during the conversation. Common uses: user identification, current page context, subscription tier, A/B test variant.

Programmatic updates

Theme customization

Pass a JSON object to theme with any subset of the following keys. Missing keys fall back to defaults.

Theme keys

All values must be hex color strings.
Widget with custom orange theme applied to chat interface

Color mode

Use color-mode to force light or dark theme, or let the widget follow the user’s system preference:

External button trigger

Any element with id="oration-conversation-trigger" will open the widget when clicked. The trigger respects the widget’s current state (no-op while connecting).
If conversation-type="both", the trigger shows the conversation type selector first.

Terms acceptance

Show a consent gate before the first conversation. Acceptance is stored in localStorage and won’t be shown again.

Troubleshooting

Widget not loading — check the browser console, verify the script tag is present, and confirm your public key and agent ID are correct. Styling issues — the widget uses Shadow DOM for style isolation. Custom styles must go through the theme attribute. No microphone access — browser microphone permissions must be granted for voice conversations. Conversation fails — verify the agent is configured and your workspace has sufficient credits.
Your public key is visible in client-side code. Only use it on authorized domains. Never expose private API keys in the browser.

Need help? Contact us at support@oration.ai