The React Native SDK is available in sandbox only. Production support is on the
roadmap.
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).
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. YourPodfile lists it before the CocoaPods CDN source, and pod install resolves
it:
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 rootbuild.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 withnpx 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:
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.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 aPage. 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.
Errors
The non-custodial clients throwDaaError. 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
clientEntityIdthat 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
audisn’t an approved client ID. See Register your Google client IDs.
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.