question

Kesavan Yogeswaran avatar image
Kesavan Yogeswaran asked

Can SkillRequestSignatureVerifier and TimestampVerifier be reused across multiple skill requests?

The Alexa Skills Kit Node.js SDK documentation specifies using the SkillRequestSignatureVerifier and TimestampVerifier to verify incoming requests.

In the provided example code, a new instance of these two classes is constructed per each request:

try {
    await new SkillRequestSignatureVerifier().verify(textBody, requestHeaders);
    await new TimestampVerifier().verify(textBody);
}

Is that necessary or can instances of these classes be safely reused across multiple requests to provide some level of speedup?

alexa skills kit
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Jason@Amazon avatar image
Jason@Amazon answered

The ASK SDKs generally provide examples on working with one request at a time - I don't believe there's anything specific in regards to handling multiple requests at a time, so anything that you try there will need to be tested by yourself.

10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.