Because of how React Native libraries work, you will need to install dependencies that have native code directly in your app so that we can use them.
You can add support for Sophon Account in your React Native application by using the @sophon-labs/account-react-native package.

Installation

The SDK is compatible with Expo Go without the need of prebuilding the app.
Before you start, you need these libraries:
# Expo packages
npx expo install react-native-webview expo-standard-web-crypto expo-crypto expo-network expo-secure-store
After that, you are ready to install our SDK:
# Sophon Library
npm install @sophon-labs/account-react-native

Usage

Before anything, you need to wrap your application with SophonContextProvider, that will store context information about the account and walletClient connection.
import { DataScopes } from "@sophon-labs/account-core";
import { SophonContextProvider } from "@sophon-labs/account-react-native";

export default function RootLayout() {
  // ...

  return (
    <SophonContextProvider
      partnerId="$YOUR_PARTNER_ID"
      dataScopes={[DataScopes.email, DataScopes.x]}
      network="testnet"
    >
      {/* Your components*/}
    </SophonContextProvider>
  );
}
With that ready, you can now use our hooks to interact with Sophon.
import { useSophonAccount } from "@sophon-labs/account-react-native";

export default function YourComponent() {
  const { connect, account, disconnect } = useSophonAccount();
  // ...
}

React Native Example

You can check an example of implementing React Native with Sophon Account.