Developers · Examples
Copy-paste recipes.
Common integrations, ready to lift.
Identify + track on sign-up
s.identify(user.id, { email: user.email, plan: class="tk-s">"free" });
s.track(class="tk-s">"user.signed_up", { source: class="tk-s">"web" });Trigger an automation journey
await fetch(class="tk-s">"https://api.sendoracloud.com/v1/events", {
method: class="tk-s">"POST",
headers: { Authorization: class="tk-s">"Bearer $SENDORA_KEY" },
body: JSON.stringify({
actor: { id: class="tk-s">"u_123" },
verb: class="tk-s">"cart.abandoned",
object:{ id: class="tk-s">"cart_81", items: class="tk-n">3 }
})
});Verify an inbound webhook
import crypto from class="tk-s">"crypto";
function verify(req) {
const sig = req.headers[class="tk-s">"x-sendora-signature"];
const raw = req.rawBody;
const mac = crypto
.createHmac(class="tk-s">"sha256", process.env.WEBHOOK_SECRET)
.update(raw)
.digest(class="tk-s">"hex");
return crypto.timingSafeEqual(Buffer.from(mac), Buffer.from(sig));
}