Skip to Academy content
Guest progress is stored only in this browser on this device.
Course outline
Step 2 of 3
Revision 2026-08-12-interactive
7 min

TalkIt JavaScript SDK

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

@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.

Practice and knowledge checks

Apply the lesson and complete the required knowledge checks or manual tasks.

Practical task
Required

Implement the relay boundary

Create a server route that requests a short-lived TalkIt website session grant for the signed-in user, then pass only that grant to the browser SDK.

Your progress

This step completes when all required exercises pass.

Complete the required exercises above to finish this step.