
Research
/Security News
DuckDB npm Account Compromised in Continuing Supply Chain Attack
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
A React component for text-to-speech functionality using the Speechify API
Speechly is a React component that provides text-to-speech functionality using the Speechify API. It allows users to:
npm install speechly
import { Speechly } from 'speechly';
function App() {
// The API key is required
const apiKey = process.env.REACT_APP_SPEECHIFY_API_KEY;
return (
<div>
<h1>My App</h1>
<Speechly apiKey={apiKey} />
</div>
);
}
The Speechly component requires an API key to function. We recommend storing your API key in an environment variable rather than hardcoding it in your source code:
import { Speechly } from 'speechly';
function App() {
// Best practice: Store API key in environment variables
const apiKey = process.env.REACT_APP_SPEECHIFY_API_KEY;
// Optional: Provide user information for voice cloning consent
const userFullName = "John Doe";
const userEmail = "john.doe@example.com";
return (
<div>
<h1>My App</h1>
<Speechly
apiKey={apiKey}
fullName={userFullName}
email={userEmail}
/>
</div>
);
}
For different frameworks, you might need to use different environment variable naming:
REACT_APP_SPEECHIFY_API_KEY
NEXT_PUBLIC_SPEECHIFY_API_KEY
VITE_SPEECHIFY_API_KEY
Storing API keys in environment variables helps keep them secure and makes it easier to use different keys in development and production environments.
Prop | Type | Required | Description |
---|---|---|---|
apiKey | string | Yes | Your Speechify API key. We recommend storing this in an environment variable. |
fullName | string | No | User's full name for consent data when cloning voices. |
string | No | User's email for consent data when cloning voices. |
This project is built with React, TypeScript, and Vite.
Clone the repository:
git clone https://github.com/grandmastr/speechly.git
cd speechly
Install dependencies:
npm install
Start the development server:
npm run dev
Build the package:
npm run build
The project uses Vitest for testing. To run the tests:
# Run tests once
npm test
# Run tests in watch mode
npm run test:watch
# Run tests with coverage
npm run test:coverage
To use Speechly, you'll need a Speechify API key:
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
A React component for text-to-speech functionality using the Speechify API
We found that speechly demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.
Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.