The example projects are meant to be used to test features locally by contributors working on this SDK. In the examples/precorded/package.json file, you can see that the deepgram package used is the local version:
"dependencies": {
"@deepgram/sdk": "file:../../"
}This tells the example prerecorded project to use the local files within this project, not an installed package from npm.
If you are contributing changes to this SDK, you can test those changes by using the prerecorded or streaming projects in the examples folder. Here are the steps to follow:
Make your changes to the SDK (be sure you are on a branch you have created to do this work).
In the root folder of this SDK, install the dependencies:
npm i
In the root folder of this SDK, build the project:
npm run build
Move into the examples project directory for either the prerecorded or the streaming example projects:
cd examples/prerecorded
Run the following command to install the example project dependencies:
npm i
Replace the API key where it says 'YOUR_DEEPGRAM_API_KEY'
const deepgramApiKey = "YOUR_DEEPGRAM_API_KEY"
const file = "YOUR_FILE_LOCATION"
const mimetype = "YOUR_FILE_MIME_TYPE";Make sure you're in the directory with the index.js file and run the project with the following command.
npm run test