Base URL
All authentication endpoints are prefixed with/api/game/auth/
.
Guest Authentication
Authenticate without requiring a Steam account. This method creates a temporary player session.Guest Login
Endpoint:POST /api/game/auth/guest
Request Body:
publicKey
(required): Your project’s public key for identificationplayerId
(optional): Custom player ID. If not provided, one will be generated
Steam Authentication
Authenticate using a Steam account for enhanced features and persistent player data.Steam Login
Endpoint:POST /api/game/auth/steam
Request Body:
publicKey
(required): Your project’s public key for identificationsteamAuthTicket
(required): Steam authentication ticket from the Steam API
Using the Authentication Token
After successful authentication, you’ll receive a JWT token. Include this token in the Authorization header for all subsequent API calls:Error Responses
Invalid Project Key
Invalid Steam Ticket
General Authentication Errors
Implementation Notes
- Project Public Key: You must obtain a public key from your CrateBytes project dashboard
- Steam Integration: For Steam authentication, you’ll need to integrate with Steam’s authentication system
- Token Expiration: JWT tokens expire after 24 hours
- Player Identification: Each player gets a unique
sequentialId
for internal tracking