Documentation
Feedback
Guides
Storefront Development

Storefront Development
Storefront development

Configuration options for discovery.config.js

The discovery.config.js is a configuration file for managing settings that control store behavior, appearance, and functionality. This file serves as a central hub for configuring key aspects of your FastStore website, including SEO, API connections, session management, analytics, and more.
This guide outlines the configuration options for tailoring your FastStore website using the discovery.config.js file.

Example file


_17
module.exports = {
_17
seo: {
_17
title: "FastStore Starter",
_17
description: "Fast Demo Store",
_17
titleTemplate: "%s | FastStore",
_17
author: "FastStore",
_17
},
_17
theme: "custom-theme",
_17
platform: "vtex",
_17
api: {
_17
storeId: "storeframework",
_17
workspace: "master",
_17
environment: "vtexcommercestable",
_17
hideUnavailableItems: false,
_17
incrementAddress: false,
_17
},
_17
};

Check the full file example at discovery.config.js sample code.
As of December 16, 2024, discovery.config.js is the new filename for the legacy faststore.config.js file. If you're still using the legacy name, see this release note to update it.

Configuration options

Below is a description of each setting you can configure in the discovery.config.js file:

seo

Sets default metadata related to Search Engine Optimization (SEO), influencing how your store appears in search results. Learn more in SEO.
PropertyTypeDescriptionExample
titlestringStore headline displayed in search results (60 characters recommended)."FastStore Starter"
descriptionstringBrief description of the store (150-160 characters optimal)."FastStore Demo Store"
titleTemplatestringDynamic page title pattern. Use %s as a placeholder."%s | FastStore"
authorstringContent author/owner for attribution."FastStore"

theme

Defines the visual identity of your FastStore project, including color schemes, typography, and layout presets. This field is a string that specifies the name of the theme being used.
Every FastStore project starts with the Brandless theme by default. However, you can choose from available themes or develop a custom theme. Learn more in Themes - Overview.

platform

Defines the ecommerce platform being used. You must set vtex as a value to enable VTEX-specific features.
Only vtex is a valid value. Any other value will cause errors.

api

Contains settings related to the store's APIs, which link your FastStore storefront to backend services and manage environment-specific behavior.
PropertyTypeDescriptionExample
storeIdstringVTEX account being used."mystore"
workspacestringWorkspace being used. Use master for the production environment, and other names for staging."master"
environmentstringAPI environment."vtexcommercestable"
hideUnavailableItemsbooleanControls product display. When true, hides out-of-stock products. Default value is false.false
incrementAddressbooleanEnables automatic completion of address details during checkout using VTEX’s address API. When true, missing address fields (such as city, state, street, etc.) are automatically filled based on the provided postal code. Default value is false.false

session

Sets up user session defaults, controlling language, currency, location, and shopper attributes.
PropertyTypeDescriptionExample
currencyobjectStore’s transactional currency for prices, payment, and checkout.
  ├─ codestringISO currency code"USD"
  └─ symbolstringCurrency symbol"$"
localestringLanguage or locale setting for all store text, dates, and numbers. Use standard locale format like en-US for English (US), pt-BR for Brazilian Portuguese, etc."en-US"
channelobjectIdentifies the commercial and regional context for handling catalog, pricing, and logistics.
  ├─ salesChannelstringTrade policy that handles catalog, prices, and fulfillment options (example: different regions or seller-specific rules)."1"
  └─ regionIdstringInternal identifier used to define regional segmentation based on the user’s location for services such as catalog, shipping, pickup, and other logistics-related processes.
countrystringISO country code for the current shopper’s session. This field informs VTEX services which country’s regulations, delivery logistics, and tax rules must be applied."US"
deliveryModestringOrder fulfillment method, including delivery channel, selected courier or method, delivery window (start and end times), or pickup point."delivery"
addressTypestringAddress format for fulfillment"residential"
postalCodestringUser’s postal code"10001"
geoCoordinatesfloat[]User’s location as [latitude, longitude][40.7128, -74.0060]
personobjectShopper identity attributes.
  ├─ idstringUnique VTEX customer ID. VTEX Identity service may auto-populate these fields after sign-in."12345"
  ├─ emailstringCustomer’s email address"user@email.com"
  ├─ firstNamestringCustomer’s first name."Alex"
  └─ lastNamestringCustomer’s last name."Smith"

