Edit Customer Profile in Storefront
In this guide, you'll learn how to edit the customer's profile in the storefront, which is useful if you're adding a profile page to your storefront that allows the customer to view and edit their details.
To edit the customer's profile in the storefront, send a request to the Update Customer API route.
For example:
Tip:
- Learn how to install and configure the JS SDK in the JS SDK documentation.
- This example uses the
useCustomer
hook defined in the Customer Context guide. - Since only authenticated customers can edit their profile, this example assumes that the JS SDK is already configured for authentication and the customer's authentication token was set as explained in the Login in Storefront and Third-Party Login guides.
In the example above, you send a request to the Update Customer API route to update the customer's details.
The response of the request has a customer
field which is a customer object.
Was this page helpful?