SDKsWeb SDK

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

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:

  1. Your backend creates a session and gets a connection token. See WebRTC channel for creating the session, and Authentication for the API key.
  2. Your frontend passes that token to the SDK and mounts the widget.
  3. 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.

Next steps

On this page