cart

Contains the settings to manage the shopping cart’s contents and behavior.
PropertyTypeDescriptionExample
idstringUnique identifier of the cart."cart-abc-123"
itemsarrayProducts added to the cart.[{"sku": "5678", "quantity": 2}]
messagesstring[]System messages associated with the cart, such as shipping changes or other relevant information.["Shipping updated"]
shouldSplitItembooleanIf true, allows cart items from multiple sellers or differing stock locations to be shipped separately.true

storeUrl

Defines the primary store domain as a string. Example: https://www.mystore.com.

secureSubdomain

Defines the HTTPS-enabled subdomain, if used, as a string. Example: https://secure.mystore.com.

checkoutUrl

Defines the URL for the checkout process as a string. Example: https://www.mystore.com/checkout.

loginUrl

Defines the URL for the login process as a string. Example: https://www.mystore.com/login.

accountUrl

Defines the URL for the customer's account management page as a string. Example: https://www.mystore.com/account.

previewRedirects

Maps redirect URLs for the following page types in preview mode.
PropertyTypeDescriptionExample
homestringRedirect URL for the homepage."https://preview.mystore.com"
plpstringRedirect URL for product listing pages (PLP)."https://preview.mystore.com/category"
searchstringRedirect URL for search results pages."https://preview.mystore.com/search"
pdpstringRedirect URL for product detail pages (PDP)."https://preview.mystore.com/product"

lighthouse

Includes settings for Lighthouse, a tool for auditing and improving the quality of web pages.
PropertyTypeDescriptionExample
serverstringThe server URL for running Lighthouse audits.process.env.BASE_SITE_URL | 'http://localhost:3000'
pagesobjectMaps the URL of pages to be audited by Lighthouse.
  ├─ homestringURL of the homepage.'/'
  ├─ pdpstringURL of a product detail page."/headphone-white-10000006/p"
  └─ collectionstringURL of a collection page."/headphones"
Learn more in Lighthouse Scores.

cypress

Defines which pages Cypress should visit in end-to-end tests, ensuring predictable routes for the CI pipeline. Prefer relative URLs (for example, "/", /headphones) and deterministic scenarios with consistent data across runs.
PropertyTypeDescriptionExample
pagesobjectMaps the URLs of pages for end-to-end testing with Cypress, with each field defined as a string.
  ├─ homestringURL of the homepage."/"
  ├─ pdpstringURL of the product detail page."/headphone-white-10000006/p"
  ├─ collectionstringURL of a collection page."/headphones"
  ├─ collection_2stringURL of a secondary collection page."/audio"
  ├─ collection_filteredstringURL of a filtered collection page."/headphones?priceRange=100-200"
  └─ searchstringURL of a search results page."/s?q=headphone"
Learn more in enableCypressExtension.

analytics

Defines the Google Tag Manager ID used by the site to collect events and trigger tags, allowing you to measure interactions, funnels, and conversions.
PropertyTypeDescriptionExample
gtmContainerIdstringThe Google Tag Manager container ID."GTM-1234567"
Learn more in Analytics.

experimental

Contains settings for experimental features.
PropertyTypeDescriptionExample
nodeVersionstringThe Node.js version."20"
cypressVersionstringThe Cypress version."13"
graphqlCacheControlobjectSettings for GraphQL responses.
  ├─ maxAgenumberMaximum time (in seconds) that the response can be cached.300
  └─ staleWhileRevalidatenumberTime (in seconds) during which stale responses can be served while revalidating.60

account

Specifies the VTEX account name used by the project as a string. Example: mystore.

vtexHeadlessCms

Configures webhook endpoints for VTEX Headless CMS to trigger publishing, cache invalidation, or content preview whenever changes occur in the CMS.
PropertyTypeDescriptionExample
webhookUrlsarray of stringsAn array of strings that defines the webhook URLs used to interact with the Headless CMS.["https://mystore.myvtex.com/cms-releases/webhook-releases"]
Contributors
2
Photo of the contributor
Photo of the contributor
Was this helpful?
Yes
No
Suggest Edits (GitHub)
Contributors
2
Photo of the contributor
Photo of the contributor
Was this helpful?
Suggest edits (GitHub)
On this page