Facebook
LinkedIn
YouTube
Getting Started
Authentication
Authentication
  • V2 Authentication (Deprecated)
  • V3 Authentication
V2 API Documentation (Deprecated)V3 API DocumentationDialer SDK
Getting Started
Authentication
Authentication
  • V2 Authentication (Deprecated)
  • V3 Authentication
V2 API Documentation (Deprecated)V3 API DocumentationDialer SDK
  1. Dialer SDK
  • Overview
  • Quickstart
  • Configuration & Theming
  • API Reference
  • Events Reference
  • Troubleshooting
  1. Dialer SDK

API Reference

Two ways to control the widget:
Web Component — direct element methods (recommended)
Helper Functions — utility functions for common tasks

Web Component API#

The widget is a web component (<convirza-dialer>). Access it via the DOM:

Widget control methods#

MethodReturnsDescription
open()—Expand the widget panel
close()—Collapse to floating button
toggle()—Toggle expanded/collapsed state

Call methods#

MethodReturnsDescription
placeCall(phoneNumber, options?)CallSessionPlace an outbound call
endCall()—Hang up active call
mute(enable?)booleanMute/unmute microphone
hold(enable?)booleanHold/unhold call
sendDTMF(digit)—Send DTMF tone during call
placeCall() example:
Call controls example:
Call method validation:
mute(), hold(), sendDTMF() — silent fail if no active call (return current state)
endCall() — safe to call anytime (no-op if no call)
Only placeCall() requires callStatus === 'idle'

Theming methods#

MethodParametersDescription
setTheme(options)ThemeOptionsUpdate theme/branding at runtime

Utility methods#

MethodReturnsDescription
clearCallHistoryCache()Promise<void>Clear local call history (IndexedDB)

CallSession object#

Returned by placeCall():
interface CallSession {
  phoneNumber: string;
  status: 'idle' | 'dialing' | 'ringing' | 'connected' | 'ended' | 'error';
  duration: number;  // milliseconds
  onAnswered(callback: () => void): void;
  onEnded(callback: (duration: number) => void): void;
  end(): void;
}

Events#

Listen for widget events on the element:
EventDetailDescription
sip-registered—SIP connection established, ready to make calls
sip-unregistered—SIP disconnected
auth-failed{ error: string }Authentication failed (wrong credentials, network error)
call-started{ phoneNumber: string }Outbound call initiated
call-ended{ phoneNumber: string, duration: number }Call terminated
state-change{ oldState, newState, metadata }Call state changed
widget-opened—Widget expanded
widget-closed—Widget collapsed
sip-call-mute{ muted: boolean }Mute state changed
sip-call-hold{ onHold: boolean }Hold state changed
call-quality-changeCallQualityMetricsCall quality metrics updated (every 2s during call)
history-updated{ history: CallHistoryItem[] }Call history changed
Example:

Complete example#

TypeScript support#

Full type definitions included:
import type {
  CallSession,
  CallStatus,
  CallOptions,
  ThemeOptions,
  CallQualityMetrics,
  CallHistoryItem,
} from '@convirza/dialer-sdk';

const dialer = document.querySelector('convirza-dialer');
const session: CallSession = dialer.placeCall('+15551234567');
const status: CallStatus = session.status;
Available types:
CallSession — call object returned by placeCall()
CallStatus — 'idle' | 'dialing' | 'ringing' | 'connected' | 'ended' | 'error'
CallOptions — options for placeCall()
ThemeOptions — options for setTheme()
CallQualityMetrics — call quality data
CallHistoryItem — history record structure

Method validation reference#

Quick reference for which methods require active calls:
MethodRequires Call?Behavior Without Call
open(), close(), toggle()NoAlways works
setTheme()NoAlways works
placeCall()No (requires idle)Throws if call active
endCall()NoSilent no-op
mute()YesReturns current state (silent fail)
hold()YesReturns current state (silent fail)
sendDTMF()YesSilent no-op
clearCallHistoryCache()NoAlways works
Best practice: always check call state before calling mute(), hold(), or sendDTMF() in production code, or listen to state-change events.
Modified at 2026-07-10 14:32:33
Previous
Configuration & Theming
Next
Events Reference
Built with