rivetkit-client-swift
Swift client for connecting to Rivet Actors with stateless and stateful connection modes.
- Supports both stateless action calls and persistent WebSocket connections with real-time event streaming via AsyncStream
- Provides typed action calls with 0–5 positional arguments, plus raw JSON fallback for larger argument counts
- Includes connection lifecycle monitoring through status changes, errors, opens, and closes streams
- Supports low-level HTTP and WebSocket access for custom
onRequestandonWebSockethandlers - Requires explicit endpoint configuration; reads optional namespace and token from environment variables or URL auth syntax
RivetKit Swift Client
Use this skill when building Swift clients that connect to Rivet Actors with RivetKitClient.
Version
RivetKit version: 2.3.0-rc.5
Error Handling Policy
- Prefer fail-fast behavior by default.
- Avoid broad
do/catchunless absolutely needed. - If a catch block is used, handle the error explicitly, at minimum by logging it.
Install
Add the Swift package dependency and import RivetKitClient:
More from rivet-dev/skills
sandbox-agent
Deploy, configure, and integrate Sandbox Agent - a universal API for orchestrating AI coding agents (Claude Code, Codex, OpenCode, Amp) in sandboxed environments. Use when setting up sandbox-agent server locally or in cloud sandboxes (E2B, Daytona, Docker), creating and managing agent sessions via SDK or API, streaming agent events and handling human-in-the-loop interactions, building chat UIs for coding agents, or understanding the universal schema for agent responses.
6.1Krivetkit
RivetKit backend and Rivet Actor runtime guidance. Use for building, modifying, debugging, or testing Rivet Actors, registries, serverless/runner modes, deployment, or actor-based workflows.
5.7Krivetkit-client-javascript
RivetKit JavaScript client guidance. Use for browser, Node.js, or Bun clients that connect to Rivet Actors with rivetkit/client, create clients, call actions, or manage connections.
5.5Krivetkit-client-react
RivetKit React client guidance. Use for React apps that connect to Rivet Actors with @rivetkit/react, create hooks with createRivetKit, or manage realtime state with useActor.
5.5Krivetkit-client-swiftui
RivetKit SwiftUI client guidance. Use for SwiftUI apps that connect to Rivet Actors with RivetKitSwiftUI, @Actor, rivetKit view modifiers, and SwiftUI bindings.
5.3Kmultiplayer-game
Pragmatic patterns for building multiplayer games: matchmaking, tick loops, realtime state, interest management, and validation.
4.6K