Overview
Embed a real-time audio and video Omniagent in the browser
The Web SDK embeds an Omniagent directly in your web application — a real-time agent your users can see, hear, and talk to. It ships a ready-made UI — the avatar widget, built-in controls, and tooltips — that you drop into any page, and a typed API for driving the session from your own code.
Start it with init, and on multi-page sites, persistence can keep one session alive as the user navigates — an always-on agent that survives page changes.
The SDK is framework-agnostic and works with React, Vue, Angular, or vanilla JavaScript. It ships with full TypeScript support, tree-shakeable exports, and zero external dependencies in standalone mode.
The package is published to npm as @touchcastllc/napster-companion-api.
New to the Napster API? The Quickstart walks the whole path end to end — create an Omniagent, mint a connection token on your backend, and embed it with this SDK — in a few minutes.
In this section
Installation
Add the SDK to your project — ESM or standalone build.
Initialization
Connect to a session with init and mount the widget.
Configuration
The full config object — position, layout, avatar style, features, and callbacks.
Features
Every built-in feature, from inactivity timeout to screen sharing.
Persistence
Keep one session alive across page navigation.
Events
Lifecycle callbacks and the incoming data your client receives.
Messaging
Send messages and commands to the agent from your code.
Methods
The instance API and the top-level SDK object.
Examples
Integration examples for React, Vue 3, Angular, and vanilla JS.
Troubleshooting
Common issues, debug mode, and performance notes.
Supported environments
Browsers
Chrome, Firefox, Safari, Edge
React
16 and up
Vue
2 and up
Angular
12 and up
Vanilla JS
No build tools required
How it fits together
The Web SDK is the browser client for the WebRTC channel. A typical integration has three parts:
- Your backend creates a session and gets a connection token. See WebRTC channel for creating the session, and Authentication for the API key.
- Your frontend passes that token to the SDK and mounts the widget.
- The SDK opens the WebRTC connection, renders the avatar, and exposes an instance you use to control the session.
The token is short-lived and scoped to a single session. Always mint it on your server — never ship your API key to the browser.