Games SDK for Alexa
The Games SDK for Alexa was built to help with the expansion of Amazon’s Alexa into video games, bringing a whole new layer of immersion into gaming.
Ready to get started? Follow the guides here to start!
Installation
$ npm install alexaplusunity
Usage
Create instance:
- Require module:
var alexaPlusUnityClass = require('alexaplusunity');
- Create instance of class:
var alexaPlusUnity = alexaPlusUnityClass("<YOUR_PUBNUB_PUB_KEY>", "<YOUR_PUBNUB_SUB_KEY>", true); //Third parameter enables verbose logging
Avaliable methods:
/**
* Create new GamesSDK Instance.
* @constructor
* @param {string} publishKey - Your PubNub publish key.
* @param {string} subscribeKey - Your PubNub subscribe key.
* @param {bool} [debug=false] - True to enable detailed logs.
*/
constructor(publishKey, subscribeKey, debug)
/**
* Enable/Disable detailed logs.
* @param {bool} debug - True to enable detailed logs.
*/
setDebug(debug)
/**
* Update PubNub instance.
* @param {string} publishKey - Your PubNub publish key.
* @param {string} subscribeKey - Your PubNub subscribe key.
*/
updatePubNub(publishKey, subscribeKey)
/**
* Add channel to channel group.
* @param {string} channel - Channel to add.
* @param {string} channelGroup - Group to add channel to.
*
* @returns {Promise}
*/
addChannelToGroup(channel, channelGroup)
/**
* Publish message to Game Engines.
* @param {string} message - Message to send.
* @param {string} channel - Channel to send message over.
*
* @returns {Promise}
*/
publishMessage(message, channel)
/**
* Publish message to Unity and listen for response.
* @param {string} message - Message to send.
* @param {string} channel - Channel to send message over.
* @param {number} [timeout=1000] - Listener timeout in milliseconds.
*
* @returns {Promise}
*/
publishMessageAndListenToResponse(message, channel, timeout = 1000)
/**
* List channels in channel group.
* @param {string} channelGroup - Channel group to find channels in.
*
* @returns {Promise}
*/
listChannels(channelGroup)
/**
* Create and add new unique channel to channel group.
* @param {string} channelGroup - Channel group create new, unique channel in.
*
* @returns {string}
*/
uniqueQueueGenerator(channelGroup)
/**
* Make new 5 charecter ID.
* @returns {string}
*/
makeId()
License
MIT © Austin Wilson