Docs
Reference
Functions
useAccount

useAccount

The useAccount hook is a React hook to manage user login, signup and logout.

Usage

The useAccount hook provides utilities to simplify login, signup and logout.

const {login, signup, verify, logout, resetPassword, captchaRef} = useAccount()

Parameters

No parameters

Return Values

NameTypeDescription
loginfunctionSee below
signupfunctionSee below
verifyfunctionSee below
logoutfunctionSee below
resetPasswordfunctionA function to set the quantity of the specified product variant to a specific value.
captchaRefReact RefA function to set the quantity of the specified product variant to a specific value.

login

Parameters

login function accepts an object with the following properties

NameTypeDescription
usernamestringLogin username, usually an email.
passwordstringLogin password

Returns

Promise

signup

Parameters

signup function accepts an object with the following properties

NameTypeDescription
firstNamestringFirst name of the user
lastNamestringLast name of the user
usernamestringLogin username, usually an email.
passwordstringLogin password

Returns

Promise

logout

Parameters

No parameters

Returns

Promise