Libraries
    Preparing search index...
    • 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.

      Parameters

      Returns Middleware

      A Middleware that adds idempotency keys.

      const client = createClient(api, {
      middlewares: [idempotency(), retry({ limit: 3 })],
      });