This sample TypeScript application demonstrates how to create a webhook subscription for Dwolla events, deployed to AWS via Lambda function.
This app deploys a webhook handler as an AWS Lambda function using the Serverless Framework. You can deploy one to your AWS account(s) as follows:
NOTE: Any pnpm
command can be replaced with npm
.
- Clone the repository and install dependencies with
pnpm install
- Rename
.env.example
to.env
, and update the environment variables - Run
pnpm sls:deploy
to create the Lambda functions. After they deploy, a publicly accessible HTTP endpoint is logged to the console asendpoint
. Copy and paste it into theURL
variable inscripts/one-time-setup.ts
- Run
pnpm hook:setup
to create your Webhook Subscription - Run
pnpm hook:create-customer
to create a customer in Dwolla's API - Check your webhook function's logs by running
pnpm sls:logs:webhook
. You should see a message indicating that the webhook has been moved to your SQS queue for processing. - Check your SQS function's logs by running
pnpm sls:logs:queue
. You should see the contents of the webhook after it has been parsed. - [Optional] To remove the resources in AWS, run
pnpm sls:remove