Skip to main content
import { Text } from 'react-native';
import { useStytchUser } from '@stytch/react-native';

export const Home = () => {
  const { user } = useStytchUser();

  return user ? <Text>Welcome, {user.name.first_name}</Text> : <Text>Log in to continue!</Text>;
};
{
  "user": { ... },
  "fromCache": false
}
To get the currently signed in User, use the useStytchUser hook. If no User is signed in, the user object will be null. In non-React environments, use the user.getSync method to get the User.

Return Value

user
object | null
The current User.
fromCache
boolean
Whether the User data is from persistent storage.