Before anything, you need to wrap your application with SophonContextProvider, that will store context information about the account and walletClient connection.
Copy
Ask AI
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.
Copy
Ask AI
import { useSophonAccount } from "@sophon-labs/account-react-native";export default function YourComponent() { const { connect, account, disconnect } = useSophonAccount(); // ...}