2017 © Pedro Peláez
 

library alexa-php-sdk

Amazon Echo (Alexa) PHP SDK

image

elchief84/alexa-php-sdk

Amazon Echo (Alexa) PHP SDK

  • Monday, July 16, 2018
  • by elchief84
  • Repository
  • 1 Watchers
  • 0 Stars
  • 12 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Alexa PHP SDK

Build Status Code Climate, (*1)

This is a free PHP software development kit for Amazon Echo., (*2)

Using the SDK

To use the SDK, just include the alexa-sdk.php file to your Alexa project and add extend the Skill class with your own Skill., (*3)

Composer

Add the Alexa PHP SDK by using composer. Just add a composer.json to your project with the following content., (*4)

{
  "require": {
    "awsmug/alexa-php-sdk": "dev-master"
  }
}

After adding the composer.json, use composer install to install all packages. To use the SDK in your PHP Code, just include the SDK like this:, (*5)

require_once dirname( __FILE__ ) . '/vendor/awsmug/alexa-php-sdk/src/alexa-sdk.php';

A simple skill

This is the code for a very simple skill., (*6)

use Alexa\Skill_Template;
use Alexa\Exception;

class Simple_Skill extends Skill_Template {

    public function intent_request() {
        /**
         * Put in your answer stuff here!
         */
        $this->output()->response()->output_speech()->set_text( 'You started the skill!' );
        $this->output()->response()->end_session();
    }
}

$simple_skill = new Simple_Skill( 'YOUR-SKILL-ID' );

try{
    $simple_skill->run();
} catch( Exception $exception) {
    $simple_skill->log( $exception->getMessage() );
    echo $exception->getMessage();
}

Using Autocomplete

The SDK is programmed for autocompleting functions. If you use an IDE like PHP Storm, the functions will autocomplete by itself and you can discover the functions by the autocomplete functionality of the IDE., (*7)

The Versions

16/07 2018

dev-master

9999999-dev

Amazon Echo (Alexa) PHP SDK

  Sources   Download

GPL-3.0

The Development Requires