Skip to main content

Install

npm install @sippet-ai/sdk-js

What is included

  • Typed RPC actions
  • Realtime event helpers
  • SIP/WebRTC helpers

Public authentication model

Backend API access with secret key

Use createClient from your backend only.
import { createClient } from "@sippet-ai/sdk-js";

const client = createClient({ apiKey: process.env.SIPPET_SECRET_KEY! });

const calls = await client.listCalls({
  fields: ["id", "callUuid", "status"],
});
Do not send secret keys to browsers.

Browser realtime with ephemeral session_token

Mint a short-lived token on your backend with POST /api/realtime/session, then pass it as session_token.
import { initSocket, joinEventsChannel } from "@sippet-ai/sdk-js";

const { token } = await fetch("/api/sippet/realtime-session", {
  method: "POST",
  credentials: "include",
}).then((r) => r.json());

initSocket({
  baseUrl: "https://api.sippet.ai",
  socketOptions: {
    params: {
      session_token: token,
    },
  },
});

const channel = joinEventsChannel();

channel.on("incoming_call", (payload) => {
  console.log(payload);
});
Known event names:
  • incoming_call
  • call_answered
  • call_ended
  • operator_status_change
  • call_queue_entry_updated
  • call_queue_entry_deleted
  • call_participant_joined
  • call_participant_left
  • call_transcript_delta
  • call_transcript_completed
  • call_ai_audit_event
  • call_ai_usage

Internal dashboard auth

Cookie-based session auth is internal to the Sippet dashboard and is not a public integration method.

RPC reference

For the full list of public RPC actions and all available fields and input props, see:
  • /sdk-js/rpc-actions