useCurrentUser
The useCurrentUser hook fetches the Shop app user's profile information including display name and avatar image URL. Use this for personalizing the UI, displaying user info in headers/profiles, or conditionally showing features based on authentication status.
Caution
This hook requires adding the following scopes to the manifest file:
user_settings:read
For more details, see manifest.json.
Caution:
This hook requires adding the following scopes to the manifest file:
user_settings:read
For more details, see manifest.json.
Anchor to useCurrentUser-parametersParameters
- Anchor to paramsparamsparamsUseCurrentUserParamsUseCurrentUserParams
UseCurrentUserReturnsUseCurrentUserReturns
UseCurrentUserParams
- fetchPolicy
DataHookFetchPolicy - skip
boolean
DataHookFetchPolicy
'cache-first' | 'network-only'UseCurrentUserReturns
- currentUser
The current user logged into Shop.
UserProfile | null - error
Error | null - loading
boolean - refetch
() => Promise<void>
UserProfile
- avatarImage
{ url: string } | null - displayName
string | null
Was this page helpful?