Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Stop Adding console.log to Production Just to See What a Webhook Sent

说明与用途

开发者经常在生产环境中使用 console.log 或 ngrok 来调试 Webhook。解决方案是创建一个临时的请求捕获 URL(Webhook / Request Bin),将 Webhook 指向该地址,检查数据,然后将其返回到真实的端点。

问题

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.

结果

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.

工作流

  • 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.

证据

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

来源

  • 记录日期: 2026-09-02T14:26:13.583Z