Introduction
Localhook is a simple tool to let you test your webhooks locally. It receives payload then sends them to your locally running application. If your application needs to respond to webhook, youβll need some way to expose localhost
to the internet.
Whether youβre integrating payment gateways, messaging platforms, CRMs, or custom APIs, LocalHook makes it dead simple to simulate live webhook traffic without deploying to the cloud.
π Why Use LocalHook?
- Instant Webhook Tunneling
- Expose your local development server to the internet securely using a unique, temporary public URL. No need to push or deploy just to test a webhook.
- Simple, Dev-Centric Workflow
- Plug it into your webhook source (e.g., Stripe, GitHub, WhatsApp)
- Subscribe locally to your desired endpoint
- Test, log, and debug payloads in real time
π Example Use Cases
- Debugging Stripe or Razorpay payment flows
- Testing WhatsApp message webhooks with local bot logic
- Building a headless CMS sync pipeline
- Simulating third-party callbacks in CI/CD
π§° Tech Stack
- Built with IntentJS +
Redis
- Uses Server Sent Events for relaying the requests to your localhost.
Getting Started
localhook
is accessible via CLI right now, I will add support for webview in the next few releases. To install it, run the following command.
npm i -g localhook
Once installed, verify the installation by running the following command.
localhook --version
You can use localhook CLI to create new webhooks or tunneling the webhook to your local route.
Creating Webhooks
To create a new webhook, run the following command. The command gives you a unique webhook URL which you can add in your application.
localhook new
It will output you a new webhook details.
βΉ Please configure the following webhook in your application.β New webhook created: https://lhook.xyz/vBAOv0WFZ5YPlY4
βΉ You can use the webhook by running the following command:β localhook -u https://lhook.xyz/vBAOv0WFZ5YPlY4 -r <route> -p <port>
Once this step is done, we are good to subscribe to the webhook now.
Subscribe to the Webhook
We can subscribe to the webhook by simply running the localhook
command.
localhook -u webhook_url -r local_route -p port_number
For example, to tunnel the request coming from the webhook to your local route, open a new terminal and run the following command.
localhook -u https://lhook.xyz/BYGwTpBz1DAiGYg -r /payments/hooks -p 5001
It will output like below
βΉ Forwarding https://lhook.xyz/BYGwTpBz1DAiGYg to http://localhost:5001/payments/hooksβ Connected to https://lhook.xyz/BYGwTpBz1DAiGYg
Once you run this command, all requests that you will receive on https://lhook.xyz/BYGwTpBz1DAiGYg
will be routed to your local route.
Reporting Issue
Since, this is the first launch of localhook, so you might encounter some edge cases. Feel free to report the bugs on github.