Skip to content

Public Beta·Free tier is open — paid plans will open with billing after launch.

Blog

SDK v0.2 — automatic idempotency keys

WebhookClientService now sends an Idempotency-Key header on every call, eliminating a common source of duplicate events during retries.

AnnouncementsEngineering · 1 min read

The @nestarc/webhook-client SDK now generates and sends an Idempotency-Key header automatically for every send() call. If you pass idempotencyKey explicitly, that value is used; otherwise the SDK uses crypto.randomUUID() per send.

Why this matters

Without an idempotency key, a retry that happens to succeed on both attempts can create two downstream events from one logical action. The platform API already supported the Idempotency-Key header with a 24-hour TTL scoped per application and route - the SDK just wasn't sending it by default.

What changed

await webhookClient.send({
  eventType: 'order.created',
  payload: order,
  // idempotencyKey: 'order.created:ord_123',  // still recommended for cross-process retries
});

For retries that span process restarts or queue workers, continue to pass a stable idempotencyKey so the same logical send reuses the same key across attempts.

Essential cookies only

We use only necessary cookies for sign-in and workspace context. Paddle may set checkout cookies during payment. Details in our Privacy Policy.