Reference
Tokens
Rivet uses tokens for authentication and authorization when interacting with Rivet APIs. This guide explains the different types of tokens, how to generate them, and how to use them securely.
Types of Tokens
Rivet offers two types of tokens with different permission levels:
Service Token
- Purpose: Runtime API interactions (actors, game services)
- Scope: Limited to specific environment (
dev
/prod
)
How to Generate a Service Token
- Go to your Rivet Dashboard
- Navigate to Project > Environment > Tokens
- Under the "Service Token" section, click "Generate"
- Copy and securely store your token
Cloud Token
- Purpose: Administrative operations (environments, builds, projects)
- Permissions: Elevated
How to Generate a Cloud Token
- Go to your Rivet Dashboard
- Navigate to Project > Settings
- Under the "Cloud Token" section, click "Generate"
- Copy and securely store your token
Using Tokens
Tokens can be used in various ways depending on your development environment and preferred tools.
JavaScript SDK
To use tokens with the JavaScript SDK:
REST API with curl
To use tokens with curl
or other HTTP clients:
Command Line
Rivet Shell
Rivet offers a rivet shell
command that will auto-create a service token & populate common environment variables for executing commands that depend on tokens.
See the rivet shell
documentation for more information.