Home > @shopware-pwa/composables > IUseUser
# IUseUser interface
This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
interface for useUser() composable
Signature:
export interface IUseUser
# Properties
| Property | Type | Description |
|---|---|---|
| country | Ref<Country | null> | (BETA) |
| error | ComputedRef<any> | (BETA) |
| errors | UnwrapRef<{ [errorAlias: string]: ShopwareError[]; }> | (BETA) |
| isCustomerSession | ComputedRef<boolean> | (BETA) |
| isGuestSession | ComputedRef<boolean> | (BETA) |
| isLoggedIn | ComputedRef<boolean> | (BETA) |
| loadCountry | (countryId: string) => Promise<void> | (BETA) |
| loading | ComputedRef<boolean> | (BETA) |
| loadSalutation | (salutationId: string) => Promise<void> | (BETA) |
| login | ({ username, password, }: { username?: string; password?: string; }) => Promise<boolean> | (BETA) |
| logout | () => Promise<void> | (BETA) |
| onLogout | (fn: () => void) => void | (BETA) React on user logout |
| onUserLogin | (fn: (params: { customer: Customer; }) => void) => void | (BETA) |
| onUserRegister | (fn: () => void) => void | (BETA) |
| refreshUser | () => Promise<void> | (BETA) |
| register | ({}: CustomerRegistrationParams) => Promise<boolean> | (BETA) |
| salutation | Ref<Salutation | null> | (BETA) |
| setDefaultPaymentMethod | (paymentMethodId: string) => Promise<void> | (BETA) |
| updateEmail | (updateEmailData: CustomerUpdateEmailParam) => Promise<boolean> | (BETA) |
| updatePersonalInfo | (personals: CustomerUpdateProfileParam) => Promise<boolean> | (BETA) |
| user | ComputedRef<Partial<Customer> | null> | (BETA) |