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

@dora-cell/sdk

v0.1.1-beta.26

Published

VoIP calling SDK for Dora Cell - Make calls from any JavaScript application

Readme

@dora-cell/sdk

VoIP calling SDK for Dora Cell - Make calls from any JavaScript application without logging into the Dora Cell web app.

Features

Framework-agnostic - Works with vanilla JS, React, Vue, Angular, etc.
TypeScript support - Full type definitions included
WebRTC-based - High-quality voice calls using JsSIP
Event-driven API - Listen to call state changes
API token authentication - Secure, no user login required
Auto-extension selection - Automatically selects first available extension
React bindings - Optional React hooks for easy integration

Installation

npm install @dora-cell/sdk jssip
# or
yarn add @dora-cell/sdk jssip
# or
pnpm add @dora-cell/sdk jssip

For React projects:

npm install @dora-cell/sdk @dora-cell/sdk-react jssip

Quick Start

Vanilla JavaScript

import { DoraCell } from '@dora-cell/sdk';

// Initialize SDK with API token
const sdk = new DoraCell({
  auth: {
    type: 'api-token',
    apiToken: 'your-api-token-here',
    apiBaseUrl: 'https://api.usedora.com'
  },
  debug: true // Enable console logging
});

// Initialize connection
await sdk.initialize();

// Listen for connection status
sdk.on('connection:status', (state) => {
  console.log('Connection status:', state.status);
});

// Listen for call events
sdk.on('call:connected', (call) => {
  console.log('Call connected:', call.remoteNumber);
});

sdk.on('call:ended', (call, reason) => {
  console.log('Call ended:', reason);
});

// Make a call
const call = await sdk.call('+2348012345678');

// Mute/unmute
call.mute();
call.unmute();

// Hang up
call.hangup();

React

import { DoraCellProvider, useCall, useConnectionStatus } from '@dora-cell/sdk-react';

function App() {
  return (
    <DoraCellProvider
      config={{
        auth: {
          type: 'api-token',
          apiToken: 'your-api-token-here',
          apiBaseUrl: 'https://api.usedora.com'
        }
      }}
    >
      <CallInterface />
    </DoraCellProvider>
  );
}

function CallInterface() {
  const { call, hangup, toggleMute, callStatus, callDuration, isMuted } = useCall();
  const { isConnected } = useConnectionStatus();
  const [number, setNumber] = useState('');

  const handleCall = async () => {
    try {
      await call(number);
    } catch (error) {
      console.error('Call failed:', error);
    }
  };

  return (
    <div>
      <p>Status: {isConnected ? 'Connected' : 'Disconnected'}</p>
      <input
        value={number}
        onChange={(e) => setNumber(e.target.value)}
        placeholder="Enter phone number"
      />
      <button onClick={handleCall} disabled={!isConnected}>
        Call
      </button>
      {callStatus === 'ongoing' && (
        <>
          <p>Duration: {callDuration}</p>
          <button onClick={toggleMute}>{isMuted ? 'Unmute' : 'Mute'}</button>
          <button onClick={hangup}>Hang Up</button>
        </>
      )}
    </div>
  );
}

API Reference

DoraCell Class

Constructor

new DoraCell(config: DoraCellConfig)

Config options:

  • auth - Authentication configuration (required)
    • type: 'api-token' - Use API token authentication
    • apiToken: string - Your Dora Cell API token
    • apiBaseUrl?: string - API base URL (optional)
  • turnServers?: RTCIceServer[] - Custom TURN/STUN servers
  • debug?: boolean - Enable debug logging
  • autoSelectExtension?: boolean - Auto-select first extension (default: true)

Methods

initialize(): Promise<void>
Initialize the SDK and connect to SIP server.

call(phoneNumber: string, options?: CallOptions): Promise<Call>
Make an outbound call.

Options:

  • extension?: string - Specific extension to use for this call

hangup(): void
Hang up the current call.

answerCall(): void
Answer an incoming call.

getCurrentCall(): Call | null
Get the current active call.

getStatus(): ConnectionStatus
Get current connection status.

getExtensions(): string[]
Get list of available extensions.

on(event, handler): void
Register event listener.

off(event, handler): void
Remove event listener.

destroy(): void
Cleanup and destroy SDK instance.

Events

sdk.on('connection:status', (state: ConnectionState) => {});
sdk.on('call:incoming', (call: Call) => {});
sdk.on('call:outgoing', (call: Call) => {});
sdk.on('call:ringing', (call: Call) => {});
sdk.on('call:connected', (call: Call) => {});
sdk.on('call:ended', (call: Call, reason?: string) => {});
sdk.on('call:failed', (call: Call, error: string) => {});
sdk.on('error', (error: Error) => {});

Call Object

interface Call {
  id: string;
  status: CallStatus;
  direction: 'inbound' | 'outbound';
  remoteNumber: string;
  localExtension: string;
  duration: number;
  
  mute(): void;
  unmute(): void;
  hangup(): void;
  isMuted(): boolean;
}

Authentication

Getting an API Token

  1. Log in to your Dora Cell dashboard
  2. Navigate to Settings → API Tokens
  3. Generate a new API token
  4. Copy the token and use it in your SDK configuration

Backend API Endpoint

The SDK expects your backend to provide a /api/sip-credentials endpoint that:

  • Accepts Authorization: Bearer <token> header
  • Returns SIP credentials in this format:
{
  "ws_url": "wss://cell.usedora.com:8089/ws",
  "sip_uri": "sip:[email protected]",
  "password": "your-password",
  "extensions": [
    { "extension": "101", "displayName": "Main Line" }
  ]
}

Phone Number Formatting

The SDK automatically handles Nigerian phone number formatting:

  • 08012345678sip:2348012345678@domain
  • 2348012345678sip:2348012345678@domain
  • 101 (extension) → sip:101@domain

Error Handling

import { AuthenticationError, CallError, ConnectionError } from '@dora-cell/sdk';

try {
  await sdk.initialize();
} catch (error) {
  if (error instanceof AuthenticationError) {
    console.error('Authentication failed:', error.message);
  } else if (error instanceof ConnectionError) {
    console.error('Connection failed:', error.message);
  }
}

Examples

See the /examples directory for complete working examples:

  • vanilla-js/ - Pure JavaScript implementation
  • react-app/ - React application
  • nextjs-app/ - Next.js application

License

MIT