Skip to main content

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 production or staging. See Namespaces.
  • Token: Authenticates the connection and scopes it to that namespace. The token prefix tells you where it is safe to use:
PrefixKindWhere it lives
sk_SecretYour backend and workers only. Full access to the namespace.
pk_PublicBrowsers and mobile apps. Can resolve, create, and connect to Actors.
ck_ConnectionBrowsers 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.

Environment Variable

RIVET_ENDPOINT=https://my-namespace:<rivet-token>@rivet.example.com

Config

import { actor, setup } from "rivetkit";

const myActor = actor({
  actions: {}
});

const registry = setup({
  use: { myActor },
  endpoint: "https://my-namespace:<rivet-token>@rivet.example.com",
});

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 VariableConfig OptionDescription
RIVET_ENDPOINTendpointControl plane URL for your backend
RIVET_NAMESPACEnamespaceNamespace to run Actors in
RIVET_TOKENtokenToken for the backend connection

Reference

Environment VariableConfig OptionDescription
RIVET_ENDPOINTendpointControl plane URL for your nodes and backend
RIVET_NAMESPACEnamespaceNamespace for Rivet Actor isolation
RIVET_TOKENtokenToken for the control plane connection
Last updated November 10, 2026