The Client SDK is separate from the server-side Rain SDK, which wraps the Rain REST API for TypeScript, Go, and Python. The Client SDK runs on user devices and interacts with the blockchain directly.
What you can build
- Create non-custodial wallets for your users, where only the user can authorize transactions.
- Query balances and transaction history, and send tokens.
- Withdraw from collateral with a single call.
- Back card spend with the user’s collateral, funded on-chain.
How custody works
A non-custodial wallet is one where only the user can authorize transactions. Neither Rain nor the wallet provider can move the user’s funds on the user’s behalf. Your wallet provider secures the key material — for example, in a secure enclave (TEE) or as an encrypted key share on the user’s device. No one can sign without the user’s approval. Rain stores only wallet addresses. Rain can move a user’s funds only within the limits set by the on-chain contract rules and the user’s own signature. Here’s who holds what:Wallet providers
The SDK supports three wallet providers. Rain’s managed Turnkey program is the recommended default: Rain provisions and configures Turnkey for you, so there’s no separate wallet-provider contract to negotiate, and Turnkey secures keys in secure enclaves (TEE), authenticating users with passkeys or one-time passcodes. Contact platform@rain.xyz to enable it for your account. Here’s how they compare:
Each provider handles user authentication with its own SDK before Rain’s SDK gets involved. See Authentication for what each adapter needs from your app.
Modules
The core module carries:- The builder entry point (
RainSdk) andRainClient - The transaction builder and provider SPI
- Models, errors, and chain readers
- The built-in Rain API client
- The managed Turnkey adapter
Requirements
Minimum platform and tooling versions:Installation
Add the core module plus the adapter(s) for the providers your app ships. A Turnkey-only integration needs just the core module.On iOS, existing integrations can keep depending on rain-sdk-ios: its
RainSDK umbrella product re-exports RainCore + RainPortal, so import RainSDK keeps compiling. It exists for migration only and doesn’t include RainPrivy.Source code
Both SDKs are open source. Review the implementation yourself, or open an issue on GitHub:rain-sdk-ios
rain-sdk-android
What’s next
Common Flows
See how a full integration fits together, end to end.
Authentication
Authenticate wallets with your provider and mint session tokens.
Set Up a Wallet
Build the SDK and create a user’s wallet.