The SDK throwsDocumentation Index
Fetch the complete documentation index at: https://docs.nippy.la/llms.txt
Use this file to discover all available pages before exploring further.
NippyError instances for operational errors. Use NippyErrorCodes to handle each case explicitly.
Base pattern
Error codes
COOLDOWN_ACTIVE
COOLDOWN_ACTIVE
Cause: The user spun recently and the campaign cooldown is still active.Fix: Call
getState() and show nextEligibleAt.SPIN_LIMIT_REACHED
SPIN_LIMIT_REACHED
Cause: The user used all allowed spins for the campaign.Fix: Disable the spin action and show the current state.
CAMPAIGN_NOT_FOUND
CAMPAIGN_NOT_FOUND
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.ALREADY_CLAIMED
ALREADY_CLAIMED
Cause:
claim() was called for a prize that was already claimed.Fix: Treat it as idempotent and show the already-claimed prize.RESERVATION_EXPIRED
RESERVATION_EXPIRED
Cause: The user did not claim the prize before the reservation expired.Fix: Inform the user that time ran out and call
getState() again.UNAUTHORIZED
UNAUTHORIZED
FORBIDDEN
FORBIDDEN
Cause: The API key does not have access to the requested resource.Fix: Check permissions and resource ownership in the console.
INVALID_PARAMETERS
INVALID_PARAMETERS
Cause: Required fields are missing or a value has the wrong format.Fix: Validate data before calling the SDK.
SERVER_ERROR
SERVER_ERROR
Cause: Nippy returned a 5xx error after automatic retries.Fix: Log
traceId, show a generic state, and retry later.
