omissis / php-ask-sdk
PHP SDK for Amazon Alexa Skills Kit
Requires
- ext-json: *
- psr/http-client: ^1.0
- psr/http-factory: ^1.0
Requires (Dev)
- doctrine/common: ^2.10
- jakub-onderka/php-parallel-lint: ^1.0
- jangregor/phpstan-prophecy: dev-master
- kriswallsmith/buzz: ^1.0
- nyholm/psr7: ^1.1
- object-calisthenics/phpcs-calisthenics-rules: ^3.5
- phpstan/phpstan: ^0.11
- phpstan/phpstan-phpunit: ^0.11.1
- phpunit/phpunit: ^8.1
- slevomat/coding-standard: ^5.0
- symfony/dotenv: ^3.4
- symfony/property-access: ^3.4
- symfony/property-info: ^3.4
- symfony/serializer: ^3.4
- symfony/var-dumper: ^3.4
- vimeo/psalm: ^3.2
Suggests
- doctrine/common: Used to parse annotations
- kriswallsmith/buzz: Used to communicate with other hosts via HTTP
- nyholm/psr7: Used to use common HTTP Implementations
- symfony/property-access: Used to access object properties
- symfony/property-info: Used to access information about object properties
- symfony/serializer: Used to serialize/deserialize data
This package is auto-updated.
Last update: 2023-07-08 02:07:01 UTC
README
This repository contains an (experimental) API SDK for Alexa's Skill Management API written in PHP.
Local Testing
In order to test it locally, you need to have an account on the Alexa Developer Console as well as a configured skill.
Once that's in place, run composer install
; then create a .env
file in the root of this repo and fill in the skill id.
Last, run make env-renew-token
: that should open a browser and write a token in your env file once you authenticate.
You are now ready to try the examples by running php examples/get_skill.php
and start tinkering with your skill.
Authentication
Quite unfortunately the only supported OAuth2 grant type is "authorization code", which forces the user to authenticate using a browser. In order to make things a bit simpler, there are two helper make targets that automate some parts of the process.
Obtain an access token
make token
Write a new access token in the .env file
make env-renew-token
Notes
Tokens are stored in ~/.ask/cli_config