Enabling My Account
Learn how to enable the experimental My Account feature in your B2B FastStore store.
This is an experimental feature only available for B2B stores. B2C stores should continue using the previous version.
In this guide, you'll learn how to enable the experimental My Account feature in your B2B FastStore store. By the end of this guide, you will have configured your store to use the new My Account experience, allowing your customers to manage their accounts directly within FastStore.
My Account is a crucial component for any ecommerce website, as it allows customers to manage their personal information, track order history, update security settings, and perform other account-related actions.
Unlike the previous version of My Account, which was based on the VTEX IO platform and accessed through a subdomain configured in thediscovery.config.js
file, the new version uses a FastStore-based setup that allows you to enable and manage My Account directly within FastStore. This feature is available only for B2B stores. B2C stores should continue using the previous version, Integrating VTEX Order Placed and My Account. While this article discusses the Order Placed page, the experimental feature covered in this guide is solely related to the My Account section.
Default My Account pages
My Account includes several default pages that are essential for managing a customer's account.
Page path | Description |
---|---|
src/pages/pvt/account/orders/[id].tsx | Displays individual order details, including items, quantities, prices, and statuses. |
src/pages/pvt/account/user-details.tsx | Displays the user’s personal information, such as name, email, and contact details. |
src/pages/pvt/account/security.tsx | Displays security settings, including password management. |
src/pages/pvt/account/profile.tsx | Displays editable profile settings, allowing users to update personal information. |
src/pages/pvt/account/orders/index.tsx | Displays a list of all past and current orders placed by the user, including summary details for each. |
Before you begin
Make sure you're using the latest version of
@faststore/cli
. If the version is not updated, see Updating the @faststore/cli
package version.Instructions
To enable the experimental My Account feature in your project, follow the steps below:
-
Open the
discovery.config.js
file. -
In the
experimental
object, set theenableFaststoreMyAccount
value totrue
: -
Commit and push your changes to the main branch to deploy the changes to production.
With the
enableFaststoreMyAccount
flag set to true
, users accessing the /pvt/account
path will be redirected to the /pvt/account/profile
page.TheenableFaststoreMyAccount
flag overrides the URL specified in theaccountUrl
property of thediscovery.config.js
file. If the flag isn't set or is set tofalse
, users will be redirected to the URL configured in theaccountUrl
property.
Now that the experimental My Account feature is enabled in your project, you can extend this feature by following the guide Extending My Account.