Skip to main content
Use the reactive client (e.g. useReactiveClient(dynamicClient) from @dynamic-labs/react-hooks, or a local alias like useDynamic from your client file) to read auth state:
React Native
import { useReactiveClient } from '@dynamic-labs/react-hooks';
import { dynamicClient } from '<path to client file>';
import { View, Text } from 'react-native';

const MyComponent = () => {
  const { auth } = useReactiveClient(dynamicClient);

  return (
    <View>
      <Text>
        {auth.token ? 'You are logged in!' : 'Please log in to continue.'}
      </Text>
    </View>
  );
};

export default MyComponent;