Skip to content

How to handle new RequestTypes? #242

@armonge

Description

@armonge

As it is right now the ask-sdk from Amazon can easily handle new types of alexa requests without necesarilly running too deep into the Framework code. As an example, to support the new SessionResumedRequest for Skill Connections it's only needed to implement a simple request handler:

    canHandle(handlerInput) {
        const request = handlerInput.requestEnvelope.request;
        return request.type === 'SessionResumedRequest';
   }

Right now there's no documentation at all as to achieving something like that in Voxa, checking the code seems like we could extend the AlexaPlatform class with something like

class CustomAlexaPlatform extends AlexaPlatform {
  public getPlatformRequests() {
    return Array.prototype.concat(
        super().getPlatformRequests(), 
        'SessionResumedRequest'
    )
  }
}

We need to figure out if there's any changes required to support a "Better Way (tm)" or if this is sufficient. After that we need to document the accepted solution

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions