elevenlabs-sdk-patterns

Featured

Apply production-ready ElevenLabs SDK patterns for TypeScript and Python. Use when implementing ElevenLabs integrations, refactoring SDK usage, or establishing team coding standards for audio AI applications. Trigger: "elevenlabs SDK patterns", "elevenlabs best practices", "elevenlabs code patterns", "idiomatic elevenlabs", "elevenlabs typescript".

AI & Automation 2,926 stars 433 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# ElevenLabs SDK Patterns ## Overview Production-ready patterns for the ElevenLabs TypeScript and Python SDKs. Covers singleton clients, type-safe wrappers, error handling, retry logic, and multi-tenant patterns. ## Prerequisites - `@elevenlabs/elevenlabs-js` installed (TypeScript) or `elevenlabs` (Python) - Familiarity with async/await patterns - Understanding of error handling best practices ## Instructions ### Pattern 1: Singleton Client with Config ```typescript // src/elevenlabs/client.ts import { ElevenLabsClient } from "@elevenlabs/elevenlabs-js"; let instance: ElevenLabsClient | null = null; export function getClient(): ElevenLabsClient { if (!instance) { if (!process.env.ELEVENLABS_API_KEY) { throw new Error("ELEVENLABS_API_KEY environment variable is required"); } instance = new ElevenLabsClient({ apiKey: process.env.ELEVENLABS_API_KEY, maxRetries: 3, // Auto-retry on 429/5xx (default: 2) timeoutInSeconds: 60, // Per-request timeout }); } return instance; } // Reset for testing export function resetClient(): void { instance = null; } ``` ### Pattern 2: Type-Safe TTS Service ```typescript // src/elevenlabs/tts-service.ts import { getClient } from "./client"; import { Readable } from "stream"; import { pipeline } from "stream/promises"; import { createWriteStream } from "fs"; export type VoicePreset = "narration" | "conversational" | "dramatic" | "neutral"; const VOICE_PRESETS: Record<VoicePreset, { ...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
1 years ago
Last Updated
yesterday
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category