voxa icon indicating copy to clipboard operation
voxa copied to clipboard

How to handle new RequestTypes?

Open armonge opened this issue 5 years ago • 1 comments

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

armonge avatar Jul 02 '19 10:07 armonge

@armonge check this other issue and give us your thoughts #246

rmberrios avatar Jul 05 '19 17:07 rmberrios