Client SDKs
Hadidy Audio provides official client SDKs for both browser and backend integrations. These SDKs handle authentication, connection pooling, typed schemas, and automatic retries out of the box.
1. Universal JavaScript SDK
The core @hadidyapp/audio-sdk package is isomorphic, meaning it works identically in Node.js, the browser, and edge runtimes (like Cloudflare Workers or Vercel Edge).
npm: [@hadidyapp/audio-sdk](https://www.npmjs.com/package/@hadidyapp/audio-sdk) · latest: 0.1.4
npm install @hadidyapp/audio-sdk
Quick Start
import { AudioClient } from '@hadidyapp/audio-sdk';
const client = new AudioClient({ apiKey: 'YOUR_API_KEY' });
// Create a transcoding job
const job = await client.jobs.create({
audio_url: 'https://example.com/input.wav',
output_format: 'mp3',
bitrate: '192k'
});
// Wait for it to finish and get the URL
const completed = await client.jobs.waitForCompletion(job.id);
console.log('Download URL:', completed.output_url);
---
2. Node.js Extensions SDK
For backend environments running Node.js 22+, the @hadidyapp/audio-node-sdk package extends the core SDK with file system features and webhook verification.
npm: [@hadidyapp/audio-node-sdk](https://www.npmjs.com/package/@hadidyapp/audio-node-sdk) · latest: 0.1.6
npm install @hadidyapp/audio-node-sdk
Quick Start
import { AudioNodeClient, WebhookVerifier } from '@hadidyapp/audio-node-sdk';
const client = new AudioNodeClient({ apiKey: 'YOUR_API_KEY' });
// Upload directly from disk (streams to the API)
const job = await client.uploadFromPath('./podcast.wav', {
output_format: 'mp3'
});
// Download the result back to disk
await client.downloadToPath(job.id, './output/podcast.mp3');
// Verify webhooks using Express middleware
import express from 'express';
const app = express();
const verifier = new WebhookVerifier('YOUR_WEBHOOK_SECRET');
app.post('/webhook', express.raw({ type: 'application/json' }), (req, res) => {
if (verifier.verify(req.body, req.headers['x-webhook-signature'])) {
console.log("Verified webhook!");
}
});
---
3. Live Streaming SDK
If you are integrating real-time audio streams (like a DJ broadcast or a live podcast), @hadidyapp/audio-live handles WebRTC publish/subscribe via LiveKit, HLS playback, and SSE metadata streaming.
npm: [@hadidyapp/audio-live](https://www.npmjs.com/package/@hadidyapp/audio-live) · latest: 0.1.6
npm install @hadidyapp/audio-live
Quick Start
import { LiveAudioBroadcaster } from '@hadidyapp/audio-live';
const broadcaster = new LiveAudioBroadcaster({ apiKey: 'YOUR_API_KEY' });
// Start broadcasting from the user's microphone
await broadcaster.startMicrophoneBroadcast({
title: 'Live DJ Set',
preset: 'high-quality-music'
});
---
4. Python SDK
For data pipelines, ML backends, or Django/FastAPI servers, we provide an official Python package hadidy-audio (requires Python 3.10+).
PyPI: [hadidy-audio](https://pypi.org/project/hadidy-audio/) · latest: 0.1.2
pip install hadidy-audio
Quick Start
import os
from hadidy import AudioClient
client = AudioClient(api_key=os.environ.get("HADIDY_API_KEY"))
# Create a transcoding job
job = client.jobs.create(
audio_url="https://example.com/input.wav",
output_format="mp3",
bitrate="192k"
)
print(f"Job created: {job.id}")