Local development and webhooks
Your server runs on localhost, but Vendrix delivers webhooks to a public HTTPS URL. A tunnel connects them.
These examples use a placeholder address. Your console shows the exact address of the API for your workspace.
Three addresses to distinguish#
| URL | Purpose |
|---|---|
| Vendrix /api/public/v1 | Hosted API called by your server with your key. Not a localhost API. |
| http://localhost:3000/webhooks/vendrix | Local HTTP POST receiver. |
| https://your-tunnel.example/webhooks/vendrix | Public HTTPS URL to register in the Vendrix console. |
1. Start the local receiver#
Start a Node server on port 3000 with a POST /webhooks/vendrix route. Use the Node receiver and signature verification from the webhook guide. Read the raw body before JSON.parse.
import express from "express";
import { verifyVendrixWebhook } from "./verify-vendrix-webhook";
const app = express();
// Read the body as raw bytes: the signature covers the exact bytes Vendrix sent.
app.post("/vendrix/webhook", express.raw({ type: "application/json" }), (req, res) => {
const verified = verifyVendrixWebhook({
secret: process.env.VENDRIX_WEBHOOK_SECRET,
rawBody: req.body,
headers: req.headers,
});
if (!verified) return res.sendStatus(400);
const event = JSON.parse(req.body.toString("utf8"));
// Delivery is at least once: skip an event.id you have already handled.
// Answer 2xx quickly, then do the work.
res.sendStatus(200);
});2. Expose the server over HTTPS#
With cloudflared installed, run the command below in a second terminal. Copy the HTTPS URL it prints and append /webhooks/vendrix.
cloudflared tunnel --url http://localhost:30003. Configure the webhook#
- Developer console → sandbox application → Webhooks → Add.
- Paste the full public HTTPS URL, never localhost.
- Subscribe to webhook.test and save.
- Copy the signing secret shown once and keep it in server environment variables.
4. Send a test event#
Use Send test event in the console, or POST /sandbox/events with an authorized sandbox key.
curl -X POST "https://vendrix-api-7897083941.europe-west4.run.app/api/public/v1/sandbox/events" \
-H "Authorization: Bearer $VENDRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "message.received"
}'5. Verify and troubleshoot#
- Check the POST in the local terminal and verify Vendrix-Signature.
- Return 2xx promptly after reliably accepting the event.
- Inspect Deliveries in the console and check the HTTP status.
- On failure: check the tunnel, route, secret, clock and subscription.