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

@soniox/client

Package Overview
Dependencies
Maintainers
3
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@soniox/client

Official Soniox SDK for client-side applications

latest
Source
npmnpm
Version
2.1.0
Version published
Maintainers
3
Created
Source

@soniox/client

Official Soniox Web SDK for client-side applications.

Full Web SDK Documentation

Installation

npm install @soniox/client

Quick Start

import { SonioxClient } from '@soniox/client';

// Create a client and fetch temporary API key from your backend
const client = new SonioxClient({
  api_key: async () => {
    const res = await fetch('/api/get-temporary-key', { method: 'POST' });
    const { api_key } = await res.json();
    return api_key;
  },
});

Error handling

REST TTS and other HTTP-backed calls throw SonioxHttpError on non-2xx responses, network failures, and aborted requests.

import { SonioxClient, SonioxHttpError } from '@soniox/client';

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 Web 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