SDKsNode.js
Full Node SDK reference
Full SDK reference for the Node SDK
Environment variables
Environment variables are used to configure the client. You can set them in your environment or pass them explicitly to the client.
| Variable | Description | Default |
|---|---|---|
SONIOX_API_KEY | API key for REST requests | - |
SONIOX_API_BASE_URL | REST base URL | https://api.soniox.com |
SONIOX_WS_URL | Real-time WebSocket base URL | wss://stt-rt.soniox.com/transcribe-websocket |
SONIOX_API_WEBHOOK_HEADER | Webhook auth header name | - |
SONIOX_API_WEBHOOK_SECRET | Webhook auth header value | - |
Client
Available client methods
File
Available file instance methods
| Method | Description |
|---|---|
file.delete() | Delete file |
Transcription
Available transcription instance methods
| Method | Description |
|---|---|
transcription.getTranscript() | Get transcription transcript |
transcription.delete() | Delete transcription |
transcription.destroy() | Delete transcription and its file |
transcription.wait() | Wait for transcription to complete |
transcription.refresh() | Refresh transcription |
Transcript
| Method | Description |
|---|---|
transcript.segments() | Get transcript segments |
transcript.text | Transcript text |
transcript.tokens | Transcript tokens |
Real-time STT Session
| Method | Description |
|---|---|
realtime.stt.connect() | Establish websocket connection |
realtime.stt.close() | Close websocket connection |
realtime.stt.finalize() | Request server to finalize current transcription |
realtime.stt.finish() | Gracefully finish the session |
realtime.stt.keepAlive() | Send keepalive message |
realtime.stt.off() | Remove event handler |
realtime.stt.on() | Register event handler |
realtime.stt.once() | Register one-time event handler |
realtime.stt.sendAudio(audio) | Send audio chunk |
realtime.stt.sendStream(stream, options) | Send audio stream |
realtime.stt.pause() | Pause audio transmission |
realtime.stt.resume() | Resume audio transmission |
realtime.stt.paused | Whether the session is currently paused |
realtime.stt.state | Current session state |