Skip to content

Commit 03a5f00

Browse files
authored
chore: udpate docs for RivetKit 2.0.5 (#2938)
1 parent b39aac5 commit 03a5f00

25 files changed

+404
-553
lines changed

site/public/llms-full.txt

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/src/content/docs/actors/actions.mdx

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,29 @@ console.log(result); // The value returned by the action
5050
Learn more about [communicating with actors from the frontend](/docs/actors/communicating-between-actors).
5151

5252
</Tab>
53-
<Tab title="Backend (registry.runServer)">
53+
<Tab title="Backend (registry.start)">
5454

5555
```typescript {{"title":"server.ts"}}
5656
import { setup } from "rivetkit";
57+
import { Hono } from "hono";
58+
import { serve } from "@hono/node-server";
5759

5860
const registry = setup({
5961
use: { counter }
6062
});
6163

62-
const { client, serve } = registry.runServer();
64+
const { client } = registry.start();
6365

64-
// Use the client to call actions
65-
const counter = await client.counter.getOrCreate();
66-
const result = await counter.increment(42);
67-
console.log(result);
66+
const app = new Hono();
67+
68+
// Use the client to call actions on a request
69+
app.get("/foo", () => {
70+
const counter = await client.counter.getOrCreate();
71+
const result = await counter.increment(42);
72+
c.text(result);
73+
});
74+
75+
serve(app);
6876
```
6977

7078
Learn more about [communicating with actors from the backend](/docs/actors/communicating-between-actors).

site/src/content/docs/actors/clients.mdx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ Rivet also supports [React](/docs/clients/react) and [Rust](/docs/clients/rust)
1010

1111
Using the RivetKit client is completely optional. If you prefer to write your own networking logic, you can either:
1212

13+
- Write your own HTTP endpoints and use the client returned from `registry.start` (see below)
1314
- Make HTTP requests directly to the registry (see [OpenAPI spec](/docs/clients/openapi))
14-
- Write your own HTTP endpoints and use the client returned from `registry.runServer` (see below)
1515

1616
## Client Setup
1717

@@ -25,8 +25,10 @@ There are several ways to create a client for communicating with actors:
2525

2626
```typescript {{"title":"server.ts"}}
2727
import { registry } from "./registry";
28+
import { Hono } from "hono";
29+
import { serve } from "@hono/node-server";
2830

29-
const { client, serve } = registry.createServer();
31+
const { client } = registry.start();
3032

3133
const app = new Hono();
3234

site/src/content/docs/actors/fetch-and-websocket-handler.mdx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,9 @@ For more advanced use cases, you can forward requests to actor handlers from you
211211
```typescript
212212
import { Hono } from "hono";
213213
import { registry } from "./registry";
214+
import { serve } from "@hono/node-server";
214215

215-
const { client, serve } = registry.createServer();
216+
const { client } = registry.start();
216217

217218
const app = new Hono();
218219

@@ -241,9 +242,10 @@ serve(app);
241242
```typescript
242243
import { Hono } from "hono";
243244
import { upgradeWebSocket } from "hono/ws";
245+
import { serve } from "@hono/node-server";
244246
import { registry } from "./registry";
245247

246-
const { client, serve } = registry.createServer();
248+
const { client } = registry.start();
247249

248250
const app = new Hono();
249251

site/src/content/docs/actors/quickstart/backend.mdx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@ Choose your preferred web framework:
4848
```ts {{"title":"Hono"}}
4949
import { registry } from "./registry";
5050
import { Hono } from "hono";
51+
import { serve } from "@hono/node-server";
5152

5253
// Start Rivet with file system driver (for development)
53-
const { client, serve } = registry.createServer();
54+
const { client } = registry.start();
5455

5556
// Setup Hono app
5657
const app = new Hono();
@@ -75,15 +76,12 @@ import { registry } from "./registry";
7576
import express from "express";
7677

7778
// Start Rivet
78-
const { client, handler } = registry.createServer();
79+
const { client } = registry.start();
7980

8081
// Setup Express app
8182
const app = express();
8283
app.use(express.json());
8384

84-
// Mount Rivet handler
85-
app.use("/registry", handler);
86-
8785
// Example API endpoints
8886
app.post("/increment/:name", async (req, res) => {
8987
const { name } = req.params;
@@ -104,7 +102,7 @@ import { registry } from "./registry";
104102
import { Elysia } from "elysia";
105103

106104
// Start Rivet
107-
const { client, handler } = registry.createServer();
105+
const { client } = registry.start();
108106

109107
// Setup Elysia app
110108
const app = new Elysia()

0 commit comments

Comments
 (0)