User API
The User API retrieves information about the currently logged-in user, such as their name, email, and account access level. The response shape depends on the platform: admin users and POS users return different sets of properties.
Anchor to Use casesUse cases
- User personalization: Personalize the app experience based on the logged-in user's name and role.
- Staff identification: Identify which staff member is using the app for audit logging or permissions.
- POS user context: Access POS-specific user data like assigned location when running on Shopify POS.
- Account details: Retrieve the current user's email and account type for display or communication.
Anchor to AdminUserAPIAdmin User API()
Admin User API()
When the user is logged into the Shopify admin, shopify.user() returns the user's account access level.
Promise<AdminUser>Promise<AdminUser>
AdminUser
- accountAccess
The account access level of the logged-in user.
string
Anchor to POSUserAPIPOSUser API()
POSUser API()
When the user is logged into Shopify POS, shopify.user() returns the user's ID, first and last name, email, account access level, and account type.
Anchor to POSUserAPI-returnsReturns
Promise<POSUser>Promise<POSUser>
POSUser
- accountAccess
The account access level of the logged-in user.
string - accountType
The user's account type.
string - email
The user's email address.
string - firstName
The user's first name.
string - id
The staff member's numeric ID.
number - lastName
The user's last name.
string
Was this page helpful?