https://github.com/voxaai/voxa-opearlo
An adapter that allows opearlo logging for Alexa skills implemented with voxa
https://github.com/voxaai/voxa-opearlo
Last synced: 12 months ago
JSON representation
An adapter that allows opearlo logging for Alexa skills implemented with voxa
- Host: GitHub
- URL: https://github.com/voxaai/voxa-opearlo
- Owner: VoxaAI
- License: mit
- Created: 2017-03-02T21:32:44.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-01-12T06:34:47.000Z (over 3 years ago)
- Last Synced: 2025-02-06T06:18:25.762Z (over 1 year ago)
- Language: JavaScript
- Size: 155 KB
- Stars: 0
- Watchers: 18
- Forks: 2
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
Voxa Opearlo
===========
[](https://travis-ci.org/mediarain/voxa-opearlo)
[](https://coveralls.io/github/mediarain/voxa-opearlo?branch=master)
An [Opearlo](https://www.npmjs.com/package/opearlo-analytics) plugin for [voxa](https://mediarain.github.io/voxa/)
Installation
-------------
Just install from [npm](https://www.npmjs.com/package/voxa-opearlo)
```bash
npm install --save voxa-opearlo
```
Usage
------
```javascript
const voxaOpearlo = require('voxa-opearlo');
const opearloConfig = {
userId: 'userId',
appName: 'appName',
apiKey: 'apiKey',
suppressSending: false, // A flag to supress sending hits. Useful while developing on the skill
};
voxaOpearlo(skill, opearloConfig);
```
What you get
------------
Once you register the Voxa plugin, it will handle logging all incoming intents automatically.
Additionally, each state will be logged as a CustomEvent. Thus out of the box you'll get a pathway that looks like:

### Suppressing State Events
Sometimes smaller intermediary states can flood the pathways diagram. Suppress a state from logging as follows:
```javascript
skill.onState('my-state',alexaEvent => {
alexaEvent.opearlo.ignore();
return {reply: 'Greeting', to: 'my-next-state'};
})
```
### Logging variables
You can also add additional values which will be logged along with the state custom event
```javascript
skill.onState('my-state',alexaEvent => {
alexaEvent.opearlo.variables.myVariable = 'hello'
return {reply: 'Greeting', to: 'my-next-state'};
})
```
### Custom Events
You can also log custom events from a state.
```javascript
skill.onState('my-state',alexaEvent => {
alexaEvent.opearlo.log('my-custom-event',{myVariable: 'hello'});
return {reply: 'Greeting', to: 'my-next-state'};
})
```