---
title: "Registry Configuration"
description: "This page documents the configuration options available when setting up a RivetKit registry. The registry configuration is passed to the `setup()` function."
skill: true
---

import RegistryConfigSchema from "@/components/docs/RegistryConfigSchemaClient.astro";




## Example Configurations

### Basic Setup

```typescript
import { setup, actor } from "rivetkit";

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

const registry = setup({
  use: { myActor },
});
```

### Connecting to Rivet Engine

<CodeGroup>

```typescript Environment-Variables
import { setup, actor } from "rivetkit";

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

// Reads from RIVET_ENDPOINT, RIVET_TOKEN, and RIVET_NAMESPACE
const registry = setup({
  use: { myActor },
});
```

```typescript Config
import { setup, actor } from "rivetkit";

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

const registry = setup({
  use: { myActor },
  endpoint: "https://api.rivet.dev",
  token: process.env.RIVET_TOKEN,
  namespace: "production",
});
```

</CodeGroup>

## Starting Your App

After configuring your registry, start it:

<CodeGroup>

```typescript registry.start()
import { actor, setup } from "rivetkit";

const myActor = actor({ state: {}, actions: {} });
const registry = setup({ use: { myActor } });

registry.start();
```

```typescript Serverless
import { actor, setup } from "rivetkit";

const myActor = actor({ state: {}, actions: {} });
const registry = setup({ use: { myActor } });

export default registry.serve();
```

```typescript Serverless-with-Router
import { Hono } from "hono";
import { actor, setup } from "rivetkit";

const myActor = actor({ state: {}, actions: {} });
const registry = setup({ use: { myActor } });

const app = new Hono();
app.all("/api/rivet/*", (c) => registry.handler(c.req.raw));

export default app;
```

```typescript Envoy
import { actor, setup } from "rivetkit";

const myActor = actor({ state: {}, actions: {} });
const registry = setup({ use: { myActor } });

registry.startEnvoy();
```

</CodeGroup>

See [Runtime Modes](/docs/general/runtime-modes) for details on when to use each mode.

## Environment Variables

Many configuration options can be set via environment variables. See [Environment Variables](/docs/general/environment-variables) for a complete reference.


## Configuration Reference

<RegistryConfigSchema />

## Related

- [Actor Configuration](/docs/general/actor-configuration): Configure individual actors
- [HTTP Server Setup](/docs/general/http-server): Set up HTTP routing and middleware
- [Architecture](/docs/general/architecture): Understand how RivetKit works
