Creates an idempotency middleware for the client.
Mutating requests automatically receive an X-Idempotency-Key header with a UUID v4 value. The key is generated once per request and reused across retries — so the server sees the same key for the same logical operation even when the client retries.
X-Idempotency-Key
Configuration.
A Middleware that adds idempotency keys.
const client = createClient(api, { middlewares: [idempotency(), retry({ limit: 3 })],}); Copy
const client = createClient(api, { middlewares: [idempotency(), retry({ limit: 3 })],});
Creates an idempotency middleware for the client.
Mutating requests automatically receive an
X-Idempotency-Keyheader with a UUID v4 value. The key is generated once per request and reused across retries — so the server sees the same key for the same logical operation even when the client retries.