Skip to content
Closed
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
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
Always include a README.md for new packages. The `README.md` should always follow this structure:

```md
# RivetKit {subname, e.g. library: RivetKit Actors, driver and platform: RivetKit Redis Adapter, RivetKit Cloudflare Workers Adapter}
# RivetKit {subname, e.g. library: Rivet Actor, driver and platform: RivetKit Redis Adapter, RivetKit Cloudflare Workers Adapter}

_Lightweight Libraries for Backends_

Expand Down
49 changes: 49 additions & 0 deletions docs/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Documentation Project

This is the documentation site for RivetKit built with Mintlify. The documentation covers RivetKit's actor-based stateful serverless framework and related integrations.

## Documentation Structure

- **actors/**: Core actor system documentation (state, actions, events, scheduling)
- **clients/**: Client libraries for JavaScript/TypeScript, React, Rust
- **drivers/**: Storage drivers (Memory, File System, Redis, Cloudflare Workers, Rivet)
- **general/**: Architecture, authentication, testing, logging, CORS
- **integrations/**: Framework integrations (Hono, Express, Elysia, tRPC, Better Auth, Vitest)
- **snippets/**: Reusable content components for landing page

## Key Documentation Files

- `docs.json`: Mintlify configuration with navigation structure

## Documentation Style Guide

### File Structure
- Use `.mdx` extension for all documentation files
- Include frontmatter with `title`, `description`, and `sidebarTitle`
- Use `icon` field for navigation icons (from Font Awesome icon set)

### Content Guidelines
- **Concise and Direct**: Keep explanations brief and actionable
- **Code-First**: Lead with practical examples, then explain concepts
- **Use Cases Focus**: Emphasize practical applications over theoretical details
- **Progressive Disclosure**: Start simple, link to detailed guides

### Code Examples
- Use TypeScript for all code examples
- Show complete, runnable examples when possible
- Include both actor and client code where relevant
- Follow RivetKit naming conventions (`actor`, `c` for context, etc.)

### Navigation
- Group related concepts under clear categories
- Use descriptive but short sidebar titles
- Maintain consistent icon usage for categories

## Development Resources

- Refer to ../packages/core/fixtures/driver-test-suite/*.ts for examples of working actor definitions
- Refer to ../examples/* for fully working projects. This is especially helpful when writing guides for integrations, etc.
18 changes: 9 additions & 9 deletions docs/actors/actions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ actor.
Actions are defined in the `actions` object when creating a actor:

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

const mathUtils = actor({
state: {},
Expand All @@ -37,7 +37,7 @@ Each action receives a context object (commonly named `c`) as its first paramete
You can define helper functions outside the actions object to keep your code organized. These functions cannot be called directly by clients:

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

// Private helper function - not callable by clients
const calculateFee = (amount) => {
Expand All @@ -62,7 +62,7 @@ const paymentProcessor = actor({

### Streaming Return Data

Actions have a single return value. To stream realtime data in response to an action, use [events](/concepts/events).
Actions have a single return value. To stream realtime data in response to an action, use [events](/actors/events).

## Calling Actions

Expand All @@ -89,7 +89,7 @@ The actor client includes type safety out of the box. When you use `createClient
<CodeGroup>

```typescript src/index.ts
import { setup } from "rivetkit";
import { setup } from "@rivetkit/actor";

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

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

const user = actor({
state: { users: [] },
Expand Down Expand Up @@ -188,7 +188,7 @@ Data schemas are not validated by default. For production applications, use a li
For example, to validate action parameters:

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

// Define schema for action parameters
Expand Down Expand Up @@ -222,7 +222,7 @@ const counter = actor({

## Authentication

By default, clients can call all actions on a actor without restriction. Make sure to implement authentication if needed. Documentation on authentication is available [here](/concepts/authentication).
By default, clients can call all actions on a actor without restriction. Make sure to implement authentication if needed. Documentation on authentication is available [here](/general/authentication).

## Using `ActionContext` Type Externally

Expand All @@ -231,7 +231,7 @@ When writing complex logic for actions, you may want to extract parts of your im
RivetKit provides the `ActionContextOf` utility type for exactly this purpose:

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

const counter = actor({
state: { count: 0 },
Expand All @@ -250,4 +250,4 @@ function incrementCount(c: ActionContextOf<typeof counter>) {
}
```

See [Helper Types](/concepts/types) for more details on using `ActionContextOf` and other type utilities.
See [Helper Types](/actors/helper-types) for more details on using `ActionContextOf` and other type utilities.
157 changes: 0 additions & 157 deletions docs/actors/authentication.mdx

This file was deleted.

Loading
Loading