Tokens
PlaySmart issues two tokens on every successful authentication:
The access token’s
sub claim contains the player’s auth_user_id. Protected endpoints read this claim to identify the caller. The refresh token carries a kind: "refresh" claim and is used solely to issue a new access token — pass it to /auth/login or a dedicated refresh endpoint as appropriate for your integration.
Register a new player
Send aPOST request to /auth/register to create a player account. The deviceId you provide becomes the player’s permanent auth_user_id and is embedded as the JWT sub claim.
Request fields
string
required
A valid email address. Must be unique across all players.
string
required
The player’s password. Minimum 8 characters.
string
required
A stable, unique identifier for the player’s device. Stored as
auth_user_id.201 Created
Log in an existing player
Send aPOST request to /auth/login with the player’s credentials. The response structure is identical to registration.
Request fields
string
required
The player’s registered email address.
string
required
The player’s password.
200 OK
Using the access token
Pass theaccess_token in the Authorization header on every request to a protected endpoint:
X-Forwarded-Authorization header, which takes precedence over Authorization when both are present.
