splitchAlpha

DocsSDKidempotency.md

idempotencyKey.

The SDK generates a key per call. Supply one when your application manages retries.

idempotencyKey is optional on evaluate and evaluateDetails. When you omit it, the SDK calls crypto.randomUUID() once for that call and sends the UUID on the required wire header.

If your application may resend a request after an uncertain outcome, such as a timeout or dropped connection, supply one non-empty key and reuse it for every attempt. The platform deduplicates the Exposure, so the subject is counted once. The SDK refuses retries and never retries an Exposure-bearing Evaluation automatically.

For application-managed retries, derive the key from something stable in your request context, such as a request ID or job ID. The SDK preserves that explicit key. An empty or non-string explicit key throws SDK_CONTEXT_INVALID; an omitted key throws SDK_IDEMPOTENCY_KEY_UNAVAILABLE when crypto.randomUUID is unavailable.

  • IDEMPOTENCY_KEY_CONFLICT on the control plane means one key was reused with a different payload. Use a fresh key for a different change, or resend the original payload unchanged.
  • SDK_RETRIES_INVALID is thrown at construction when retries is set above 0.