Voxa Platforms

Voxa Platforms wrap your VoxaApp and allows you to define handlers for the different supported voice platforms.

class VoxaPlatform(voxaApp, config)
Arguments:
  • voxaApp (VoxaApp) – The app
  • config – The config
VoxaPlatform.lambda()
Returns:A lambda handler that will call the app.execute method
exports.handler = alexaSkill.lambda();
VoxaPlatform.lambdaHTTP()
Returns:A lambda handler to use as an AWS API Gateway ProxyEvent handler that will call the app.execute method
exports.handler = dialogFlowAction.lambdaHTTP();
VoxaPlatform.azureFunction()
Returns:An azure function handler
module.exports = cortanaSkill.azureFunction();

Alexa

The Alexa Platform allows you to use Voxa with Alexa

const { AlexaPlatform } = require('voxa');
const { voxaApp } = require('./app');

const alexaSkill = new AlexaPlatform(voxaApp);
exports.handler = alexaSkill.lambda();

DialogFlow

The DialogFlow Platform allows you to use Voxa with DialogFlow

const { DialogFlowPlatform } = require('voxa');
const { voxaApp } = require('./app');

const dialogFlowAction = new DialogFlowPlatform(voxaApp);
exports.handler = dialogFlowAction.lambdaHTTP();

Botframework

The BotFramework Platform allows you to use Voxa with Microsoft Botframework

const { BotFrameworkPlatform } = require('voxa');
const { AzureBotStorage, AzureTableClient } = require('botbuilder-azure');
const { voxaApp } = require('./app');
const config = require('./config');

const tableName = config.tableName;
const storageKey = config.storageKey; // Obtain from Azure Portal
const storageName = config.storageName;
const azureTableClient = new AzureTableClient(tableName, storageName, storageKey);
const tableStorage = new AzureBotStorage({ gzipData: false }, azureTableClient);

const botframeworkSkill = new BotFrameworkPlatform(voxaApp, {
  storage: tableStorage,
  recognizerURI: process.env.LuisRecognizerURI,
  applicationId: process.env.MicrosoftAppId,
  applicationPassword: process.env.MicrosoftAppPassword,
  defaultLocale: 'en',
});

module.exports = botframeworkSkill.azureFunction();