This guide will get you up and running with Spokestack for Node — you’ll have a voice interface in your software in no time.
$ npm install spokestack --save
node-spokestack includes Express middleware to help integrate a proxy for the GraphQL API into any node server. A proxy is necessary to avoid exposing your Spokestack credentials.
It can also be used for NLU classification.
This repo includes an example app with sample code using apollo to work with the GraphQL API. The example app also includes a route for viewing live docs (or “introspection”) of the Spokestack api (
The one piece missing from the Spokestack GraphQL API is ASR. This is because a websocket is needed to provide continuous processing. node-spokestack includes functions to use either Spokestack ASR or Google Cloud Speech, and there are two functions for each platform.
- A helper function for adding a websocket to a node server (express or otherwise).
- A one-time function for processing speech into text.
We recommend using the websocket if you need to process speech to text more than once in your application.
Go to spokestack.io and create an account. Create a token at spokestack.io/account/settings#api. Note that you’ll only be able to see the token secret once. If you accidentally leave the page, create another token. Once you have a token, set the following environment variables in your
export SS_API_CLIENT_ID=#"Identity" field from Spokestack API token export SS_API_CLIENT_SECRET=#"Secret key" field from Spokestack API token
If you’d prefer to use Google ASR, follow these instructions for setting up Google Cloud Speech. Ensure
GOOGLE_APPLICATION_CREDENTIALS is set in your environment.