rivetkit-client-swift
RivetKit Swift client guidance. Use for Swift clients that connect to Rivet Actors with RivetKitClient, create actor handles, call actions, or manage connections.
Security Assessment
About rivetkit-client-swift
The `rivetkit-client-swift` skill provides a comprehensive guide and tooling for developers building Swift clients that interact with Rivet Actors via the RivetKitClient. It addresses the challenge of connecting to and managing remote actors, allowing developers to easily create actor handles, invoke actions, and manage both stateless and stateful connections. By offering a standardized approach to actor interaction, this skill streamlines client-side operations, reduces boilerplate code, and ensures consistent error handling throughout Swift applications.
FAQ
How do I install the RivetKit Swift client in my project?
You can add the RivetKit Swift client as a package dependency in your Package.swift file and import `RivetKitClient` in your Swift code. Ensure you use a version compatible with your project, such as 2.0.0 or later.
Can I use this client for both stateless and stateful interactions?
Yes. The client supports stateless calls where each action is independent, as well as stateful connections that keep a session open for real-time event streaming using AsyncStream.
What is the recommended error handling approach?
The skill recommends a fail-fast approach by default. Broad do/catch blocks should be avoided unless necessary, and any caught errors should be explicitly handled, for example, by logging them.
Are there limitations on the number of arguments for actions?
Yes. The action calls support positional overloads for up to 5 arguments. For more than 5 arguments, developers should use the raw JSON fallback to pass parameters.
Which version of RivetKit is this client compatible with?
The documentation specifies compatibility with RivetKit version 2.2.0. Ensure your server-side actors and endpoints are running a compatible version to avoid connection issues.
Install rivetkit-client-swift
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
rivet-dev/skills