Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
React Native hooks for React Native SDK reference for Crossmint authentication
loginWithOAuth
logout
user
jwt
status
CrossmintAuthProvider
import { useCrossmintAuth } from "@crossmint/client-sdk-react-native-ui"; import { View, Text, TouchableOpacity } from "react-native"; function AuthStatus() { const { loginWithOAuth, logout, user, jwt, status } = useCrossmintAuth(); if (status === "initializing") return <Text>Loading...</Text>; return ( <View> {user == null ? ( <TouchableOpacity onPress={() => loginWithOAuth("google")}> <Text>Log in</Text> </TouchableOpacity> ) : ( <TouchableOpacity onPress={logout}> <Text>Log out ({user.email})</Text> </TouchableOpacity> )} </View> ); }
Note: Must be used within a CrossmintAuthProvider.
Was this page helpful?