Skip to main content
Use the Rain Client SDK to give your users a non-custodial embedded wallet and a Rain card from a single mobile integration. The SDK is modular: a vendor-free core module handles the wallet, card, and collateral logic, and each wallet provider (Turnkey, Portal, or Privy) plugs in as a separate adapter module. You add only the adapter for the provider you use, so an unselected provider’s vendor SDK never enters your app.
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

Funds your users hold in the wallet don’t back their card spend on their own: their card spend draws on their Rain collateral.

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) and RainClient
  • The transaction builder and provider SPI
  • Models, errors, and chain readers
  • The built-in Rain API client
  • The managed Turnkey adapter
Adapter modules depend on core; core depends on neither. The module breakdown:

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.
Rain provides the exact package coordinates and versions during onboarding. The modular artifacts publish with the first modular release.
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.