
Security News
Node.js TSC Votes to Stop Distributing Corepack
Corepack will be phased out from future Node.js releases following a TSC vote.
@deepgram/sdk
Advanced tools
Official Node.js SDK for Deepgram's automated speech recognition APIs.
This SDK only supports hosted usage of api.deepgram.com.
To access the API you will need a Deepgram account. Sign up for free at signup.
Full documentation of the Node.js SDK can be found on the Deepgram Developer Portal.
You can learn more about the full Deepgram API at https://developers.deepgram.com.
npm install @deepgram/sdk
yarn add @deepgram/sdk
const { Deepgram } = require("@deepgram/sdk");
const deepgram = new Deepgram(DEEPGRAM_API_KEY);
const fileSource = { url: URL_OF_FILE };
const response = await deepgram.transcription.preRecorded(fileSource, {
punctuate: true,
});
const streamSource = {
stream: fs.createReadStream("/path/to/file"),
mimetype: MIMETYPE_OF_FILE,
};
const response = await deepgram.transcription.preRecorded(streamSource, {
punctuate: true,
});
navigator.mediaDevices.getUserMedia({ audio: true }).then((stream) => {
const mediaRecorder = new MediaRecorder(stream, {
mimeType: 'audio/webm',
});
const deepgramSocket = deepgram.transcription.live({ punctuate: true });
deepgramSocket.addListener('open', () => {
mediaRecorder.addEventListener('dataavailable', async (event) => {
if (event.data.size > 0 && deepgramSocket.readyState == 1) {
deepgramSocket.send(event.data)
}
})
mediaRecorder.start(1000)
});
deepgramSocket.addListener("transcriptReceived", (received) => {
const transcript = received.channel.alternatives[0].transcript;
if (transcript && received.is_final) {
console.log(transcript);
}
});
});
To run the sample code, first run the following in your terminal:
npm install
npm build
Then update the config object located at the top of the index.js
file in the sample folder.
const config = {
deepgramApiKey: "YOUR_DEEPGRAM_API_KEY",
urlToFile:
"https://static.deepgram.com/examples/Bueller-Life-moves-pretty-fast.wav",
};
Finally, run the sample code using the following command in your terminal:
node sample/index.js
The sample demonstrates the following uses:
Interested in contributing? We ❤️ pull requests!
To make sure our community is safe for all, be sure to review and agree to our Code of Conduct. Then see the Contribution guidelines for more information.
We love to hear from you so if you have questions, comments or find a bug in the project, let us know! You can either:
Check out the Developer Documentation at https://developers.deepgram.com/
FAQs
Isomorphic Javascript client for Deepgram
The npm package @deepgram/sdk receives a total of 70,693 weekly downloads. As such, @deepgram/sdk popularity was classified as popular.
We found that @deepgram/sdk 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.
Security News
Corepack will be phased out from future Node.js releases following a TSC vote.
Research
Security News
Research uncovers Black Basta's plans to exploit package registries for ransomware delivery alongside evidence of similar attacks already targeting open source ecosystems.
Security News
Oxlint's beta release introduces 500+ built-in linting rules while delivering twice the speed of previous versions, with future support planned for custom plugins and improved IDE integration.