Skip to content
Node.js SDK for Voicehub API (Alexa Skills & Google Actions)
Branch: master
Clone or download

Voicehub Logo

Voicehub Node.js SDK

Node.js SDK for using Voicehub in Alexa Skills & Google Actions

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 = require('@voicehub/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.

Retrieve Content

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 */
// optionally with dynamic parameter injection
const post = await voicehub
		firstName: 'John',

/* Access a Posts Content */
const speechContent = post.myPostFieldName;

/* Access localized Content */
const speechContent = post.myPostFieldName;

Manage User Data

Manage the users of your Skill or Action:

/* Create a user */
const user = await voicehub
	.user(handlerInput) // or agent object

/* Store information about user */
user.faveFood = 'Pizza';
user.age = 21;

// or set whole object:
	faveFood: 'Pizza',
	age: 21,


/* Access user information */
console.log(user.age); // 21


Voicehub provides you detailed analytics about the performance of you Voicehub. Enable analytics by integrating it accordingly:

Alexa Skills
exports.handler = skillBuilder
		// your intent handlers ...
	.addResponseInterceptors((req, res) => {
		voicehub.interactionInterceptor(req, res);
Google Actions (Dialogflow)
exports.myAction = functions.https.onRequest((request, response) => {
	const agent = new WebhookClient({ request, response });
	// Implement the analytics logger
	// the rest of your code ...

Full SDK Reference

Please find all methods in our SDK Reference.


You can’t perform that action at this time.