Dora Cell SDK
The Dora Cell SDK lets you add VoIP calling to JavaScript and React applications. It authenticates with Dora Cell API tokens, provisions SIP credentials, registers a browser SIP user, and exposes a simple event-driven API for calls, caller IDs, and wallet balance.
Browser Support
For the best experience, we recommend using Chromium-based browsers (Chrome, Microsoft Edge, Brave, Opera). Our WebRTC implementation is highly optimized for the Chromium engine.
High Performance
Engineered for reliable, low-latency voice communication with crystal-clear audio quality.
Secure Auth & Sessions
Login credentials authentication with automatic SIP provisioning, cookie persistence, and session management.
Core SDK Installation
Install the base SDK to use it in browser-based JavaScript apps, including vanilla JS, React, Vue, Angular, and other frameworks.
1npm install @dora-cell/sdkInitialization & Authentication
Initialize the SDK using User Login Credentials (recommended for dashboards and agents, with automatic browser cookie session restoration).
1import { DoraCell } from "@dora-cell/sdk";2 3// ─── Option 1A: Agent Account Login (uses EMAIL) ───4const sdk = new DoraCell({5 auth: {6 type: "login",7 userType: "agent",8 email: "agent@example.com",9 password: "password",10 },11 environment: "production",12 debug: false13});14 15// ─── Option 1B: Admin Account Login (uses USERNAME) ───16// const sdk = new DoraCell({17// auth: {18// type: "login",19// userType: "admin",20// username: "admin_user",21// password: "password",22// },23// environment: "production",24// debug: false25// });26 27sdk.on("connection:status", ({ status, extension, error }) => {28 console.log("Connection:", status, extension, error);29});30 31await sdk.initialize();32console.log("SDK is ready!");33 34// To sign out and clear browser cookies:35// await sdk.logout();Making & Receiving Calls
The SDK provides a simple interface for outbound calls, incoming calls, mute controls, and remote audio streams.
1// Place an outbound call2const call = await sdk.call("+2348000000000", {3 metadata: { customerId: "cus_123" }4});5 6call.mute();7call.unmute();8call.hangup();9 10// Answer an incoming call11sdk.on("call:incoming", async (call) => {12 console.log("Incoming call from:", call.remoteNumber);13 await sdk.answerCall();14});15 16sdk.on("call:stream", (call, stream) => {17 const audio = document.querySelector("audio#remote-audio");18 if (audio) audio.srcObject = stream;19});Event Handlers
Stay updated with the call state by subscribing to SDK events.
1// Listen for connection status2sdk.on("connection:status", ({ status, error }) => {3 console.log("SIP Status changed:", status);4});5 6// Listen for call transitions7sdk.on("call:connected", (call) => {8 console.log("Conversation started with:", call.remoteNumber);9});10 11sdk.on("call:ended", (call, reason) => {12 console.log("Call ended. Reason:", reason);13});14 15sdk.on("call:failed", (call, error) => {16 console.error("Call failed:", error);17});React SDK Installation
The React SDK requires the Core SDK as a peer dependency. Import the bundled stylesheet once in your root layout or app entry.
1npm install @dora-cell/sdk @dora-cell/sdk-react2# or3pnpm add @dora-cell/sdk @dora-cell/sdk-reactSetting up the Provider
Wrap your application tree with the DoraCellProvider to enable global call management using login credentials.
1import { DoraCellProvider } from "@dora-cell/sdk-react";2import "@dora-cell/sdk-react/styles.css";3 4export default function RootLayout({ children }) {5 return (6 <DoraCellProvider7 config={{8 auth: {9 type: "login",10 userType: "agent", // For Admin accounts, use userType: "admin" and replace 'email' with 'username'11 email: "agent@example.com",12 password: "password",13 },14 environment: "production"15 }}16 autoInitialize={true}17 >18 {children}19 </DoraCellProvider>20 );21}Hooks Overview
useCall()
Manage active calls, mute, and duration.
useConnectionStatus()
Monitor SIP registration, errors, and invoke logout().
useWallet()
Read and refresh wallet balance.
useExtensions()
Fetch caller IDs and switch extensions.
1import { useCall, useConnectionStatus } from "@dora-cell/sdk-react";2 3export function Dialer() {4 const { call, callStatus, callDuration } = useCall();5 const { isConnected, connectionStatus, logout } = useConnectionStatus();6 7 return (8 <div>9 <div className="flex justify-between items-center mb-4">10 <p>Status: {connectionStatus}</p>11 {isConnected && (12 <button onClick={() => logout()} className="text-red-500 text-sm">13 Sign out14 </button>15 )}16 </div>17 {callStatus === "ongoing" && <p>{callDuration}</p>}18 <button 19 onClick={() => call("+2348000000000")}20 disabled={!isConnected || callStatus !== "idle"}21 >22 {callStatus === "idle" ? "Call" : "Calling..."}23 </button>24 </div>25 );26}Built-in UI Components
We provide production-ready components that fit perfectly into your application. Below is a complete overview of the core components and their props.
Dialpad
A flexible keypad for entering numbers and switching between Caller IDs.
initialNumber?: stringPre-fill the dialer input.showKeys?: booleanShow numeric keypad by default (true).className?: stringCustom CSS classes.availableExtensions?: ArrayOverride auto-fetched caller IDs.selectedExtension?: stringManually select the active caller ID.onExtensionChange?: fnCallback when caller ID changes.onCallInitiated?: fnCallback after a call starts.metadata?: RecordMetadata passed through to sdk.call().CallInterface
A slide-over interface that handles the audio and call lifecycle automatically.
isOpen?: booleanControls visibility.onOpenChange?: fnCallback to request open/close.onCallEnded?: fnCallback when a call ends.maximizeIcon?: NodeCustom maximize icon.minimizeIcon?: NodeCustom minimize icon.ringtoneUrl?: stringReserved for custom ringtone audio.ringbackUrl?: stringReserved for custom ringback audio.1import { useState } from "react";2import { CallInterface, Dialpad, CreditBalance } from "@dora-cell/sdk-react";3 4function App() {5 const [dialerOpen, setDialerOpen] = useState(false);6 7 return (8 <>9 <header>10 <CreditBalance />11 </header>12 13 {/* Handles all incoming and outgoing call UI */}14 <CallInterface 15 isOpen={dialerOpen} 16 onOpenChange={setDialerOpen} 17 onCallEnded={() => console.log('Call Ended')}18 />19 20 <main>21 <Dialpad 22 initialNumber="+2348000000000"23 showKeys={true}24 metadata={{ source: "docs" }}25 onCallInitiated={(num) => console.log('Calling', num)}26 />27 </main>28 </>29 );30}Component Previews
Dialpad Component
A full-featured dialer with Caller ID selection and interactive keys.
Call Interface Component
Responsive floating interface for active and incoming call management.
John Doe
+234 701 555 0123 • Incoming...
John Doe
+234 701 555 0123 • On Call
GoHighLevel CDN Installation
Integrate Dora Cell directly into GoHighLevel (GHL) sub-accounts without build tools or bundlers. Use our pre-compiled CDN assets inside your sub-account's Custom JS & CSS fields.
💡 Where to find this: Navigate to your GoHighLevel Agency Settings at https://app.gohighlevel.com/settings/company?tab=whitelabel
1. Custom CSS Field (Styles)
1<link rel="stylesheet" href="https://esm.sh/@dora-cell/ghl@latest/dist/core.css">2. Custom JS Field (Production Script)
1<!-- Production Bundle (automatically connects to Dora Cell Production API) -->2<script src="https://esm.sh/@dora-cell/ghl@latest/dist/core.js"></script>Configuration & Setup
The GoHighLevel widget automatically injects a floating dialer button and overlay into the GoHighLevel CRM. We provide two distinct scripts based on your deployment environment:
Production Script
Defaultdist/core.js
Hardcoded for the Dora Cell production environment. There is no environment selector dropdown shown to the user. Agents simply sign in and start dialing immediately.
Staging / Sandbox Script
Testingdist/core.staging.js
Includes an environment selector dropdown inside the widget settings so developers and QA teams can test against staging or development servers during setup.
1<!-- For Staging / Sandbox testing, replace core.js with core.staging.js -->2<script src="https://esm.sh/@dora-cell/ghl@latest/dist/core.staging.js"></script>Embedded Dialer UI & Features
Once installed, the widget mounts seamlessly inside GoHighLevel:
1. Login Credentials Authentication
Agents sign in using their registered Email Address and Password (or Admins using their Username and Password). Once authenticated, the widget automatically requests SIP line provisioning and restores the session across page navigation.
2. Click-to-Dial & In-App Keypad
Agents can dial numbers directly from the numeric keypad or select from available Caller IDs (Extensions). Active calls feature real-time call duration timers, mute/unmute toggles, and instant hangup.
3. Live Credit Balance & Connection Status
The widget continuously displays the account's real-time credit balance (e.g., ₦1,250.00) and connection health status indicator, ensuring agents know their line status before initiating outbound calls.