Skip to main content
The React Native SDK is available in sandbox only. Production support is on the roadmap.
The React Native SDK runs in your application on the end customer’s iPhone or Android-powered device. It never holds your API key: every request goes through your backend.

What you can do

  • Create and use a non-custodial account: sign the end customer in, register their authorization key, create a non-custodial account, and sign transfers and withdrawals from it. See Create a non-custodial account.
  • Read accounts and activity: read accounts, limits, deposit addresses, deposits, transactions, transfers, withdrawals, and linked bank accounts.
  • Approve operations with a passkey: run passkey enrollment and approval for Strong Customer Authentication (SCA).
The SDK creates accounts with a custodyType of self only. Its read methods also return other account types.

Requirements

Install

The SDK has two parts: the @circle-fin/daa-react-native-sdk package, and Circle’s iOS and Android SDKs, which it calls for authorization keys, signatures, and passkey ceremonies. Installing the package doesn’t download the native SDKs. Your application’s CocoaPods and Gradle builds resolve them.

Packages

npx expo install picks the expo-crypto version that matches your application’s Expo SDK.

iOS native SDK

The iOS native SDK is distributed from a CocoaPods spec repository. Your Podfile lists it before the CocoaPods CDN source, and pod install resolves it:
Put both source lines at the top of the Podfile, before any target block.

Android native SDK

The Android native SDK is distributed from GitHub Packages, which needs a GitHub account to read even public packages. Your application’s root build.gradle lists it in the repositories block. Read the values from environment variables so that no credentials are committed:
The Android native SDK needs compileSdkVersion 36 or later.

Builds and devices

The SDK’s native modules are linked when your application’s native projects build, for example with npx expo run:ios and npx expo run:android, or npx react-native run-ios and npx react-native run-android in a bare React Native application. Run your application on a physical iPhone or Android-powered device. The authorization key is hardware-backed, so simulators and emulators without secure key hardware can’t create one.

Initialize

The SDK has two clients. Create the one for each job that your application does.

Non-custodial accounts

DaaClient takes four required fields:
For a DaaTransport that sends requests to your relay, see Connect your application.

Passkey approvals

createScaClient returns a client that runs Circle’s passkey ceremony in a system browser sheet: ASWebAuthenticationSession on iOS, and an Auth Tab or Custom Tab on Android.
Before the first ceremony, set up the callback on each platform. See Set up the callback in the iOS SDK reference and Set up the callback in the Android SDK reference. The React Native SDK uses the same setup.

Methods

Each table lists a client’s methods, the API operation that each one calls, and whether the end customer’s authorization key signs it. Your backend relay must forward each operation that your application uses. See Set up a backend relay.
Your relay adds your API key, which can act for all of your end customers, to every request. It must authenticate the end customer and forward only the SDK’s routes. It must forward account, transfer, and withdrawal requests only for the signed-in end customer’s own non-custodial account. Circle checks the end customer’s signature only on non-custodial accounts, and your API key alone can debit a custodial account. The relay must also check that every unsigned request, such as a read, belongs to the signed-in end customer’s clientEntityId.

Sign-in

Sign-in is a chain: each call returns the object that you call next. DaaClient.auth is an AuthClient. You can use each PreparedSocialLogin and PendingDeviceRegistration once. When complete() returns a result whose status is ACTIVE, pass its context to forUser.

Signed-in end customer

DaaUserClient holds the clients in the rest of this section.

Accounts

Money movement

Bank accounts

Passkey approvals

Your backend gets each frameToken from Circle. One ceremony runs at a time.

Pages

List methods return a Page. items holds the results. next() and previous() return the adjacent page, or null when there isn’t one.

Limitations

  • Recipient addresses, account update, and account archive: not in the SDK. Call these from your backend.
For limitations of non-custodial accounts themselves, see Limitations in the sandbox preview.

Errors

The non-custodial clients throw DaaError. The passkey client throws ScaError.

DaaError

Check an error with isDaaError, then read err.detail.kind:
During completeSocialSession, an api error with httpStatus 403 means Circle didn’t accept the sign-in. For example:
  • A different Google Account is already linked to the clientEntityId that you sent.
  • The ID token is invalid or expired.
  • The ID token’s nonce doesn’t match the prepared login.
  • The end customer is blocked.
  • In production, the ID token’s aud isn’t an approved client ID. See Register your Google client IDs.
Start again with a new prepareSocialLogin call. Don’t retry with a different clientEntityId. During sign-in (prepareSocialLogin, completeSocialSession, and complete), errors that your DaaTransport throws pass through unchanged and aren’t DaaError. Start again with a new prepareSocialLogin call. Never log ID tokens, signatures, or key material.

ScaError

Check an error with isScaError, then read err.code. err.reason narrows some codes, such as NoAllowedBrowser or CallbackNotRouted for Unsupported, and is null otherwise.

Versions

The SDK follows semantic versioning. Before version 1.0.0, a minor version can include breaking changes, so pin an exact version. Each version of the package pins the iOS and Android SDK versions that it was tested with.