Browser voice SDK
Mount a microphone interface using a public browser key and a published voice assistant.
For a managed chat/voice launcher without API-key setup, use Website widgets. Use the SDK when you want to integrate voice sessions into your own interface.
Prepare access
Create a public sgp_ key with calls:create, your site's exact origin and the published assistant ID. The assistant needs a working voice configuration and applicable balances/capacity. Use HTTPS, or localhost for development.
Mount the interface
Replace the host, public key and assistant UUID with your configuration:
<div id="sigsen-call"></div>
<script src="https://YOUR-SIGSEN-HOST/sigsen-voice.js"></script>
<script>
const widget = SigsenVoiceSdk.mount({
container: document.getElementById("sigsen-call"),
baseUrl: "https://YOUR-SIGSEN-HOST",
publicKey: "sgp_YOUR_PUBLIC_BROWSER_KEY",
assistantId: "YOUR_PUBLISHED_ASSISTANT_UUID",
label: "Talk to us",
});
// Call this when removing the interface or leaving the page.
// widget.destroy();
</script>The mounted interface includes Start/End call, status, reply text, recording/analysis consent and action approval. It never needs an external provider key in the browser.
Build custom controls
The bundle also exposes SigsenVoiceSdk.VoiceClient. Configure baseUrl, publicKey, assistantId and an optional onState callback, then use:
| Method | Purpose |
|---|---|
start({ remember, artifactConsent }) | Start with the user's explicit consent choices; both default false. |
approveAction(true) / approveAction(false) | Respond to the current action approval. |
stop() | End the session and release the microphone. |
Provide visible status, End call, error handling and approval details when replacing the mounted UI. Collect consent before setting its flags; microphone permission alone does not permit recording or memory.
Verify the embedded call
Test from the real allowed origin. Check microphone permission, audible replies, interruption, an approved and declined action, and cleanup on navigation. A connection failure can reflect your site's Content Security Policy or blocked audio networking.
The SDK uses token-bound call sessions. It does not enroll voice profiles or place telephone calls. For release changes, test a fresh session and confirm the published revision in Logs.