Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
141 changes: 72 additions & 69 deletions site/public/llms-full.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions site/public/llms.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion site/src/components/docs/StepDefineActor.tsx

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions site/src/content/docs/actors/actions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ For advanced use cases that require direct access to HTTP requests or WebSocket
Actions are defined in the `actions` object when creating an actor:

```typescript
import { actor } from "@rivetkit/actor";
import { actor } from "rivetkit";

const mathUtils = actor({
state: {},
Expand Down Expand Up @@ -53,7 +53,7 @@ Learn more about [communicating with actors from the frontend](/docs/actors/comm
<Tab title="Backend (registry.runServer)">

```typescript {{"title":"server.ts"}}
import { setup } from "@rivetkit/actor";
import { setup } from "rivetkit";

const registry = setup({
use: { counter }
Expand Down Expand Up @@ -101,7 +101,7 @@ The actor client includes type safety out of the box. When you use `createClient
<CodeGroup>

```typescript {{"title":"registry.ts"}}
import { setup } from "@rivetkit/actor";
import { setup } from "rivetkit";

// Create simple counter
const counter = actor({
Expand Down Expand Up @@ -152,7 +152,7 @@ For example:
<CodeGroup>

```typescript {{"title":"actor.ts"}}
import { actor, UserError } from "@rivetkit/actor";
import { actor, UserError } from "rivetkit";

const user = actor({
state: { users: [] },
Expand Down Expand Up @@ -200,7 +200,7 @@ If passing data to an actor from the frontend, use a library like [Zod](https://
For example, to validate action parameters:

```typescript {{"title":"actor.ts"}}
import { actor, UserError } from "@rivetkit/actor";
import { actor, UserError } from "rivetkit";
import { z } from "zod";

// Define schema for action parameters
Expand Down Expand Up @@ -246,7 +246,7 @@ When writing complex logic for actions, you may want to extract parts of your im
Rivet provides the `ActionContextOf` utility type for exactly this purpose:

```typescript
import { actor, ActionContextOf } from "@rivetkit/actor";
import { actor, ActionContextOf } from "rivetkit";

const counter = actor({
state: { count: 0 },
Expand Down
6 changes: 3 additions & 3 deletions site/src/content/docs/actors/authentication.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Rivet provides multiple authentication methods to secure your actors. Use `onAut
The `onAuth` hook runs on the HTTP server before clients can access actors. This is the preferred method for most authentication scenarios.

```typescript
import { actor, UserError } from "@rivetkit/actor";
import { actor, UserError } from "rivetkit";

const chatRoom = actor({
onAuth: async (params: { authToken?: string }, { request, intents }) => {
Expand Down Expand Up @@ -156,7 +156,7 @@ const secureActor = actor({
Use specific error types for different authentication failures:

```typescript
import { UserError, Unauthorized, Forbidden } from "@rivetkit/actor/errors";
import { UserError, Unauthorized, Forbidden } from "rivetkit/errors";

const protectedActor = actor({
onAuth: async (params: { authToken?: string }) => {
Expand Down Expand Up @@ -219,7 +219,7 @@ try {
### JWT Authentication

```typescript
import { actor, UserError } from "@rivetkit/actor";
import { actor, UserError } from "rivetkit";
import jwt from "jsonwebtoken";

const jwtActor = actor({
Expand Down
4 changes: 2 additions & 2 deletions site/src/content/docs/actors/clients.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ There are several ways to create a client for communicating with actors:
For frontend applications or external services connecting to your Rivet backend:

```typescript {{"title":"client.ts"}}
import { createClient } from "@rivetkit/actor/client";
import { createClient } from "rivetkit/client";
import type { registry } from "./registry"; // IMPORTANT: Must use `type`

const client = createClient<typeof registry>("http://localhost:8080");
Expand Down Expand Up @@ -393,7 +393,7 @@ const result = await chat.sendMessage("Hello world!");
Actors can validate authentication using the `onAuth` hook:

```typescript
import { actor, UserError } from "@rivetkit/actor";
import { actor, UserError } from "rivetkit";

const protectedActor = actor({
onAuth: async (opts) => {
Expand Down
8 changes: 4 additions & 4 deletions site/src/content/docs/actors/communicating-between-actors.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ We recommend reading the [clients documentation](/docs/actors/clients) first. Th
The server-side actor client allows actors to call other actors within the same registry. Access it via `c.client()` in your actor context:

```typescript
import { actor } from "@rivetkit/actor";
import { actor } from "rivetkit";

const orderProcessor = actor({
state: { orders: [] },
Expand Down Expand Up @@ -46,7 +46,7 @@ const orderProcessor = actor({
Use a coordinator actor to manage complex workflows:

```typescript
import { actor } from "@rivetkit/actor";
import { actor } from "rivetkit";

const workflowActor = actor({
state: { workflows: [] },
Expand Down Expand Up @@ -79,7 +79,7 @@ const workflowActor = actor({
Collect data from multiple actors:

```typescript
import { actor } from "@rivetkit/actor";
import { actor } from "rivetkit";

const analyticsActor = actor({
state: { reports: [] },
Expand Down Expand Up @@ -118,7 +118,7 @@ const analyticsActor = actor({
Use connections to listen for events from other actors:

```typescript
import { actor } from "@rivetkit/actor";
import { actor } from "rivetkit";

const auditLogActor = actor({
state: { logs: [] },
Expand Down
Loading
Loading