Skip to content

Commit bf38cb9

Browse files
authored
docs: update imports from @rivetkit/actor to rivetkit (#2916)
1 parent 0efed00 commit bf38cb9

File tree

42 files changed

+224
-220
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+224
-220
lines changed

site/public/llms-full.txt

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

site/public/llms.txt

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

site/src/app/(v2)/(marketing)/(index)/sections/HeroSection.tsx

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/src/components/docs/StepDefineActor.tsx

Lines changed: 1 addition & 1 deletion
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: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ For advanced use cases that require direct access to HTTP requests or WebSocket
1515
Actions are defined in the `actions` object when creating an actor:
1616

1717
```typescript
18-
import { actor } from "@rivetkit/actor";
18+
import { actor } from "rivetkit";
1919

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

5555
```typescript {{"title":"server.ts"}}
56-
import { setup } from "@rivetkit/actor";
56+
import { setup } from "rivetkit";
5757

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

103103
```typescript {{"title":"registry.ts"}}
104-
import { setup } from "@rivetkit/actor";
104+
import { setup } from "rivetkit";
105105

106106
// Create simple counter
107107
const counter = actor({
@@ -152,7 +152,7 @@ For example:
152152
<CodeGroup>
153153

154154
```typescript {{"title":"actor.ts"}}
155-
import { actor, UserError } from "@rivetkit/actor";
155+
import { actor, UserError } from "rivetkit";
156156

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

202202
```typescript {{"title":"actor.ts"}}
203-
import { actor, UserError } from "@rivetkit/actor";
203+
import { actor, UserError } from "rivetkit";
204204
import { z } from "zod";
205205

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

248248
```typescript
249-
import { actor, ActionContextOf } from "@rivetkit/actor";
249+
import { actor, ActionContextOf } from "rivetkit";
250250

251251
const counter = actor({
252252
state: { count: 0 },

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Rivet provides multiple authentication methods to secure your actors. Use `onAut
1111
The `onAuth` hook runs on the HTTP server before clients can access actors. This is the preferred method for most authentication scenarios.
1212

1313
```typescript
14-
import { actor, UserError } from "@rivetkit/actor";
14+
import { actor, UserError } from "rivetkit";
1515

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

158158
```typescript
159-
import { UserError, Unauthorized, Forbidden } from "@rivetkit/actor/errors";
159+
import { UserError, Unauthorized, Forbidden } from "rivetkit/errors";
160160

161161
const protectedActor = actor({
162162
onAuth: async (params: { authToken?: string }) => {
@@ -219,7 +219,7 @@ try {
219219
### JWT Authentication
220220

221221
```typescript
222-
import { actor, UserError } from "@rivetkit/actor";
222+
import { actor, UserError } from "rivetkit";
223223
import jwt from "jsonwebtoken";
224224

225225
const jwtActor = actor({

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ There are several ways to create a client for communicating with actors:
4747
For frontend applications or external services connecting to your Rivet backend:
4848

4949
```typescript {{"title":"client.ts"}}
50-
import { createClient } from "@rivetkit/actor/client";
50+
import { createClient } from "rivetkit/client";
5151
import type { registry } from "./registry"; // IMPORTANT: Must use `type`
5252

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

395395
```typescript
396-
import { actor, UserError } from "@rivetkit/actor";
396+
import { actor, UserError } from "rivetkit";
397397

398398
const protectedActor = actor({
399399
onAuth: async (opts) => {

site/src/content/docs/actors/communicating-between-actors.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ We recommend reading the [clients documentation](/docs/actors/clients) first. Th
1313
The server-side actor client allows actors to call other actors within the same registry. Access it via `c.client()` in your actor context:
1414

1515
```typescript
16-
import { actor } from "@rivetkit/actor";
16+
import { actor } from "rivetkit";
1717

1818
const orderProcessor = actor({
1919
state: { orders: [] },
@@ -46,7 +46,7 @@ const orderProcessor = actor({
4646
Use a coordinator actor to manage complex workflows:
4747

4848
```typescript
49-
import { actor } from "@rivetkit/actor";
49+
import { actor } from "rivetkit";
5050

5151
const workflowActor = actor({
5252
state: { workflows: [] },
@@ -79,7 +79,7 @@ const workflowActor = actor({
7979
Collect data from multiple actors:
8080

8181
```typescript
82-
import { actor } from "@rivetkit/actor";
82+
import { actor } from "rivetkit";
8383

8484
const analyticsActor = actor({
8585
state: { reports: [] },
@@ -118,7 +118,7 @@ const analyticsActor = actor({
118118
Use connections to listen for events from other actors:
119119

120120
```typescript
121-
import { actor } from "@rivetkit/actor";
121+
import { actor } from "rivetkit";
122122

123123
const auditLogActor = actor({
124124
state: { logs: [] },

0 commit comments

Comments
 (0)