Documentation Index
Fetch the complete documentation index at: https://chatbotx.io/docs/llms.txt
Use this file to discover all available pages before exploring further.
Why you need a tunnel
Channel integrations require public HTTPS URLs to:- Receive webhook events (incoming messages, postbacks, read receipts)
- Complete OAuth redirect flows
- Serve media files that external platforms download when your bot sends attachments
localhost, which is not reachable from the internet. A local tunnel creates a public HTTPS URL and forwards traffic back to your machine.
How it works
NEXT_PUBLIC_ASSET_URL (pointing to the RustFS object storage), external platforms also need to download files from your local RustFS instance. That requires a second tunnel on port 9000.
Prerequisites
- Node.js >= 24 and pnpm 10.x installed
- Docker services running (
docker compose up -d) - An ngrok account (the free tier is sufficient)
- Credentials configured for the channel you are testing (e.g. App ID and App Secret for Messenger, WhatsApp, etc.)
Step 1 — Install ngrok
Your token is on the ngrok Dashboard → Your Auth Token page.
Step 2 — Start the local servers
In separate terminals, start both the builder app and make sure Docker (RustFS) is up:- Builder:
http://localhost:3123 - RustFS:
http://localhost:9000
Step 3 — Start two ngrok tunnels
You need one tunnel for the builder app and one for RustFS (file storage).Step 4 — The three URLs to configure
Replace the example hostnames with your actual tunnel URLs.Webhook URL
<channel> segment matches the integration name, for example:
| Channel | Webhook URL |
|---|---|
| Facebook Messenger | /integrations/messenger/webhook |
/integrations/whatsapp/webhook | |
/integrations/instagram/webhook | |
| Telegram | /integrations/telegram/webhook |
| Zalo | /integrations/zalo/webhook |
- Call
GET <webhook-url>with a verify token to confirm ownership - Call
POST <webhook-url>to deliver events (messages, postbacks, reads, …)
OAuth Redirect URI
File URL
Step 5 — Update environment variables
Open the.env file at the project root and update these variables:
.env
Step 6 — Configure your channel app
The exact steps differ per platform, but the pattern is the same.Register the Webhook URL
Go to your channel’s developer console and add the webhook:- Callback URL / Webhook URL:
https://abcd-1111.ngrok-free.app/integrations/<channel>/webhook - Verify Token: the value you set in Organization Settings for that channel
GET <webhook-url> to verify. If the server responds correctly the webhook is active.
Subscribe to the event types you need (e.g. messages, messaging_postbacks, message_reads for Messenger).
Register the OAuth Redirect URI
In your channel app’s Login / OAuth settings, add:Configure Organization Settings in the app
Go to Organization Settings → [Channel Name] and fill in your App ID, App Secret, API version, and Verify Token. These values come from your channel developer console.Step 7 — Verify the setup
Check webhook verification Most platforms send aGET request to the webhook URL when you save it. If the response is 200 OK with the challenge value, the webhook is verified.
You can also test manually:
http://127.0.0.1:4040 shows all requests and responses in real time — useful for debugging webhook payloads.
Send a test message
Send a message to your bot via the connected channel. You should see:
- A
POST /integrations/<channel>/webhookrequest in the ngrok dashboard - The message appear in the inbox inside the app
Troubleshooting
Webhook verification fails
Webhook verification fails
- Make sure the
verifyTokenin Organization Settings exactly matches what you registered in the channel app - Confirm that the builder is running and the tunnel is active
- Check the ngrok dashboard (
http://127.0.0.1:4040) to see the raw request and response
No POST events received after verification
No POST events received after verification
- Verify you have subscribed to the required event types in the channel app
- Confirm the tunnel is still running (free ngrok tunnels time out after a period of inactivity on the free plan)
- Check that
NEXT_PUBLIC_BUILDER_URLandBETTER_AUTH_URLmatch the current tunnel URL exactly
Media files return 403 or cannot be downloaded by the platform
Media files return 403 or cannot be downloaded by the platform
- Check that
NEXT_PUBLIC_ASSET_URLin.envpoints to the RustFS tunnel URL (notlocalhost) - Make sure you restarted the builder after updating the env variable
- Verify the RustFS tunnel is running:
curl https://efgh-2222.ngrok-free.app/chatbotx/should return a response from RustFS (even an error is fine — a connection refusal means the tunnel is down) - Ensure the Docker
filesystemservice is healthy:docker compose ps filesystem
Tunnel URL changed after restarting ngrok
Tunnel URL changed after restarting ngrok
This is expected on the free plan. After each restart:
- Note the new tunnel URLs from the ngrok terminal output
- Update
BETTER_AUTH_URL,NEXT_PUBLIC_BUILDER_URL, andNEXT_PUBLIC_ASSET_URLin.env - Restart the builder app
- Update the Webhook URL and OAuth Redirect URI in the channel developer console
Alternative tunnel tools
If you prefer not to use ngrok, the following tools work the same way:| Tool | Command | Notes |
|---|---|---|
| Cloudflare Tunnel | cloudflared tunnel --url http://localhost:3123 | Free, random URL each run |
| localtunnel | npx localtunnel --port 3123 | Free, no account needed |
| Expose | expose share http://localhost:3123 | Free and paid plans |
9000 for the RustFS tunnel. All subsequent configuration steps are identical — just substitute the tunnel URLs accordingly.