Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@soniox/node

Package Overview
Dependencies
Maintainers
3
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@soniox/node

Official Soniox SDK for Node

latest
Source
npmnpm
Version
2.1.0
Version published
Weekly downloads
10K
54.96%
Maintainers
3
Weekly downloads
 
Created
Source

@soniox/node

Official Soniox SDK for Node

Full Node SDK Documentation

Installation

npm install @soniox/node

Getting Started

import { SonioxNodeClient } from '@soniox/node';

const client = new SonioxNodeClient({
  api_key: 'your-api-key', // or set SONIOX_API_KEY env var
});

Environment variables

SonioxNodeClient reads the following environment variables when the corresponding constructor option is not provided:

VariableMaps to optionNotes
SONIOX_API_KEYapi_keyRequired if api_key is not passed explicitly.
SONIOX_REGIONregionOnly 'eu' and 'jp' are defined; US is the default.
SONIOX_BASE_DOMAINbase_domainOverrides region and forms the default hosts.
SONIOX_API_BASE_URLbase_urlOverrides the REST API host (e.g. https://api.soniox.com).
SONIOX_WS_URLrealtime.ws_base_urlOverrides the STT realtime WebSocket URL.
SONIOX_TTS_API_URLtts_api_urlOverrides the REST TTS host.
SONIOX_TTS_WS_URLrealtime.tts_ws_urlOverrides the TTS realtime WebSocket URL.

Resolution precedence for every setting is:

  • Explicit option passed to new SonioxNodeClient({ ... }).
  • Environment variable from the table above.
  • Value derived from region / base_domain.
  • Root default (United States).

Error handling

REST calls (including REST TTS) throw SonioxHttpError on non-2xx responses, network failures, and aborted requests.

import { SonioxNodeClient, SonioxHttpError } from '@soniox/node';

try {
  const audio = await client.tts.generate({
    text: 'Hello',
    voice: 'Adrian',
    language: 'en',
  });
} catch (err) {
  if (err instanceof SonioxHttpError) {
    console.error(err.code, err.statusCode, err.bodyText);
  }
}

For the full documentation please go to our docs: Full Node SDK Documentation

Keywords

soniox

FAQs

Package last updated on 19 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts