Skip to main content
This guide walks you through the four core operations you’ll use in every PlaySmart integration: creating a player account, using the access token, fetching game configuration, and tracking your first analytics event. All examples use curl and assume your API base URL is https://playsmart-gateway-1w8ko864.uc.gateway.dev.
1

Register a player

Send a POST request to /auth/register with the player’s email address, password, and a unique device identifier. The deviceId you provide is stored as the player’s auth_user_id and is used as the JWT subject claim in all future tokens.
A successful registration returns HTTP 201 with an access token, a refresh token, and the new user record:
Access tokens expire after 30 days. Refresh tokens expire after 180 days. Store both securely on the device and use the refresh token to re-authenticate when the access token expires.
2

Authenticate subsequent requests

Include the access_token from registration (or login) as a Bearer token in the Authorization header on every protected request:
If the token is missing or invalid, the API returns 401 UNAUTHORIZED. If the token’s sub claim does not match the user_id in the request body (on ingest endpoints), the API returns 403 FORBIDDEN.
3

Fetch game configuration

Retrieve the list of active games from /v1/games. This endpoint does not require authentication and returns configuration your client needs to initialize gameplay, including store links, ad settings, and version requirements.
The response contains an array of game objects under data:
You can filter by bundle ID using the bundle_id query parameter: GET /v1/games?bundle_id=com.playsmart.coindash.
4

Track an analytics event

Send a batch of events to /ingest/events. This endpoint requires a Bearer token. The user_id in the request body must match the sub claim in your access token.
A successful ingest returns HTTP 202:
Valid event type values are: AppOpen, LevelCompleted, GameEnd, AdImpression, IAPPurchase, and Custom. For Custom events, include a customEventName string alongside the type.