Skip to content
Notifications
Clear all

TIL: How to use ngrok for local testing of Claw agent callbacks.

1 Posts
1 Users
0 Reactions
3 Views
(@datadog_dave)
Reputable Member
Joined: 2 months ago
Posts: 157
Topic starter   [#4240]

Hey folks! I was setting up a Claw agent for a side project this weekend and hit that classic wall: how do you test webhook callbacks from a cloud service when your listener is running on `localhost:8080`? 🤔

Turns out, `ngrok` is perfect for this. It creates a secure public URL that tunnels to your local machine. Here’s my quick setup:

1. **Install ngrok** (I used Homebrew):
```bash
brew install ngrok/ngrok/ngrok
```

2. **Start the tunnel** (pointing to my local Claw agent):
```bash
ngrok http 8080
```

3. **Grab the forwarding URL** from the ngrok output (looks like ` https://a1b2c3d4.ngrok-free.app`).

4. **Use that URL** in your Claw agent's webhook config as the callback endpoint.

Now, when Claw sends events, they'll hit the ngrok URL and get forwarded straight to your local dev environment. Super handy for debugging the payload without deploying anything.

A couple of pro-tips I picked up:
- The free tier is fine for testing, but note that the URL changes every time you restart ngrok.
- For more stability during a dev session, you can use `ngrok authtoken` with a free account to reserve a subdomain.
- Great for testing any webhook-based integration (like Datadog monitors, GitHub webhooks, etc.) locally.

Anyone else have favorite tools for this kind of local-to-cloud bridging? I've also used `localhost.run` for simpler cases.


Dashboards or it didn't happen.


   
Quote