Skip to Content
FrameworksNode / any backend

Node / any backend

All three calls are plain HTTPS with JSON. Any language works.

Collect (from the browser or your server)

curl -X POST https://waitlistly.live/api/v1/contacts \ -H "Content-Type: application/json" \ -H "X-Waitlistly-Key: $WAITLISTLY_PUBLIC_KEY" \ -d '{"email":"ada@example.com","name":"Ada","ref":"k3x9p2aa"}'

Gate and activate (server only)

waitlistly.ts
const BASE = 'https://waitlistly.live/api/v1'; const headers = { 'Content-Type': 'application/json', Authorization: `Bearer ${process.env.WAITLISTLY_SECRET_KEY}` }; export async function verifyInvite(code: string) { const res = await fetch(`${BASE}/invites/verify`, { method: 'POST', headers, body: JSON.stringify({ code }) }); return res.json() as Promise<{ valid: boolean; status: string; email: string; expires_at: string }>; } export async function reportActivation(codeOrEmail: { code: string } | { email: string }) { const res = await fetch(`${BASE}/activations`, { method: 'POST', headers, body: JSON.stringify(codeOrEmail) }); return res.json(); }
routes/signup.ts (Express)
app.post('/signup', async (req, res) => { const invite = await verifyInvite(req.body.invite_code); if (!invite.valid) return res.status(403).json({ error: 'This invite is not valid or has expired.' }); const user = await createUser(req.body); // your auth await reportActivation({ code: req.body.invite_code }); res.json({ user }); });
Last updated on