Skip to main content
Cognigy Click To Call SDK is a standalone, framework-agnostic JavaScript/TypeScript SDK that lets frontend developers integrate SIP-based voice calling into web apps using WebRTC. Built on JsSIP, it provides a high-level API for managing voice sessions, SIP signaling, and real-time audio streams. The SDK is designed for developers building custom voice interfaces on top of the Cognigy.AI platform and Cognigy Voice Gateway.

What’s in This SDK?

SDK Purpose

The Click To Call SDK helps developers:
  • Establish real-time voice calls between a user’s browser and Cognigy Voice Gateway using SIP signaling and the WebRTC API.
  • Manage the full call lifecycle through a simple, promise-based API: connect, start, mute, unmute, send info messages, and disconnect.
  • Handle remote audio playback automatically. The SDK manages audio element creation and stream attachment internally, with an optional captureAudio event for advanced audio processing.
  • Receive real-time transcription events during calls, with automatic separation from regular info messages.

Requirements

RequirementDetails
LanguageJavaScript or TypeScript. The SDK is framework-agnostic and works with React, Angular, Vue, or vanilla JS.
Node.js16 or later
Package managernpm
BrowsersModern web and mobile browsers. For more information, refer to Supported Browsers.
NetworkHTTPS or localhost. WebSocket and UDP traffic must be allowed.
BackendA Cognigy.AI environment with a configured Voice Gateway Endpoint.

Use Cases

  • Build multimodal browser-based voice interfaces that connect to Cognigy AI Agents.
  • Embed click-to-call functionality into web applications or customer portals.
  • Display real-time transcription of voice conversations in your UI.
  • Integrate voice calling into existing React, Angular, Vue, or vanilla JS applications without framework lock-in.

Key Features

FeatureDescription
Custom Audio HandlingThe SDK handles remote audio playback automatically via an internal Audio element. For advanced use cases, set captureAudio: true in the client config to receive the raw MediaStream via the captureAudio event. The audioEnded event notifies when playback stops. See Custom Audio.
Full Call ControlComplete call control: start, end, mute, unmute, and send info messages — all as simple async methods. See API reference.
MultimodalityThe SDK supports multimodal interactions by combining voice, text, and structured data in real time. The sendInfo method lets you send text and optional structured data during calls, making your interface fully multimodal. See API Reference: sendInfo.
Event-Driven ArchitectureRich pub/sub event system with 17 events covering connection state, call state, audio, transcription, and errors. See Event Reference.
Real-Time TranscriptionReceive transcription events during calls. Transcription data is automatically filtered from regular info messages. See Event Reference: transcription.

Changelog Reference

The latest SDK version is available on npm as @cognigy/click-to-call-sdk. For updates and fixes, refer to the Cognigy Click To Call SDK GitHub repository.

License

The Cognigy Click To Call SDK is licensed under the MIT License.

Next Steps