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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion clients/python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
name = "@rivetkit/actor-client"
name = "rivetkit-client"
version = "0.9.0-rc.1"
authors = [
{ name="Rivet Gaming, LLC", email="[email protected]" },
Expand Down
10 changes: 5 additions & 5 deletions clients/python/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def start_mock_server():
# Build actor-core
logger.info("Building actor-core")
subprocess.run(
["yarn", "build", "-F", "@rivetkit/actor"],
["yarn", "build", "-F", "rivetkit"],
cwd=repo_root,
check=True
)
Expand All @@ -58,15 +58,15 @@ def start_mock_server():

# Pack packages
packages = [
("@rivetkit/actor", repo_root / "packages/actor-core"),
("rivetkit", repo_root / "packages/actor-core"),
("nodejs", repo_root / "packages/platforms/nodejs"),
("memory", repo_root / "packages/drivers/memory"),
("file-system", repo_root / "packages/drivers/file-system")
]

logger.info("Packing packages (3 total)")
for name, path in packages:
output_path = vendor_dir / f"@rivetkit/actor-{name}.tgz"
output_path = vendor_dir / f"rivetkit-{name}.tgz"
subprocess.run(
["yarn", "pack", "--out", str(output_path)],
cwd=path,
Expand Down Expand Up @@ -98,12 +98,12 @@ def start_mock_server():
# Create package.json
logger.info("Creating package.json")
package_json = {
"name": "@rivetkit/actor-python-test",
"name": "rivetkit-python-test",
"packageManager": "[email protected]",
"private": True,
"type": "module",
"dependencies": {
"@rivetkit/actor": f"file:{vendor_dir}/actor-core-actor-core.tgz",
"rivetkit": f"file:{vendor_dir}/actor-core-actor-core.tgz",
"@rivetkit/nodejs": f"file:{vendor_dir}/actor-core-nodejs.tgz",
"@rivetkit/memory": f"file:{vendor_dir}/actor-core-memory.tgz",
"@rivetkit/file-system": f"file:{vendor_dir}/actor-core-file-system.tgz",
Expand Down
2 changes: 1 addition & 1 deletion clients/rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "@rivetkit/actor-client"
name = "rivetkit-client"
version = "0.9.0-rc.1"
description = "Rust client for ActorCore - the Stateful Serverless Framework for building AI agents, realtime apps, and game servers"
edition = "2021"
Expand Down
18 changes: 9 additions & 9 deletions clients/rust/tests/e2e.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ impl MockServer {

// Run `yarn build -F actor-core` in the root of this repo
let status = Command::new("yarn")
.args(["build", "-F", "@rivetkit/actor"])
.args(["build", "-F", "rivetkit"])
.current_dir(&repo_root)
.status()
.expect("Failed to build actor-core");
Expand All @@ -46,15 +46,15 @@ impl MockServer {

// Define packages to pack
let packages = [
("@rivetkit/actor", repo_root.join("packages/actor-core")),
("rivetkit", repo_root.join("packages/actor-core")),
("nodejs", repo_root.join("packages/platforms/nodejs")),
("memory", repo_root.join("packages/drivers/memory")),
("file-system", repo_root.join("packages/drivers/file-system")),
];

// Pack each package to the vendor directory
for (name, path) in packages.iter() {
let output_path = vendor_dir.join(format!("@rivetkit/actor-{}.tgz", name));
let output_path = vendor_dir.join(format!("rivetkit-{}.tgz", name));
println!(
"Packing {} from {} to {}",
name,
Expand Down Expand Up @@ -98,12 +98,12 @@ serve(app, { port: PORT, mode: "memory" });
let package_json_path = server_dir.join("package.json");
let package_json = format!(
r#"{{
"name": "@rivetkit/actor-rust-test",
"name": "rivetkit-rust-test",
"packageManager": "[email protected]",
"private": true,
"type": "module",
"dependencies": {{
"@rivetkit/actor": "file:{}",
"rivetkit": "file:{}",
"@rivetkit/nodejs": "file:{}",
"@rivetkit/memory": "file:{}",
"@rivetkit/file-system": "file:{}"
Expand All @@ -112,10 +112,10 @@ serve(app, { port: PORT, mode: "memory" });
"tsx": "^3.12.7"
}}
}}"#,
vendor_dir.join("@rivetkit/actor-actor-core.tgz").display(),
vendor_dir.join("@rivetkit/actor-nodejs.tgz").display(),
vendor_dir.join("@rivetkit/actor-memory.tgz").display(),
vendor_dir.join("@rivetkit/actor-file-system.tgz").display()
vendor_dir.join("rivetkit-actor-core.tgz").display(),
vendor_dir.join("rivetkit-nodejs.tgz").display(),
vendor_dir.join("rivetkit-memory.tgz").display(),
vendor_dir.join("rivetkit-file-system.tgz").display()
);

std::fs::write(&package_json_path, package_json).expect("Failed to write package.json");
Expand Down
16 changes: 8 additions & 8 deletions docs/clients/javascript.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ icon: node-js
---

import MvpWarning from "/snippets/mvp-warning.mdx";
import StepDefineActor from "/snippets/step-define-actor.mdx";
import StepDefineWorker from "/snippets/step-define-worker.mdx";
import StepRunStudio from "/snippets/step-run-studio.mdx";
import StepDeploy from "/snippets/step-deploy.mdx";
import SetupNextSteps from "/snippets/setup-next-steps.mdx";

The RivetKit JavaScript client allows you to connect to and interact with actors from browser and Node.js applications.
The RivetKit JavaScript client allows you to connect to and interact with workers from browser and Node.js applications.

<MvpWarning />

Expand Down Expand Up @@ -71,20 +71,20 @@ The RivetKit JavaScript client allows you to connect to and interact with actors
</CodeGroup>
</Step>

<StepDefineActor />
<StepDefineWorker />

<Step title="Create your client">
Create a file `src/client.ts` in your project to connect to your actor:
Create a file `src/client.ts` in your project to connect to your worker:

```typescript src/client.ts
import { createClient } from "@rivetkit/actor/client";
import type { App } from "../actors/app";
import { createClient } from "rivetkit/client";
import type { App } from "../workers/app";

async function main() {
// Replace with your endpoint URL after deployment
const client = createClient<App>("http://localhost:6420");

// Get or create an actor instance
// Get or create a worker instance
const counter = await client.counter.get();

// Subscribe to events
Expand Down Expand Up @@ -139,5 +139,5 @@ The RivetKit JavaScript client allows you to connect to and interact with actors

## Next Steps

See the [Interacting with Actors](/concepts/interacting-with-actors) documentation for information on how to use the client.
See the [Interacting with Workers](/concepts/interacting-with-workers) documentation for information on how to use the client.

14 changes: 7 additions & 7 deletions docs/clients/python.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ icon: python
---

import MvpWarning from "/snippets/mvp-warning.mdx";
import StepDefineActor from "/snippets/step-define-actor.mdx";
import StepDefineWorker from "/snippets/step-define-worker.mdx";
import StepRunStudio from "/snippets/step-run-studio.mdx";
import StepDeploy from "/snippets/step-deploy.mdx";
import SetupNextSteps from "/snippets/setup-next-steps.mdx";

The RivetKit Python client provides a way to connect to and interact with actors from Python applications.
The RivetKit Python client provides a way to connect to and interact with workers from Python applications.

<MvpWarning />

Expand Down Expand Up @@ -39,21 +39,21 @@ The RivetKit Python client provides a way to connect to and interact with actors
```
</Step>

<StepDefineActor />
<StepDefineWorker />

<Step title="Create your client">
Create a new file `main.py`:

<CodeGroup>
```python Async
import asyncio
from actor_core_client import AsyncClient
from worker_core_client import AsyncClient

async def main():
# Replace with your endpoint URL after deployment
client = AsyncClient("http://localhost:6420")

# Get or create an actor instance
# Get or create a worker instance
counter = await client.get("counter")

# Subscribe to events using callback
Expand All @@ -77,12 +77,12 @@ The RivetKit Python client provides a way to connect to and interact with actors
```

```python Sync
from actor_core_client import Client
from worker_core_client import Client

# Replace with your endpoint URL after deployment
client = Client("http://localhost:6420")

# Get or create an actor instance
# Get or create a worker instance
counter = client.get("counter")

# Subscribe to events using callback
Expand Down
12 changes: 6 additions & 6 deletions docs/clients/rust.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ icon: rust
---

import MvpWarning from "/snippets/mvp-warning.mdx";
import StepDefineActor from "/snippets/step-define-actor.mdx";
import StepDefineWorker from "/snippets/step-define-worker.mdx";
import StepRunStudio from "/snippets/step-run-studio.mdx";
import StepDeploy from "/snippets/step-deploy.mdx";
import SetupNextSteps from "/snippets/setup-next-steps.mdx";

The RivetKit Rust client provides a way to connect to and interact with actors from Rust applications.
The RivetKit Rust client provides a way to connect to and interact with workers from Rust applications.

<MvpWarning />

Expand All @@ -35,13 +35,13 @@ The RivetKit Rust client provides a way to connect to and interact with actors f
```
</Step>

<StepDefineActor />
<StepDefineWorker />

<Step title="Create your client">
Modify `src/main.rs` to connect to your actor:
Modify `src/main.rs` to connect to your worker:

```rust src/main.rs
use actor_core_client::{Client, GetOptions, TransportKind, EncodingKind};
use worker_core_client::{Client, GetOptions, TransportKind, EncodingKind};
use serde_json::json;
use std::time::Duration;

Expand All @@ -54,7 +54,7 @@ The RivetKit Rust client provides a way to connect to and interact with actors f
EncodingKind::Cbor,
);

// Get or create an actor instance
// Get or create a worker instance
let options = GetOptions::default();
let counter = client.get("counter", options).await?;

Expand Down
8 changes: 4 additions & 4 deletions docs/concepts/cors.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ Cross-Origin Resource Sharing (CORS) is a security mechanism that allows a web a

You'll need to configure CORS when:

- **Local Development:** You're developing locally and your client runs on a different port than your actor service
- **Different Domain:** Your frontend application is hosted on a different domain than your actor service
- **Local Development:** You're developing locally and your client runs on a different port than your worker service
- **Different Domain:** Your frontend application is hosted on a different domain than your worker service

## Example

```ts
import { setup } from "@rivetkit/actor";
import { setup } from "rivetkit";
import counter from "./counter";

const app = setup({
actors: { counter },
workers: { counter },
// Change this to match your frontend's origin
cors: { origin: "https://yourdomain.com" }
});
Expand Down
16 changes: 8 additions & 8 deletions docs/concepts/edge.mdx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
title: Edge Networking
description: Actors run near your users on your provider's global network (if supported).
description: Workers run near your users on your provider's global network (if supported).
icon: globe
---

## Region selection

### Automatic region selection

By default, actors will choose the optimal region based on the client's location.
By default, workers will choose the optimal region based on the client's location.

<Note>
Under the hood, Rivet uses [Anycast routing](https://en.wikipedia.org/wiki/Anycast) to automatically find
Expand All @@ -17,16 +17,16 @@ By default, actors will choose the optimal region based on the client's location

### Manual region selection

The region an actor is created in can be overridden using region options:
The region a worker is created in can be overridden using region options:

```typescript client.ts
import { createClient } from "@rivetkit/actor/client";
import { createClient } from "rivetkit/client";
import type { App } from "./src/index";

const client = createClient<App>("http://localhost:6420");

// Create actor in a specific region
const actor = await client.example.get({
// Create worker in a specific region
const worker = await client.example.get({
options: {
create: {
region: "atl"
Expand All @@ -35,7 +35,7 @@ const actor = await client.example.get({
});
```

See [Create & Manage Actors](/docs/manage) for more information.
See [Create & Manage Workers](/docs/manage) for more information.

## Available regions

Expand All @@ -45,6 +45,6 @@ See available regions [here](/docs/regions).

It's common to need to display a list of available regions in your application.

To fetch a full list of regions, you can use the `GET https://api.rivet.gg/regions` HTTP endpoint. See API documentation [here](/docs/api/actor/regions/list).
To fetch a full list of regions, you can use the `GET https://api.rivet.gg/regions` HTTP endpoint. See API documentation [here](/docs/api/worker/regions/list).

We don't recommend hard-coding the region list. This allows you to develop your application with a local development cluster.
Loading
Loading