
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
@restackio/integrations-elevenlabs
Advanced tools
This package provides an integration with ElevenLabs API for text-to-speech conversion using Restack.
This package provides an integration with ElevenLabs API for text-to-speech conversion using Restack.
To install the package, use npm or yarn:
npm install @restackio/integrations-elevenlabs
First, import the necessary modules and set up the ElevenLabs service:
// services.ts
import Restack from "@restackio/ai";
import { elevenlabsService } from "@restackio/integrations-elevenlabs";
export async function services() {
const client = new Restack();
elevenlabsService({ client }).catch((err) => {
console.error("Error starting ElevenLabs service:", err);
});
}
services().catch((err) => {
console.error("Error running services:", err);
});
To convert text to speech, use the elevenlabsConvert
function:
// convertTextToSpeech.ts
import { log, step } from "@restackio/ai/workflow";
import * as elevenLabsFunctions from "@restackio/integrations-elevenlabs/functions";
import { elevenlabsTaskQueue } from "@restackio/integerations-elevenlabs/taskQueue";
export async function convertTextToSpeechWorkflow() {
const result = await step<typeof elevenLabsFunctions>({
taskQueue: elevenlabsTaskQueue,
}).elevenlabsConvert({
text: "Hello, world!",
apiKey: "YOUR_ELEVENLABS_API_KEY",
});
log.info("result", { result: result.media.payload }); // Base64 encoded audio
}
The elevenlabsConvert
function accepts the following parameters:
text
(required): The text to convert to speech.voiceId
(optional): The ID of the voice to use. Defaults to "fCxG8OHm4STbIsWe4aT9".options
(optional): Additional options for the text-to-speech conversion.twilioEncoding
(optional): Set to enable Twilio-compatible encoding.apiKey
(required): Your ElevenLabs API key.To use the ElevenLabs client without explicitly passing the API key, set the following environment variable:
ELEVENLABS_API_KEY=your_api_key_here
FAQs
This package provides an integration with ElevenLabs API for text-to-speech conversion using Restack.
The npm package @restackio/integrations-elevenlabs receives a total of 10 weekly downloads. As such, @restackio/integrations-elevenlabs popularity was classified as not popular.
We found that @restackio/integrations-elevenlabs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.