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

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

  return user ? <p>Welcome, {user.name.first_name}</p> : <p>Log in to continue!</p>;
};
{
  "user": { ... },
  "isInitialized": true,
  "fromCache": false
}

Documentation Index

Fetch the complete documentation index at: https://stytch.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

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.