Skip to documentation content
Docs
Documentation navigation
Reference
7 min read

TalkIt JavaScript SDK

Install the TalkIt browser SDK and choose the supported chat, voice, or server-relay entry point.

UpdatedByTalkIt Docs team
On this page

@talkit-llc/talkit-js provides browser clients for TalkIt text chat and voice calls. A separate server-only export creates Website session grants without exposing integration credentials to the browser.

Install

terminal
npm install @talkit-llc/talkit-js

Choose a client

Entry pointEnvironmentPurpose
createTalkitChatBrowserConnect a text session and send messages.
createTalkitCallBrowserStart and control a voice session.
createTalkitServerRelayGrantTrusted serverExchange Website credentials for a one-use session grant.

The browser clients both require a baseUrl and an asynchronous getSessionToken function. That function should call your authenticated backend and return its short-lived grant response.

Text chat

Read the generated createTalkitChat reference for configuration, events, connection lifecycle, and cleanup.

Voice calls

Read the generated createTalkitCall reference for microphone startup, events, call commands, and cleanup.

Server-relay grants

Import the server helper from the dedicated server entry point:

grant.ts
import { createTalkitServerRelayGrant } from '@talkit-llc/talkit-js/server'

const grant = await createTalkitServerRelayGrant({
  apiBaseUrl: process.env.TALKIT_BASE_URL!,
  clientId: process.env.TALKIT_WEBSITE_CLIENT_ID!,
  clientSecret: process.env.TALKIT_WEBSITE_CLIENT_SECRET!,
  channel: 'text',
  externalSubjectId: `customer:${user.id}`,
  externalSessionId: `session:${session.id}`,
})

Derive customer and session identifiers from authenticated server-side state. Never accept them blindly from browser JSON, and never return the client secret with the grant.

Follow Connect Web Chat for the complete server and browser flow.

Was this page helpful?

Page feedback is not available right now.