Now you can get a free webhook, but stable and long-lasting as polling.
AutoWebhook is a library for Node.js and Bun that automatically creates and manages an ngrok tunnel. It provides a stable public URL for your local server, which is ideal for developing and testing webhooks for bots (Telegram, Discord, Slack, etc.), APIs, and other services.
The library runs ngrok in the background, monitors its status, automatically restarts it in case of failures, and provides a simple API to get the current URL.
Why AutoWebhook?
When developing bots or services that use webhooks, you face the need for a public HTTPS URL that can receive requests from external platforms (like Telegram). Ngrok is excellent for this, but it requires manual startup, and the free version provides temporary URLs that change with each restart.
AutoWebhook automates this process:
Automatic Start: Runs ngrok along with your application.
Stable URL: Automatically retrieves the tunnel URL and provides it to your application.
Monitoring and Restart: A built-in health check monitors the tunnel's status and restarts ngrok on failure, providing a "persistent" webhook for development.
Simplicity: Eliminates the need for manual steps and extra scripts.
Core Features
Automatic ngrok tunnel management: Start, stop, and restart in the background.
URL Retrieval: Gets the public URL from the ngrok agent API.
Health Check: Optional component to monitor the status of the tunnel and your application's endpoint.
Reliability: Automatic restart on connection loss or failures.
Flexible Configuration: Ability to specify port, ngrok region, subdomain, auth token, and health check parameters.
Event-driven Architecture: Get real-time notifications for tunnel status changes (ready, restarting, error).
More:
https://github.com/rozeraf/autowebhook
https://www.npmjs.com/package/@rozeraf/autowebhook
Typescript пакет для автоматического создания и автоматизации управлением ngrok туннеля - rozeraf/autowebhook