{"_id":"@cognigy/click-to-call-sdk","_rev":"8-943d8e9c7fc31bea421b12af9f421f47","name":"@cognigy/click-to-call-sdk","dist-tags":{"latest":"0.2.0"},"versions":{"0.0.7":{"name":"@cognigy/click-to-call-sdk","version":"0.0.7","keywords":["webrtc","sip","voip","calling","audio","sdk","click-to-call"],"author":{"name":"Cognigy"},"license":"MIT","_id":"@cognigy/click-to-call-sdk@0.0.7","maintainers":[{"name":"mayrbenjamin92","email":"b.mayr@cognigy.com"},{"name":"pedily","email":"kontakt@robinschuster.net"},{"name":"kwinto","email":"npm@ostasevich.com"},{"name":"dshire","email":"wellereitetclub@gmail.com"},{"name":"lkolapp","email":"lekshmi.kolappan@gmail.com"},{"name":"catharsis68","email":"m.frindt@cognigy.com"},{"name":"cu4nt0m","email":"a.komitaki@cognigy.com"},{"name":"x.jorda","email":"jorda.murria.xavier@gmail.com"},{"name":"lucasdssramos","email":"lucas.sramos.de@gmail.com"},{"name":"f.asad","email":"f.asad@cognigy.com"},{"name":"jortegadiazcognigy","email":"Jose.OrtegaDiaz@nice.com"},{"name":"mastasky","email":"p.heltewig@cognigy.com"}],"homepage":"https://github.com/Cognigy/click-to-call-sdk#readme","bugs":{"url":"https://github.com/Cognigy/click-to-call-sdk/issues"},"dist":{"shasum":"b5cbc937044ad27240b7fb3999fe021739d3dde2","tarball":"https://registry.npmjs.org/@cognigy/click-to-call-sdk/-/click-to-call-sdk-0.0.7.tgz","fileCount":21,"integrity":"sha512-YS5yixY56Krt/YOwGJ8OfVapjdbHz3J7wOpktrNs5keuEQrUfW9NZCyg+ktMLYgoIakcDAir63Um8wL/id6tPg==","signatures":[{"sig":"MEQCIECGW3KG9C7dcWSCVLKnoz5E7i2cw6rlTZiZCFaWQ0xsAiBWuRFO4zzYR5DxPTfOQoO+vTvCFiC9JF7WWPPiAXRVnw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1122653},"main":"dist/webRTCSDK.cjs.js","type":"module","types":"dist/index.d.ts","module":"dist/webRTCSDK.es.js","browser":"dist/webRTCSDK.js","engines":{"node":">=16.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/webRTCSDK.es.js","default":"./dist/webRTCSDK.es.js","require":"./dist/webRTCSDK.cjs.js"}},"gitHead":"4f4edd9192d894903d0be93e4f79e807835c3b54","scripts":{"dev":"NODE_ENV=development vite build --mode development --watch & NODE_ENV=development vite --mode development","lint":"biome lint --write","test":"vitest","build":"rm -rf dist && vite build","clean":"rm -rf dist coverage","prepare":"husky","test:ui":"vitest --ui","test:run":"vitest run","typecheck":"tsc --noEmit","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"lucasdssramos","email":"lucas.sramos.de@gmail.com"},"repository":{"url":"git+https://github.com/Cognigy/click-to-call-sdk.git","type":"git"},"_npmVersion":"10.9.2","description":"A standalone WebRTC SDK for SIP-based voice calling with custom audio support","directories":{},"_nodeVersion":"22.13.0","dependencies":{"jssip":"^3.13.5","events":"^3.3.0"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^7.3.1","husky":"^9.1.7","jsdom":"^28.1.0","terser":"^5.46.0","vitest":"^4.0.18","@vitest/ui":"^4.0.18","typescript":"^5.9.3","@types/node":"^25.3.0","@biomejs/biome":"^2.4.4","@commitlint/cli":"^20.5.0","vite-plugin-dts":"^4.5.4","@vitest/coverage-v8":"^4.0.18","vite-bundle-analyzer":"^1.3.6","vite-plugin-compression":"^0.5.1","@commitlint/config-conventional":"^20.5.0"},"_npmOperationalInternal":{"tmp":"tmp/click-to-call-sdk_0.0.7_1773824526738_0.8847591365397063","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@cognigy/click-to-call-sdk","version":"0.1.1","keywords":["webrtc","sip","voip","calling","audio","sdk","click-to-call"],"author":{"name":"Cognigy"},"license":"MIT","_id":"@cognigy/click-to-call-sdk@0.1.1","maintainers":[{"name":"mayrbenjamin92","email":"b.mayr@cognigy.com"},{"name":"pedily","email":"kontakt@robinschuster.net"},{"name":"kwinto","email":"npm@ostasevich.com"},{"name":"dshire","email":"wellereitetclub@gmail.com"},{"name":"lkolapp","email":"lekshmi.kolappan@gmail.com"},{"name":"catharsis68","email":"m.frindt@cognigy.com"},{"name":"cu4nt0m","email":"a.komitaki@cognigy.com"},{"name":"x.jorda","email":"jorda.murria.xavier@gmail.com"},{"name":"rchhetri-cognigy","email":"r.chhetri@cognigy.com"},{"name":"fkhalid","email":"fahad.khalid@cognigy.nice.com"},{"name":"lucasdssramos","email":"lucas.sramos.de@gmail.com"},{"name":"f.asad","email":"f.asad@cognigy.com"},{"name":"jortegadiazcognigy","email":"Jose.OrtegaDiaz@nice.com"},{"name":"mastasky","email":"p.heltewig@cognigy.com"},{"name":"dcg-cognigy","email":"diogo.gomes@nice.com"},{"name":"cognigy-fabian","email":"fabian.gruber@nice.com"},{"name":"anton.demin","email":"anton.demin@nice.com"}],"homepage":"https://github.com/Cognigy/click-to-call-sdk#readme","bugs":{"url":"https://github.com/Cognigy/click-to-call-sdk/issues"},"dist":{"shasum":"938e255f7a4d248a7c6b5fcf077f3e157e3a9993","tarball":"https://registry.npmjs.org/@cognigy/click-to-call-sdk/-/click-to-call-sdk-0.1.1.tgz","fileCount":21,"integrity":"sha512-leXPnOyP8smyuHvpwv4pE5bswBxSWhzH5dOx/asi6P7mdDSGxpzgkS2pPYfVm6OrE5qvHcROID7zI2s30Lalrg==","signatures":[{"sig":"MEQCIAXNKU3n8L7FX9qc/TELPY46xL8GmeozwUKbCKlt13ZgAiAM4OGz3U7tt7iNurCVe7+CZqUyTQB1HBEZ/ffh47ENZg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIEP2VZF4uHtb/Afx+OlOZhZvcZc1Dfm/lPzQV9HGxEuJAiEAnq7Imw2LHlYRfGnz7mSKBOMWC1iusU1g7TgsxELcf/A=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@cognigy%2fclick-to-call-sdk@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":1128275},"main":"dist/webRTCSDK.cjs.js","type":"module","types":"dist/index.d.ts","module":"dist/webRTCSDK.es.js","browser":"dist/webRTCSDK.js","engines":{"node":">=16.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/webRTCSDK.es.js","default":"./dist/webRTCSDK.es.js","require":"./dist/webRTCSDK.cjs.js"}},"gitHead":"56e1402bac1884ebeccda359bdd66324e52595ef","scripts":{"dev":"NODE_ENV=development vite build --mode development --watch & NODE_ENV=development vite --mode development","lint":"biome lint --write","test":"vitest","build":"rm -rf dist && vite build","clean":"rm -rf dist coverage","prepare":"husky","test:ui":"vitest --ui","test:run":"vitest run","typecheck":"tsc --noEmit","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:875c71a8-74d1-43b8-8f46-008792b5c6e9"}},"repository":{"url":"git+https://github.com/Cognigy/click-to-call-sdk.git","type":"git"},"_npmVersion":"11.20.0","description":"A standalone WebRTC SDK for SIP-based voice calling with custom audio support","directories":{},"_nodeVersion":"24.21.0","dependencies":{"jssip":"^3.13.5","events":"^3.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^7.3.1","husky":"^9.1.7","jsdom":"^28.1.0","terser":"^5.46.0","vitest":"^4.0.18","@vitest/ui":"^4.0.18","typescript":"^5.9.3","@types/node":"^25.3.0","@biomejs/biome":"^2.4.4","@commitlint/cli":"^20.5.0","vite-plugin-dts":"^4.5.4","semantic-release":"^25.0.9","@vitest/coverage-v8":"^4.0.18","vite-bundle-analyzer":"^1.3.6","@semantic-release/git":"^10.0.1","vite-plugin-compression":"^0.5.1","@semantic-release/changelog":"^6.0.3","@commitlint/config-conventional":"^20.5.0"},"_npmOperationalInternal":{"tmp":"tmp/click-to-call-sdk_0.1.1_1790350390589_0.1379499056686233","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"_id":"@cognigy/click-to-call-sdk@0.2.0","bugs":{"url":"https://github.com/Cognigy/click-to-call-sdk/issues"},"dist":{"shasum":"bc6e28192a31ca8de0dca8a37e74c90f73ff4221","tarball":"https://registry.npmjs.org/@cognigy/click-to-call-sdk/-/click-to-call-sdk-0.2.0.tgz","fileCount":21,"integrity":"sha512-edj0iVpMuJLVgCCBi/h7Wvj2mKxQcK/A39k1yYsRLNw9K5BCx0lIllh80HbyycjWnFi8KWQdBK00A0bWK1K08g==","signatures":[{"sig":"MEYCIQCcbVP+Nbbw2wZeJ5FuE/qvMN8Mvkut8hqhECA+wsJowQIhAN3NLV9Jok7fahzpa6oARS5w35LI+jQEY+SZ/HWEH5DH","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDKqfGLcxh8k6JZeI2ORRDzfYu9IrKgD3sS+PYeaN5iPAiEAppoIIEpKC+nPNocsRmyTnEckp+yPwoDxg8yZFasiKmQ="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@cognigy%2fclick-to-call-sdk@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":1130731},"main":"dist/webRTCSDK.cjs.js","name":"@cognigy/click-to-call-sdk","type":"module","types":"dist/index.d.ts","author":{"name":"Cognigy"},"module":"dist/webRTCSDK.es.js","browser":"dist/webRTCSDK.js","engines":{"node":">=16.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/webRTCSDK.es.js","default":"./dist/webRTCSDK.es.js","require":"./dist/webRTCSDK.cjs.js"}},"gitHead":"c7f3ff75e243fcc483d21eaa994d26eba2a82536","license":"MIT","scripts":{"dev":"NODE_ENV=development vite build --mode development --watch & NODE_ENV=development vite --mode development","lint":"biome lint --write","test":"vitest","build":"rm -rf dist && vite build","clean":"rm -rf dist coverage","prepare":"husky","test:ui":"vitest --ui","test:run":"vitest run","typecheck":"tsc --noEmit","test:coverage":"vitest run --coverage"},"version":"0.2.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:875c71a8-74d1-43b8-8f46-008792b5c6e9"}},"homepage":"https://github.com/Cognigy/click-to-call-sdk#readme","keywords":["webrtc","sip","voip","calling","audio","sdk","click-to-call"],"repository":{"url":"git+https://github.com/Cognigy/click-to-call-sdk.git","type":"git"},"_npmVersion":"11.20.0","description":"A standalone WebRTC SDK for SIP-based voice calling with custom audio support","directories":{},"maintainers":[{"name":"mayrbenjamin92","email":"b.mayr@cognigy.com"},{"name":"pedily","email":"kontakt@robinschuster.net"},{"name":"kwinto","email":"npm@ostasevich.com"},{"name":"dshire","email":"wellereitetclub@gmail.com"},{"name":"lkolapp","email":"lekshmi.kolappan@gmail.com"},{"name":"catharsis68","email":"m.frindt@cognigy.com"},{"name":"cu4nt0m","email":"a.komitaki@cognigy.com"},{"name":"x.jorda","email":"jorda.murria.xavier@gmail.com"},{"name":"rchhetri-cognigy","email":"r.chhetri@cognigy.com"},{"name":"fkhalid","email":"fahad.khalid@cognigy.nice.com"},{"name":"lucasdssramos","email":"lucas.sramos.de@gmail.com"},{"name":"f.asad","email":"f.asad@cognigy.com"},{"name":"jortegadiazcognigy","email":"Jose.OrtegaDiaz@nice.com"},{"name":"mastasky","email":"p.heltewig@cognigy.com"},{"name":"dcg-cognigy","email":"diogo.gomes@nice.com"},{"name":"cognigy-fabian","email":"fabian.gruber@nice.com"},{"name":"anton.demin","email":"anton.demin@nice.com"}],"_nodeVersion":"24.21.0","dependencies":{"jssip":"^3.13.5","events":"^3.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^7.3.1","husky":"^9.1.7","jsdom":"^28.1.0","terser":"^5.46.0","vitest":"^4.0.18","@vitest/ui":"^4.0.18","typescript":"^5.9.3","@types/node":"^25.3.0","@biomejs/biome":"^2.4.4","@commitlint/cli":"^20.5.0","vite-plugin-dts":"^4.5.4","semantic-release":"^25.0.9","@vitest/coverage-v8":"^4.0.18","vite-bundle-analyzer":"^1.3.6","@semantic-release/git":"^10.0.1","vite-plugin-compression":"^0.5.1","@semantic-release/changelog":"^6.0.3","@commitlint/config-conventional":"^20.5.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/click-to-call-sdk_0.2.0_1790598986357_0.9741968369034981"}}},"time":{"created":"2026-03-18T09:02:06.653Z","modified":"2026-09-28T12:36:26.859Z","0.0.7":"2026-03-18T09:02:06.993Z","0.1.1":"2026-09-25T15:33:10.717Z","0.2.0":"2026-09-28T12:36:26.505Z"},"bugs":{"url":"https://github.com/Cognigy/click-to-call-sdk/issues"},"author":{"name":"Cognigy"},"license":"MIT","homepage":"https://github.com/Cognigy/click-to-call-sdk#readme","keywords":["webrtc","sip","voip","calling","audio","sdk","click-to-call"],"repository":{"url":"git+https://github.com/Cognigy/click-to-call-sdk.git","type":"git"},"description":"A standalone WebRTC SDK for SIP-based voice calling with custom audio support","maintainers":[{"name":"mayrbenjamin92","email":"b.mayr@cognigy.com"},{"name":"pedily","email":"kontakt@robinschuster.net"},{"name":"kwinto","email":"npm@ostasevich.com"},{"name":"dshire","email":"wellereitetclub@gmail.com"},{"name":"lkolapp","email":"lekshmi.kolappan@gmail.com"},{"name":"catharsis68","email":"m.frindt@cognigy.com"},{"name":"cu4nt0m","email":"a.komitaki@cognigy.com"},{"name":"x.jorda","email":"jorda.murria.xavier@gmail.com"},{"name":"rchhetri-cognigy","email":"r.chhetri@cognigy.com"},{"name":"fkhalid","email":"fahad.khalid@cognigy.nice.com"},{"name":"lucasdssramos","email":"lucas.sramos.de@gmail.com"},{"name":"f.asad","email":"f.asad@cognigy.com"},{"name":"jortegadiazcognigy","email":"Jose.OrtegaDiaz@nice.com"},{"name":"mastasky","email":"p.heltewig@cognigy.com"},{"name":"dcg-cognigy","email":"diogo.gomes@nice.com"},{"name":"cognigy-fabian","email":"fabian.gruber@nice.com"},{"name":"anton.demin","email":"anton.demin@nice.com"}],"readme":"# Click To Call SDK\n\nA standalone, framework-agnostic SDK for SIP-based voice calling with WebRTC. Built on JsSIP.\n\n## Features\n\n- 🚀 **Framework Agnostic** — works with React, Angular, Vue, or vanilla JS.\n- 🔒 **Type Safe** — full TypeScript support.\n- 📞 **SIP/WebRTC** — built on JsSIP for reliable communication.\n- 🎛️ **Full Control** — start, end, mute, unmute, send info messages.\n- 🔄 **Event Driven** — 17 events for real-time state updates.\n- 🎵 **Auto Audio** — remote audio plays automatically; raw stream available via `captureAudio` event.\n- 💬 **Transcription** — real-time transcription events, auto-separated from info messages.\n\n## Installation\n\n```bash\nnpm install @cognigy/click-to-call-sdk\n```\n\n## Quick Start\n\n```typescript\nimport { createWebRTCClient, checkWebRTCSupport } from '@cognigy/click-to-call-sdk';\n\n// 1. Check browser support\nconst support = checkWebRTCSupport();\nif (!support.supported) throw new Error('Missing: ' + support.missing);\n\n// 2. Create client\nconst client = await createWebRTCClient({\n  endpointUrl: 'https://your-cognigy-environment.com/token',\n  userId: 'user-123',\n});\n\n// 3. Listen to events\nclient.on('answered', (session) => console.log('Call answered:', session.id));\nclient.on('ended', (session, endInfo) => console.log('Call ended:', endInfo.cause));\nclient.on('error', (error) => console.error('Error:', error.message));\n\n// 4. Connect and call\nawait client.connectAndCall();\n\n// 5. Cleanup on page unload\nwindow.addEventListener('beforeunload', () => {\n  void client.destroy().catch(() => {\n    // Ignore errors during page unload\n  });\n});\n```\n\n> **Note:** The call must be initiated from a user gesture (e.g. button click) for browser autoplay policies to allow audio.\n\n## Configuration\n\n```typescript\ninterface WebRTCClientConfig {\n  endpointUrl: string;        // URL to fetch SIP configuration\n  userId?: string;            // Optional user identifier\n  pcConfig?: RTCConfiguration; // WebRTC peer connection config\n  captureAudio?: boolean;     // Enable captureAudio event to receive raw MediaStream\n}\n```\n\n## API\n\n| Method                  | Description                                  |\n|-------------------------|----------------------------------------------|\n| `connect()`             | Connect to SIP server and register           |\n| `disconnect()`          | Disconnect from SIP server                   |\n| `connectAndCall()`      | Connect + start call in one step             |\n| `startCall()`           | Start a call (must be connected first)       |\n| `endCall()`             | End the current call                         |\n| `mute()` / `unmute()`   | Toggle microphone                            |\n| `sendInfo(text, data?)` | Send info message during a call              |\n| `sendDTMF(tones, options?)` | Send DTMF tones (`0-9 A-D # * ,`) during a call |\n| `isConnected()`         | Check connection state                       |\n| `getCurrentSession()`   | Get active `CallSession` or `null`           |\n| `on(event, callback)`   | Add event listener (returns `this`)          |\n| `off(event, callback)`  | Remove event listener (returns `this`)       |\n| `destroy()`             | Disconnect, end calls, release all resources |\n\n## Events\n\n| Event           | Callback                                                                |\n|-----------------|-------------------------------------------------------------------------|\n| `connecting`    | `()`                                                                    |\n| `connected`     | `()`                                                                    |\n| `disconnected`  | `()`                                                                    |\n| `registered`    | `()`                                                                    |\n| `unregistered`  | `()`                                                                    |\n| `ringing`       | `(session: CallSession)`                                                |\n| `answered`      | `(session: CallSession)`                                                |\n| `ended`         | `(session: CallSession, endInfo: CallEndInfo)`                          |\n| `failed`        | `(session: CallSession, endInfo: CallEndInfo)`                          |\n| `muted`         | `(session: CallSession)`                                                |\n| `unmuted`       | `(session: CallSession)`                                                |\n| `captureAudio`  | Remote audio stream available (requires opt-in) `(stream: MediaStream)` |\n| `audioEnded`    | `()`                                                                    |\n| `infoSent`      | `(text: string, data: Record<string, any>)`                             |\n| `dtmfSent`      | `(tones: string)`                                                       |\n| `infoReceived`  | `(data: { originator: string; info: { body: string } })`                |\n| `transcription` | `(transcription: { originator: string; messages: { text: string }[] })` |\n| `error`         | `(error: Error)`                                                        |\n\n## Browser Compatibility\n\nChrome 93+ · Firefox 92+ · Safari 15.4+ · Edge 93+\n\n## Documentation\n\nFor the full guide, API reference, event reference, and troubleshooting:\n\n- [Getting Started](https://docs.cognigy.com/click-to-call/sdkgetting-started.mdx)\n- [API Reference](https://docs.cognigy.com/click-to-call/sdkapi-reference/overview.mdx)\n- [Event Reference](https://docs.cognigy.com/click-to-call/sdkevent-reference/overview.mdx)\n- [Custom Audio](https://docs.cognigy.com/click-to-call/sdkcustom-audio.mdx)\n- [Security](https://docs.cognigy.com/click-to-call/sdksecurity.mdx)\n- [Troubleshooting](https://docs.cognigy.com/click-to-call/sdktroubleshooting.mdx)\n\n## License\n\nMIT","readmeFilename":"README.md"}