import LaneChat from 'lane-chat';
const lane = new LaneChat({ apiKey: process.env.LANE_KEY });
const reply = await lane.messages.create({
conversation_id: 'cv_8a2f',
content: 'What\'s my order status?'
});
Webhook
We hit your endpoint the moment things happen. Perfect for piping into your own stack.
How it works
1Add your endpoint URL in Settings → Developer → Webhooks.
2We POST events (message.created, conversation.closed, handover, etc.) as JSON.
3Verify the X-Lane-Signature header with your webhook secret.
4Return 2xx within 10s. We retry with backoff if you don't.
✺
Best for: Piping conversations into your CRM, analytics warehouse, or an internal Slack channel.
What we POST to you
POST https://your-app.com/webhooks/lane
X-Lane-Signature: t=1713340800,v1=3f7d...
{
"event": "message.created",
"conversation_id": "cv_8a2f",
"channel": "telegram",
"message": {
"role": "user",
"content": "Hey, my payment didn't go through.",
"created_at": 1713340800
}
}
Verify the signature
import crypto from "node:crypto";
const sig = req.headers["x-lane-signature"];
const [, ts, v1] = sig.match(/t=(\d+),v1=(\w+)/);
const mac = crypto.createHmac("sha256", SECRET)
.update(`${ts}.${rawBody}`).digest("hex");
if (mac !== v1) return res.status(401).end();
AT A GLANCE
Which channel fits your use case?
Not sure which to start with? Here's the honest rundown of what each channel does well.
Capability
Web
Telegram
App
API
Webhook
Two-way text
✓
✓
✓
✓
Receive only
Images, files, voice
✓
✓
✓
✓
URL push
Rich cards & buttons
✓
✓
✓
Raw JSON
—
Push notifications
Only when tab is open
✓
APNs/FCM
✓
—
Broadcast / campaigns
✗
✓
✓
Batch API
—
AI → human handover
✓
✓
✓
Event callback
—
Setup time
5 min
2 min
Half day
1 hour
10 min
Cost
Free
Free
Free
Metered
Free
KEEP GOING
Channels are just the doorway.
Channels are the front door. These are the pieces that make conversations actually work.