Skip to main content
The SDK throws NippyError instances for operational errors. Use NippyErrorCodes to handle each case explicitly.
Do not show internal error messages directly to users. Log error.code, error.status, and error.traceId for diagnostics.

Base pattern

Error codes

Cause: The user spun recently and the campaign cooldown is still active.Fix: Call getState() and show nextEligibleAt.
Cause: The user used all allowed spins for the campaign.Fix: Disable the spin action and show the current state.
Cause: The campaignId does not exist, belongs to another business, or the campaign is inactive.Fix: Verify the campaign ID and status before exposing it in your app.
Cause: claim() was called for a prize that was already claimed.Fix: Treat it as idempotent and show the already-claimed prize.
Cause: The user did not claim the prize before the reservation expired.Fix: Inform the user that time ran out and call getState() again.
Cause: The API key is missing or invalid.Fix: Check NIPPY_API_KEY and confirm it uses the correct prefix.
Cause: The API key does not have access to the requested resource.Fix: Check permissions and resource ownership in the console.
Cause: Required fields are missing or a value has the wrong format.Fix: Validate data before calling the SDK.
Cause: Nippy returned a 5xx error after automatic retries.Fix: Log traceId, show a generic state, and retry later.

NippyError properties