New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

alexa-ability

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alexa-ability

Create skills for the [Alexa Skills Kit](https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit)

  • 0.5.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
increased by20%
Maintainers
1
Weekly downloads
 
Created
Source

alexa-ability Build Status

Create skills for the Alexa Skills Kit

Example

/** @jsx ssml */

import { Ability, events } from 'alexa-ability';
import { handleAbility } from 'alexa-ability-lambda-handler';
import { ssml } from 'alexa-ssml';

const app = new Ability();

app.use(function(req, next) {
    logRequest(req);
    next();
});

ability.on(events.LAUNCH, function(req) {
    const speech = (
        <speak>
            Hello <pause time={100} /> world
        </speak>
    );

    req.say(speech).show('Hello, world!');
});


ability.on('MeaningOfLifeIntent', function(req, next) {
    asyncRequest(function(err) {
        if (err) return next(err);
        req.say('42').end();
    });
});


ability.on('error', function(err, req, next) {
    req.say('Uhoh, something went wrong');
});

export const handler = handle(app);

API

Ability
new Ability(options) -> ability
Ability.prototype.use(handler) -> ability
Ability.prototype.on(event, handler) -> ability
Ability.prototype.handle(object, callback) -> request
Request
new Request(event) -> request
Request.prototype.say(text|ssml) -> request
Request.prototype.show(title, content) -> request
Request.prototype.reprompt(text|ssml) -> request
Request.prototype.end() -> undefined
Request.prototype.send() -> undefined
Request.prototype.toJSON() -> Object
events
Default Events
  • events.unhandledEvent: No event handler found
  • events.unknownEvent: Handle unknown request types
  • events.error: Handle all errors
  • events.launch: Corresponds to LaunchRequest
  • events.end: Corresponds to SessionEndedRequest
Amazon Intents
  • events.cancel = "AMAZON.CancelIntent"
  • events.help = "AMAZON.HelpIntent"
  • events.no = "AMAZON.NoIntent"
  • events.yes = "AMAZON.YesIntent"
  • events.repeat = "AMAZON.RepeatIntent"
  • events.restart = "AMAZON.StartOverIntent"
  • events.stop = "AMAZON.StopIntent"

FAQs

Package last updated on 31 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc