Errors and Rate Limits
Common SDK error codes and how to handle failures gracefully.
Client errors
The SDK maps API failures into AdQuestError with a code and message. Typical codes include network failures, auth/session errors, and validation errors from lottery entry or claims.
Handling in React
onError={(error) => {
console.error(error.code, error.message);
}}
Auth failures
On session expiry, refresh the participant token and retry. Do not loop infinitely — surface a host-level sign-in if minting fails.
Idempotency
Lottery entry and similar mutating calls should use createIdempotencyKey() so network retries are safe.
Rate limits
Platform APIs apply rate limits. Back off on 429 responses and avoid hammering public-config or session mint endpoints from the client.