useCustomerUpdateDetails
A customer hook that helps you easily update customer details such as name, firstName, email and wether a customer accepts marketing materials or not.
// import
import { useCustomerUpdateDetails } from '@backpackjs/storefront';
// instantiation
const { customerUpdateDetails, ...updateStatus } = useCustomerUpdateDetails();
// use
const updatedCustomer = await customerUpdateDetails({
firstName,
lastName,
email,
acceptsMarketing
});firstName
the customers first name
lastName
the customer last name
email
the customer email address
acceptsMarketing
true || false
Last updated