Skip to Content
DocumentationVoice SDKOverview

Voice SDK

@oshara/voice-sdk embeds the Oshara voice agent into any web app. Add your agent slug (and optionally an API key) and everything initializes exactly like the widget: appearance is fetched, the voice call connects, and agent-triggered forms surface automatically.

The same package ships four ways to create an agent, so you can pick the level of control you need:

GoalImportWhat you get
Script tagwidget.jsDrop-in embeddable widget, zero build step
Prebuilt UI@oshara/voice-sdk/uimountVoiceUI(client) — the full widget UI, mounted anywhere
Custom UI@oshara/voice-sdkHeadless client — typed events + methods, zero DOM
React@oshara/voice-sdk/reactuseVoiceAgent() hook + <VoiceWidget> component

All four paths sit on top of the same headless core (createVoiceAgent). The prebuilt UI, the React bindings, and the embeddable widget are just thin layers over the events and methods documented in Client API and Events.

How it fits together

┌──────────────────────────────┐ your code ──► │ createVoiceAgent(config) │ ◄─ headless core │ • fetches appearance │ │ • connects the LiveKit call │ │ • emits typed events │ │ • owns the form model │ └──────────────┬────────────────┘ │ events + methods ┌───────────────────────┼───────────────────────┐ ▼ ▼ ▼ mountVoiceUI(client) your custom UI useVoiceAgent(config) (prebuilt widget) (vanilla / Vue / …) <VoiceWidget /> (React)

What you need first

  • An Oshara account — sign up at app.oshara.ai .
  • An agent slug — the URL-friendly identifier of the AI character you want to embed (e.g. support-bot).
  • For browser embeds: the domain you serve from must be on the character’s Allowed Origins list in the dashboard. No API key needed.
  • For server / Node usage: a secret API key (sk_…). See Authentication.

Next steps

Last updated on