npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@sippet-ai/sdk-js

v0.0.14

Published

Sippet AI's SDK to enable telephony calling features in any web application.

Readme

Sippet AI JS SDK

Typed JavaScript/TypeScript SDK for Sippet AI.

This package uses strict entrypoints:

  • @sippet-ai/sdk-js/client for browser-safe realtime and SIP media helpers.
  • @sippet-ai/sdk-js/server for RPC actions and server helpers.

Install

npm install @sippet-ai/sdk-js

Entry points

  • @sippet-ai/sdk-js/client
    • Realtime: initSocket, joinEventsChannel, createRealtimeEventsClient
    • Call control: joinCall, leaveCall, endCall
    • SIP media (low-level): setInputDevice, setOutputDevice, ...
  • @sippet-ai/sdk-js/server
    • RPC functions
    • createServerClient to inject API key headers into RPC calls
  • @sippet-ai/sdk-js/realtime
    • Realtime-only helper entrypoint
  • @sippet-ai/sdk-js/sip
    • SIP/WebRTC helper entrypoint

Server usage (@sippet-ai/sdk-js/server)

Use this entrypoint in your backend only.

Create an RPC client

import { createServerClient } from "@sippet-ai/sdk-js/server";

const sippet = createServerClient({
  apiKey: process.env.SIPPET_SECRET_API_KEY!,
});

const calls = await sippet.listCalls({
  fields: ["id", "callUuid", "status", "startedAt"],
  page: { limit: 50, offset: 0, count: true },
});

Mint a realtime session token

import { mintRealtimeSessionToken } from "@sippet-ai/sdk-js/server";

const token = await mintRealtimeSessionToken({
  secretApiKey: process.env.SIPPET_SECRET_API_KEY!,
  baseUrl: "https://api.sippet.ai",
});

// token = {
//   token,
//   tokenType: "realtime_session",
//   scope: "events",
//   expiresAt,
//   ttlSeconds
// }

Call the RPC action directly (issueOperatorAccessToken)

import { createServerClient } from "@sippet-ai/sdk-js/server";

const sippet = createServerClient({
  apiKey: process.env.SIPPET_SECRET_API_KEY!,
});

const result = await sippet.issueOperatorAccessToken({
  input: { operatorEmail: "[email protected]" },
});

if (!result.success) {
  throw new Error(result.errors.map((e) => e.message).join(", "));
}

console.log(result.data.token);

Client usage (@sippet-ai/sdk-js/client)

Use this entrypoint in browser apps.

Initialize a shared client (recommended)

import { initClient } from "@sippet-ai/sdk-js/client";

const sippet = initClient({
  baseUrl: "https://api.sippet.ai",
  headers: {
    Authorization: `Bearer ${operatorAccessToken}`,
  },
});

const me = await sippet.whoAmI({
  fields: ["id", "email", "fullName"],
});

Use this same sippet instance everywhere in your app (and pass it to the operator widget) to keep one SDK state/config source.

In modules where you don't initialize directly, use getClient():

import { getClient } from "@sippet-ai/sdk-js/client";

const sippet = getClient();

Realtime events with auto-refresh

import { initClient } from "@sippet-ai/sdk-js/client";

const sippet = initClient({
  baseUrl: "https://api.sippet.ai",
});

const realtime = sippet.createRealtimeEventsClient({
  getRealtimeToken: async () => {
    // This is to your backend server to securely mint a realtime token
    const response = await fetch("/api/sippet/realtime-token", {
      method: "POST",
    });

    if (!response.ok) {
      throw new Error("Failed to fetch realtime token from backend");
    }

    return response.json();
  },
  refreshSkewMs: 60_000,
});

realtime.on("incoming_call", (payload) => {
  console.log("incoming_call", payload);
});

realtime.on("call_answered", (payload) => {
  console.log("call_answered", payload);
});

await realtime.start();

// later
// realtime.stop();

Channel events 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

Call control helpers

For browser call control, use the high-level helpers:

import { initClient } from "@sippet-ai/sdk-js/client";

const sippet = initClient({
  headers: { "x-api-key": "YOUR_PUBLISHABLE_KEY" },
});

const joinResult = await sippet.joinCall({
  input: { callUuid: "CALL_UUID" },
});

if (!joinResult.success) {
  throw new Error(joinResult.errors.map((e) => e.message).join(", "));
}

await sippet.leaveCall({
  input: { callUuid: "CALL_UUID", reason: "left_call" },
});

await sippet.endCall({
  input: { callUuid: "CALL_UUID" },
});

These helpers orchestrate RPC + media lifecycle for common operator flows.

SIP / WebRTC media helpers

Use SIP helpers directly when you need low-level media control in the browser.

import {
  initClient,
} from "@sippet-ai/sdk-js/client";

const sippet = initClient();

await sippet.connectSipSession({
  server: "wss://sip.sippet.ai:7443",
  domain: "sip.sippet.ai",
  username: "SIP_USERNAME",
  password: "SIP_PASSWORD",
});

await sippet.placeSipCall({
  server: "wss://sip.sippet.ai:7443",
  domain: "sip.sippet.ai",
  username: "SIP_USERNAME",
  password: "SIP_PASSWORD",
  roomId: "ROOM_ID",
  codecPreference: "pcma",
});

await sippet.setInputDevice("mic-device-id");
await sippet.setOutputDevice("speaker-device-id");

await sippet.hangupSipCall();
await sippet.disconnectSipSession();

Security model

  • Never expose Sippet secret API keys in browsers.
  • Use mintRealtimeSessionToken on your backend to issue short-lived websocket tokens.
  • Use realtime session_token for websocket subscriptions only.
  • Run RPC/data access from your backend via @sippet-ai/sdk-js/server.