voxa
voxa copied to clipboard
How to handle new RequestTypes?
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 check this other issue and give us your thoughts #246