Stop Adding console.log to Production Just to See What a Webhook Sent
Description and use
Developers often use console.log in production or ngrok to debug webhooks. The solution is to create a temporary URL for request capture (Webhook / Request Bin), point the webhook there, inspect the data, and return it to the real endpoint.
Problem
Debugging webhooks is difficult because they are sent to the application rather than initiated by it. Developers often resort to adding console.log statements to production code or setting up ngrok tunnels to inspect the raw request data, which introduces overhead and risks.
Outcome
The developer successfully inspects the raw request data (headers, body, query params) sent by the webhook provider without modifying production code or redeploying. This allows for accurate debugging of signature verification bugs and payload shape mismatches.
Workflow
- Create a new bin on samtoolkit.com to get a unique, disposable URL.
- Point the webhook or integration at the disposable URL in the provider's dashboard.
- Trigger the event (e.g., a test payment or a push to a repo).
- Inspect the raw request to see the exact headers, body, and query string sent by the provider.
- Fix the handler with the real shape of the data.
- Point the webhook back at the actual production endpoint.
Evidence
Add a <code>console.log(req.body)</code> and redeploy, just to see one request
click <strong>Create a new bin</strong>, get a unique URL back, and point your webhook or integration at it.
Inspect the raw request — see the exact headers, body, and query string the provider actually sent, not what the docs say they send
- Record date: 2026-09-02T14:26:13.583Z