0

I am using LWA as my oauth2 provider and need to send change reports when my contact sensors change state. Because of LWA account linking I've determined that I will have to store access and refresh tokens in a database from my skill. If that's the case, then the only way to send a report is to have my server send data to the skill which sends the actual directive to the endpoint. If that is the case, how do I create a separate trigger or function that will receive data from my server, repackage it and send to the endpoint?

And if the best way to do this is to have my server contact the endpoint directly, which seems more elegant to me, how would I get the necessary tokens or auth code to my server for storage?

Daemach
  • 417
  • 5
  • 13

1 Answers1

0

When sending events to Alexa Event Gateway, there's no requirement on whether to send it through your skill Lambda v.s. your backend server. As long as you have the access token of the user, you can send the event from anywhere you want.

I think the easiest way to implement this is to have your skill stores the access and refresh token in DynamoDB. When the device state changes, your backend server would retrieve the access token from DynamoDB and then send the event to Alexa Event Gateway.

Christina
  • 1,870
  • 12
  • 16