Introduction
This guide demonstrates how to receive a webhook from services such as Resend, Twilio, Shopify, and Stripe on your localhost development environment using the Hookdeck CLI. You’ll learn how to set up your environment, run the Hookdeck CLI, receive webhooks, and replay webhooks from the Hookdeck Console to test your code during development.Setup
Step 1: Install the Hookdeck CLI
Via NPM:Step 2: Create and run a localhost web server
Install Flask to use as the web server:server.py
file in the project root:
Step 3: Create a localtunnel with the Hookdeck CLI
In a new terminal window, run the following command to create a localtunnel:Trigger a webhook
Step 4: Trigger a test webhook with a cURL command
Run the following cURL command to act as an inbound webhook, replacing the{URL}
with the Event URL from the Hookdeck CLI output:
Step 5: Trigger a test webhook from the Hookdeck Console
Open the Console URL from your terminal in your browser. Choose a Sample Webhook Provider from the list of Example Webhooks. For example, Stripe. Select a Sample Webhook Type from the list on the right. For example, invoice.created. Click Send. The Hookdeck Console will show the test webhook has been triggered. You can also inspect the webhook payload and the localhost web server response.
Step 6: Replay the webhook
From the Hookdeck Console, click the Resend to destination button to replay the webhook.
Step 7: Trigger and receive a webhook from an API platform
Copy the Event URL from the Hookdeck CLI output. The same URL can also be found in the Hookdeck Console.
