Endpoints
Tell your nodes and clients where the Rivet control plane is, with the namespace and token in one URL.
Local development
No configuration is needed. RivetKit runs a local control plane on your machine.
RivetKit runs Rivet Actors entirely on your machine. Configure RIVET_ENDPOINT when connecting to a separate control plane.
Private endpoint
Everything that talks to Rivet is configured with one URL, the Rivet endpoint. It carries three pieces of information:
https://<namespace>:<token>@api.rivet.dev
- Host: The control plane to connect to. Rivet Cloud is
api.rivet.dev. Self-hosted deployments use their own host. - Namespace: The isolated environment your Actors live in, such as
productionorstaging. See Namespaces. - Token: Authenticates the connection and scopes it to that namespace. The token prefix tells you where it is safe to use:
| Prefix | Kind | Where it lives |
|---|---|---|
sk_ | Secret | Your backend and workers only. Full access to the namespace. |
pk_ | Public | Browsers and mobile apps. Can resolve, create, and connect to Actors. |
ck_ | Connection | Browsers and mobile apps. Can only resolve Actors and open connections. |
Create tokens in the dashboard under your namespace.
Connect Your Backend
Set RIVET_ENDPOINT with a secret token wherever your workers run. This is the only setting most deployments need.
URL auth syntax
Clients reach your Actors through the control plane’s gateway, never through your backend directly. Point them at the same endpoint with a public token instead of a secret one.
Pass the public endpoint directly when constructing a JavaScript, React, Swift, or Rust client.
URL Auth Syntax
Embedding the namespace and token in the URL is the recommended form because it is one value to manage. If your platform cannot store credentials inside a URL, the same three values can be set separately:
RIVET_ENDPOINT=https://rivet.example.com
RIVET_NAMESPACE=my-namespace
RIVET_TOKEN=<rivet-token>
| Environment Variable | Config Option | Description |
|---|---|---|
RIVET_ENDPOINT | endpoint | Control plane URL for your backend |
RIVET_NAMESPACE | namespace | Namespace to run Actors in |
RIVET_TOKEN | token | Token for the backend connection |
Reference
| Environment Variable | Config Option | Description |
|---|---|---|
RIVET_ENDPOINT | endpoint | Control plane URL for your nodes and backend |
RIVET_NAMESPACE | namespace | Namespace for Rivet Actor isolation |
RIVET_TOKEN | token | Token for the control plane connection |