Skip to main content
getState() checks a user’s state in a campaign before attempting a spin.

Usage

Parameters

string
required
User identifier from your system. Example: user-123.
string
required
Campaign ID. Example: camp-abc.

Response

boolean
Whether the user can spin right now.
string | null
Reason the user cannot spin. Values: cooldown_active, spin_limit_reached, campaign_ended, or null.
number
Number of spins used by the user in the campaign.
number
Maximum allowed spins. -1 means unlimited.
string | null
ISO 8601 timestamp when the user can spin again.
object | null
Pending prize to claim, if one exists.
string
Spin ID associated with the pending claim.
object
Pending prize to claim.
string
Deadline to claim the prize.