Skip to content
Open
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
1 change: 1 addition & 0 deletions .github/workflows/docs-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:

jobs:
sync:
if: github.repository == 'rivet-dev/actors'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/mirror-swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:

jobs:
mirror:
if: github.repository == 'rivet-dev/actors'
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
4 changes: 4 additions & 0 deletions docs/content/docs/authentication.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,20 @@ skill: true

<Tabs>
<Tab title="Rivet Cloud">

Actors are private by default on Rivet Cloud. Only requests with the publishable token can interact with actors.

- **Backend-only actors**: If your publishable token is only included in your backend, then authentication is not necessary.
- **Frontend-accessible actors**: If your publishable token is included in your frontend, then implementing authentication is recommended.

</Tab>
<Tab title="Self-Hosted">

Actors are public by default on self-hosted Rivet. Anyone can access them without a token.

- **Only accessible within private network**: If Rivet is only accessible within your private network, then authentication is not necessary.
- **Rivet exposed to the public internet**: If Rivet is configured to accept traffic from the public internet, then implementing authentication is recommended.

</Tab>
</Tabs>

Expand Down
3 changes: 3 additions & 0 deletions docs/content/docs/connections.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ For example:
There are two ways to define an actor's connection state:

<Tabs>

<Tab title="connState">

Define connection state as a constant value:

<CodeSnippet file="examples/docs/actors-connections/conn-state-const.ts" />
Expand All @@ -34,6 +36,7 @@ There are two ways to define an actor's connection state:
</Tab>

<Tab title="createConnState">

Create connection state dynamically with a function called for each connection:

<CodeSnippet file="examples/docs/actors-connections/conn-state-dynamic.ts" />
Expand Down
12 changes: 12 additions & 0 deletions docs/content/docs/crash-course.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,12 @@ Persistent data that survives restarts, crashes, and deployments. State is persi

<Tabs>
<Tab title="Static Initial State">

<CodeSnippet file="examples/docs/actors-crash-course/state-static.ts" />

</Tab>
<Tab title="Dynamic Initial State">

<CodeSnippet file="examples/docs/actors-crash-course/state-dynamic.ts" />

</Tab>
Expand Down Expand Up @@ -80,9 +83,12 @@ Temporary data that doesn't survive restarts. Use for non-serializable objects (

<Tabs>
<Tab title="Static Initial Vars">

<CodeSnippet file="examples/docs/actors-crash-course/vars-static.ts" />

</Tab>
<Tab title="Dynamic Initial Vars">

<CodeSnippet file="examples/docs/actors-crash-course/vars-dynamic.ts" />

</Tab>
Expand Down Expand Up @@ -114,9 +120,12 @@ Access the current connection via `c.conn` or all connected clients via `c.conns

<Tabs>
<Tab title="Static Connection Initial State">

<CodeSnippet file="examples/docs/actors-crash-course/conn-static.ts" />

</Tab>
<Tab title="Dynamic Connection Initial State">

<CodeSnippet file="examples/docs/actors-crash-course/conn-dynamic.ts" />

</Tab>
Expand Down Expand Up @@ -186,9 +195,12 @@ Use `UserError` to throw errors that are safely returned to clients. Pass `metad

<Tabs>
<Tab title="Actor">

<CodeSnippet file="examples/docs/actors-crash-course/errors-actor.ts" />

</Tab>
<Tab title="Client">

<CodeSnippet file="examples/docs/actors-crash-course/errors-client.ts" />

</Tab>
Expand Down