Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maxbeckers/amazon-alexa-bundle
Symfony Bundle for amazon alexa skills.
https://github.com/maxbeckers/amazon-alexa-bundle
alexa alexa-sdk alexa-skill alexa-skills-kit amazon-alexa-bundle amazon-alexa-php amazon-alexa-skill amazon-echo composer echo-api symfony-bundle
Last synced: 3 months ago
JSON representation
Symfony Bundle for amazon alexa skills.
- Host: GitHub
- URL: https://github.com/maxbeckers/amazon-alexa-bundle
- Owner: maxbeckers
- License: mit
- Created: 2017-09-28T14:10:03.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-05-25T08:19:10.000Z (over 1 year ago)
- Last Synced: 2024-04-23T20:06:28.580Z (8 months ago)
- Topics: alexa, alexa-sdk, alexa-skill, alexa-skills-kit, amazon-alexa-bundle, amazon-alexa-php, amazon-alexa-skill, amazon-echo, composer, echo-api, symfony-bundle
- Language: PHP
- Size: 19.5 KB
- Stars: 12
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Amazon alexa symfony bundle
This bundle is a simlpe helper to create an Amazon Echo (Alexa) endpoint to your symfony project. You only need to add the Bundle to your project and create some handlers for the alexa requests, configured in [amazon alexa backend](https://developer.amazon.com/alexa).## Install via composer
Require the bundle via composer:
```
composer require maxbeckers/amazon-alexa-bundle
```
## Enable Routing
Then add the Bundle endpoint for alexa to `config/routes.yaml`.
```
# config/routes.yaml
maxbeckers_amazon_alexa:
path: /alexa/ # the url, the alexa endpoint should be available
defaults: { _controller: MaxBeckers\AmazonAlexaBundle\Controller\AmazonAlexa::amazonRequest }
```
## Create handlers
To add Handlers for alexa, create them as a service and tag them with `maxbeckers_amazon_alexa.request_handler`.
How to create a handler see [maxbeckers/amazon-alexa-php](https://github.com/maxbeckers/amazon-alexa-php).
```
services:
example.my_handler:
class: Example\MyIntentHandler
arguments:
- '@maxbeckers_amazon_alexa.response_helper' # ResponseHelper
tags:
- 'maxbeckers_amazon_alexa.request_handler'
```
## Generate ssml
For ssml use the `maxbeckers_amazon_alexa.ssml_generator` service to create valid ssml.
```php
$ssmlGenerator = $this->get('maxbeckers_amazon_alexa.ssml_generator');// add a message
$ssmlGenerator->say('Hallo World');
$ssml = $ssmlGenerator->getSsml();
// $ssml === 'Hallo World'```