{"id":13799319,"url":"https://github.com/TheEvilDev/hapi-alexa","last_synced_at":"2025-05-13T08:31:01.811Z","repository":{"id":33486502,"uuid":"37132271","full_name":"TheEvilDev/hapi-alexa","owner":"TheEvilDev","description":null,"archived":false,"fork":false,"pushed_at":"2016-12-01T16:54:07.000Z","size":5,"stargazers_count":2,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T07:46:18.948Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TheEvilDev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-09T13:02:18.000Z","updated_at":"2020-09-13T22:30:34.000Z","dependencies_parsed_at":"2022-08-25T02:11:47.404Z","dependency_job_id":null,"html_url":"https://github.com/TheEvilDev/hapi-alexa","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheEvilDev%2Fhapi-alexa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheEvilDev%2Fhapi-alexa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheEvilDev%2Fhapi-alexa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheEvilDev%2Fhapi-alexa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheEvilDev","download_url":"https://codeload.github.com/TheEvilDev/hapi-alexa/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253903672,"owners_count":21981729,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T00:01:01.404Z","updated_at":"2025-05-13T08:31:01.530Z","avatar_url":"https://github.com/TheEvilDev.png","language":"JavaScript","funding_links":[],"categories":["NPM Modules"],"sub_categories":[],"readme":"# hapi-alexa\n\nHapi plugin for building Amazon Alexa apps on NodeJS.\n\n[![NPM](https://nodei.co/npm/hapi-alexa.png)](https://nodei.co/npm/hapi-alexa/)\n\n## Installation\n\nInstall with npm\n\n    $ npm install --save hapi-alexa\n\n## Example Usage\n\nSetup a new hapi app: [Hapijs](http://hapijs.com/)\n\nInstall Plugin:\n\n``` javascript\n    var Hapi = require('hapi');\n    var server = new Hapi.Server();\n\n    server.connection({\n        port: 5000\n    });\n\n    server.register([{\n    register: require('hapi-alexa'),\n    options: {\n       speechlet: {\n           setup: function(done){\n               done({ response: 'setup' });\n           },\n           tearDown: function(done) {\n               done({ response: 'goodbye' });\n           },\n           HelloWorld: function(slot1) {\n               done({response: 'hello world'});\n           }\n       }\n    }\n    }],\n    function(err) {\n        if (err) {\n            console.error(err);\n        }\n        else {\n            server.start(function() {\n            console.info('Server started at ' + server.info.uri);\n        });\n    }\n    });\n\n    server.start(function() {\n        console.log('Server running at:', server.info.uri);\n    });\n```\n\n## Implementing speechlet\nYou need to implement a javascript object to represent your speechlet. This object should respond with a json object as per the SDK documentation.\n\nThe service will automatically map intents to functions on your speechlet. You will also need to add a setup and tearDown function to handle launch and exit requests respectively.\n\nExample \"Hello World\" speechlet:\n\n``` javascript\nmodule.exports = function() {\n    return {\n        setup: function(done) {\n            done({\n                outputSpeech: {\n                    type: 'PlainText',\n                    text: \"Hello World\"\n                },\n                shouldEndSession: false\n            });\n        },\n        helloIntent: function(name, done) { // maps hello intent with a \"name\" slot\n            done({\n                outputSpeech: {\n                    type: 'PlainText',\n                    text: 'Hello ' + name\n                },\n                shouldEndSession: false;\n            });\n        },\n        tearDown: function(done) {\n            done({\n                outputSpeech: {\n                    type: 'PlainText',\n                    text: 'Good bye.'\n                },\n                shouldEndSession: true\n            });\n        }\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTheEvilDev%2Fhapi-alexa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTheEvilDev%2Fhapi-alexa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTheEvilDev%2Fhapi-alexa/lists"}