A Lambda function for fetching Stripe products as part of a Stripe Relay flow.
NOTE: this function is designed to only return active
products.
Set your Stripe secret key in the .env
file. Copy the sample to get started:
$ cp .env.sample .env
$ sed -i '' "s/<YOUR_SECRET_KEY>/$SECRET_KEY/g" .env
Use the script to create your zip archive:
$ npm run zip
Integrate with the AWS API Gateway to access the function via HTTP POST:
$ curl -H "Content-Type: application/json" $API_GATEWAY_URL
Returns products.data
from the response under the root key of products
:
{
"products": [
...products
]
}