Edit Customer Profile in the Storefront
Update the logged-in customer's profile.
On this page
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 Getting started guide.
- This example uses the
useCustomerhook 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.
React
tsx
Copy
JS SDK
ts
Copy
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.