
Security News
New CVE Forecasting Tool Predicts 47,000 Disclosures in 2025
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
@speechify/api-sdk
Advanced tools
Supply Chain Security
Vulnerability
Quality
Maintenance
License
⚠️ DEPRECATED: This repository and its SDK are now deprecated. Please use the new official @speechify/api package instead.
The new package provides a more streamlined experience with better TypeScript support and improved API integration. For a quick start guide and migration instructions, please refer to our changelog.
This is the official Node.js SDK for the Speechify API.
Read the SDK full reference here.
Read the REST API documentation here.
npm install @speechify/api-sdk
import { Speechify } from "@speechify/api-sdk";
const speechify = new Speechify({
apiKey: "YOUR_API_KEY",
});
const text = "Hello, world!";
const response = await speechify.audioGenerate({
input: text,
voiceId: "george",
audioFormat: "mp3",
});
const audio = response.audioData;
someStorage.saveFile("audio.mp3", audio);
import { Speechify } from "@speechify/api-sdk";
const speechify = new Speechify({
apiKey: "YOUR_API_KEY",
});
webServer.post("/speechify-token", async (req, res) => {
const user = req.user;
if (!user) {
res.status(401).send("Unauthorized");
return;
}
const tokenResponse = await speechify.accessTokenIssue("audio:all");
res.json(tokenResponse);
});
import { Speechify } from "@speechify/api-sdk";
const speechify = new Speechify();
authSystem.on("login", async () => {
const res = await fetch("/speechify-token", {
method: "POST",
});
const tokenResponse = await res.json();
speechify.setAccessToken(tokenResponse.accessToken);
});
generateButton.addEventListener("click", async () => {
const text = "Hello, world!";
const response = await speechify.audioGenerate({
input: text,
voiceId: "george",
audioFormat: "mp3",
});
const audio = response.audioData;
const audioElement = new Audio();
audioElement.src = URL.createObjectURL(
new Blob([audio], { type: "audio/mpeg" }),
);
audioElement.play();
});
You can use the provided SpeechifyAccessTokenManager
class to have the access token fully managed, including the auto-refresh before it expires.
import { Speechify, SpeechifyAccessTokenManager } from "@speechify/api-sdk";
const speechify = new Speechify();
const getToken = async () => {
const res = await fetch("/speechify-token", {
method: "POST",
});
return res.json();
};
const tokenManager = new SpeechifyAccessTokenManager(speechify, getToken, {
isAuthenticated: authSystem.isAuthenticated,
});
authSystem.on("login", () => {
tokenManager.setIsAuthenticated(true);
});
authSystem.on("logout", () => {
tokenManager.setIsAuthenticated(false);
});
With this setup in place, you can use the speechify
client without worrying about the access token management.
FAQs
Official Speechify AI API SDK
The npm package @speechify/api-sdk receives a total of 1,948 weekly downloads. As such, @speechify/api-sdk popularity was classified as popular.
We found that @speechify/api-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 7 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.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.