Skip to main content
Agent

Multiplayer

Use Rivet Actors to coordinate shared sessions.

For multiplayer orchestration, use Rivet Actors.

Recommended model:

  • One actor per collaborative workspace/thread.
  • The actor owns Sandbox Agent session lifecycle and persistence.
  • Clients connect to the actor and receive realtime broadcasts.

Use actor keys to map each workspace to one actor, events for realtime updates, and lifecycle hooks for cleanup.

Example

Notes

  • Keep sandbox calls actor-only. Browser clients should not call Sandbox Agent directly.
  • Copy the Rivet persist driver from the example above into your project so session history persists in actor state.
  • For client connection patterns, see Rivet JavaScript client.