Back to Skills

rivetkit-client-swiftui

RivetKit SwiftUI client guidance. Use for SwiftUI apps that connect to Rivet Actors with RivetKitSwiftUI, @Actor, rivetKit view modifiers, and SwiftUI bindings.

14stars2forksUpdated 5/2/2026

Security Assessment

Safe(100/100)
Security Score100/100

About rivetkit-client-swiftui

The `rivetkit-client-swiftui` skill provides a streamlined approach for building SwiftUI applications that interact with Rivet Actors using the RivetKitSwiftUI framework. It simplifies the process of connecting UI components to remote actor services, enabling developers to manage state and actions in a reactive, declarative manner. By leveraging property wrappers like `@Actor` and view modifiers such as `.rivetKit`, this skill helps developers reduce boilerplate code and maintain clean, modular SwiftUI applications while ensuring robust error handling and connection management.

Key features of this skill include seamless integration with Rivet Actors through `RivetKitSwiftUI`, support for SwiftUI bindings and state management, and reactive event handling using `.onActorEvent`. The `@Actor` property wrapper provides flexible options, including get-or-create semantics, connection parameters, and lifecycle toggling. Additionally, the skill encourages a fail-fast error handling policy, ensuring predictable behavior and explicit error logging. It supports both synchronous and asynchronous actions, allowing developers to send commands to actors or await responses efficiently within SwiftUI views.

This skill is particularly useful for iOS and macOS developers building real-time applications that require live updates from server-side actors, such as counters, chat rooms, or multiplayer games. Target users include SwiftUI developers who want to integrate Rivet Actors without manually managing network connections or actor state. It is suitable for applications that demand reactive UI updates, event-driven interactions, and scalable architecture while maintaining a declarative SwiftUI code style.

FAQ

How do I integrate RivetKitSwiftUI into my SwiftUI project?

You can add RivetKitSwiftUI via Swift Package Manager by including the package URL and importing RivetKitSwiftUI in your Swift files. It re-exports RivetKitClient and SwiftUI, so a single import suffices.

What is the purpose of the @Actor property wrapper?

The @Actor property wrapper connects a SwiftUI view to a specific Rivet Actor. It supports get-or-create semantics, optional connection parameters, lifecycle control, and creation hints to manage actor instances efficiently.

Can I handle multiple actions and events asynchronously?

Yes, RivetKitSwiftUI allows you to send actions asynchronously using await, and you can subscribe to actor events using the .onActorEvent modifier to reactively update your SwiftUI state.

Are there specific error handling guidelines?

Yes, the skill recommends a fail-fast approach. Broad do/catch blocks should be avoided unless necessary, and any caught errors should be handled explicitly, at minimum by logging them.

Which versions of RivetKit are supported?

This skill is designed for RivetKit version 2.2.0 and above, and it relies on SwiftUI for its reactive UI bindings.

All Files

2 files
index.json0.3 KB
View
SKILL.md9.6 KB
View

Install rivetkit-client-swiftui

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill