alexa_skill 0.0.0 copy "alexa_skill: ^0.0.0" to clipboard
alexa_skill: ^0.0.0 copied to clipboard

outdated

Unofficial Dart library for building Alexa skills as Web services.

alexa_skill #

Pub build status

Unofficial Dart library for building Alexa skills as Web services.

Again, this is not an Amazon product.

Usage #

The main functionality of this library is providing JSON models and constants that correspond to all of the standard request and response types for Alexa.

See example/example.dart for an example Hello world server that you can run directly.

Below is a contrived example:

var bodyAsMap = await parseRequestJson();
var requestBody = alexaRequestBodySerializer.decode(bodyResult);
var responseBody = AlexaResponseBody();

if (requestBody.requestType == AlexaRequestType.launchRequest) {
  // Send a basic text response.
  responseBody.response = AlexaResponse(
    outputSpeech: AlexaOutputSpeech(
      type: AlexaOutputSpeechType.plainText,
      text: 'Hello, world!',
    ),
  );
} else if (requestBody.requestType !=
    AlexaRequestType.sessionEndedRequest) {
  // Do something...
}

request.response
  ..headers.contentType = ContentType.json
  ..write(json.encode(responseBody));
6
likes
0
pub points
0%
popularity

Publisher

unverified uploader

Unofficial Dart library for building Alexa skills as Web services.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

angel_serialize, asn1lib, charcode, crypto, http, path, string_scanner, x509csr

More

Packages that depend on alexa_skill