User
The User API lets you asynchronously retrieve information about the currently logged-in user.
The API returns a Promise
, which contains user information, and the payload varies based on whether the user is logged into the Shopify admin or Shopify POS.
Anchor to Admin UserAdmin User()
The user
API, which is available on the shopify
global, asynchronously retrieves information about the user that's logged into the Shopify admin.
Anchor to Admin User-returnsReturns
AdminUserAPI
Asynchronously returns information about the current user.
Promise<AdminUser>
() => Promise<AdminUser>
AdminUser
- accountAccess
The account access level of the logged-in user
string
export interface AdminUser {
/**
* The account access level of the logged-in user
*/
accountAccess?: string;
}
Anchor to POS UserPOS User()
The user
API, which is available on the shopify
global, asynchronously retrieves information about the current user logged into Shopify POS.
Anchor to POS User-returnsReturns
POSUserAPI
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 ID of the user's staff.
number
- lastName
The user's last name.
string
export interface POSUser {
/**
* The ID of the user's staff.
*/
id?: number;
/**
* The user's first name.
*/
firstName?: string;
/**
* The user's last name.
*/
lastName?: string;
/**
* The user's email address.
*/
email?: string;
/**
* The account access level of the logged-in user
*/
accountAccess?: string;
/**
* The user's account type.
*/
accountType?: string;
}
User
examples
User
await shopify.user();