Skip to main content
Running Workloads

Endpoints

Configure private and public Rivet endpoints for your nodes and clients, including namespace credentials and environment variable options.

Local development

No configuration is needed. RivetKit runs a local control plane on your machine.

Production

Private endpoint

The private endpoint tells your nodes and backend where the control plane is. It carries a secret token, so keep it server-side.

Environment Variable

RIVET_ENDPOINT=https://my-namespace:sk_xxxxx@api.rivet.dev

Config

import { actor, setup } from "rivetkit";

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

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

Public endpoint

The public endpoint is what your app hands to browser clients. It is exposed to the internet, so use a public token (pk_), never a secret token (sk_).

RIVET_PUBLIC_ENDPOINT=https://my-namespace:pk_xxxxx@api.rivet.dev

URL auth syntax

Endpoint URLs carry the namespace and token:

https://namespace:token@host/path

This is the recommended form. Alternatively, set them separately:

RIVET_ENDPOINT=https://api.rivet.dev
RIVET_NAMESPACE=my-namespace
RIVET_TOKEN=sk_xxxxx

On a self-hosted control plane, use your namespace slug and admin token. For the default namespace: https://default:<admin-token>@rivet.example.com.

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
RIVET_PUBLIC_ENDPOINTClient-facing endpoint
RIVET_PUBLIC_TOKENClient-facing token