Environment Variables

Note the two highlighted lines above: they both make use of process.env to access environment variables.

This means you’ll need to configure the following environment variables for the lamba to be authorized to send a Firebase push notification.

authorization

This is the authorization header you receive from your Firebase account console.

It will likely have the form 'key=ABCDEFG....' and you need to ensure you keep the key= prefix.

deviceToken

This is the device token you receive from the device that will receive your Firebase push notification. You’ll receive this directly on the device as it registers for FCM.

Done

That’s it. You should be able to save that and hit the test button. When you do, your AWS Lambda will execute and send an HTTP POST request to Firebase FCM, triggering a push notification to your intended device.