Voicehub Node.js SDK
What is Voicehub?
Voicehub is a content management and analytics platform for voice based apps. In its core, Voicehub lets you manage the content your voice apps sends out to your users, and combines it with extensive analytical features.
This SDK for Node.js environments lets you easily integrate Voicehub into the logic of your voice apps, which includes both Alexa Skills and Google Actions. You can use it for example in conjunction with with alexa-skills-kit and dialogflow-fulfillment-nodejs.
If you wish to see an example integration, check out our example Alexa Skill or Google Action:
Voicehub is available on npm:
npm install --save @voicehub/voicehub
Require Voicehub at the top of your code and provide your App ID and API Key:
const voicehub = 'APP_ID' 'API_KEY';
Basic Usage Quick Start
The following gives you a brief overview over the capabilities of this SDK. See the full reference for all methods.
You can dynamically retrieve speech content managed on Voicehub:
/* Get a Post by its internal _id */const post = await voicehub;/* Get a Post by Name */const post = await voicehub/* optionally with dynamic parameter injection */;/* Access a Posts Content */const speechContent = postmyPostFieldName;/* Access localized Content */voicehub;const speechContent = postmyPostFieldName;
Filter & Manage Content
Voicehub provides functionality to schedule and tag posts. You can easily define schedules for your content on Voicehub and assign tags to it, and use this information in your voice application:
/* Get all special offers which are scheduled for today */const posts = await voicehub;
Manage User Data
Voicehub provides a persistent key-value store for your user data. Manage the users of your Skill or Action:
/* Create a user */const user = await voicehub// or agent object;/* Store information about user */userfaveFood = 'Pizza';userage = 21;/* or set whole object: */user;await user;/* Access user information */console; // 21
Voicehub provides you detailed analytics about the performance of your Skill or Action. Enable analytics by integrating it accordingly:
exportshandler = skillBuilder;
Google Actions (Dialogflow)
exportsmyAction = functionshttps
Full SDK Reference
Please find all methods in our SDK Reference.