Documentation
Feedback
Guides
Storefront Development

Storefront Development
FastStore
Configuration options for discovery.config.js
The discovery.config.js is a configuration file for managing various settings that control store behavior, appearance, and functionality. It works as a central hub for configuring key aspects of a FastStore website, such as SEO, API connections, session management, URLs, analytics, and more.

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, please check 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).
PropertyTypeDescription
titlestringStore headline displayed in search results (60 chars recommended).
descriptionstringBrief description of the store (150-160 chars optimal).
titleTemplatestringDynamic page title pattern. Use %s as a placeholder (e.g., "%s | StoreName").
authorstringContent author/owner for attribution.

theme

Defines the look and feel of your FastStore project. This field is a string that specifies the name of the theme being used. Learn more in Theming.

platform

Describes the ecommerce platform being used, that is, vtex.

api

Contains settings related to the store's API.
PropertyTypeDescription
storeIdstringVTEX account being used.
workspacestringWorkspace being used.
environmentstringAPI environment (e.g., vtexcommercestable).
hideUnavailableItemsbooleanWhen true, hides products that are out of stock.
incrementAddressbooleanDetermines address handling behavior.

session

Defines the settings for the user session.
PropertyTypeDescription
currencyobjectCurrency information, including: code for ISO currency code (string, e.g., USD) and symbol for the currency symbol (string, e.g., $) .
localestringLanguage or locale setting (e.g., en-US).
channelstringTrade policy, region, and seller information for the sales process.
countrystringISO country code (e.g., US).
deliveryModestringOrder fulfillment method, including delivery channel, selected courier or method, and delivery window (start and end times).
addressTypestringType of address.
postalCodestringUser’s postal code (e.g., "10001").
geoCoordinatesfloat[]User’s location as [latitude, longitude] (e.g., [40.7128, -74.0060]).
personobjectShopper data, including: id (string) for unique customer ID, email (string) for registered email, firstName (string) for first name, and lastName (string) for last name.

cart

Contains the settings related to the shopping cart.
PropertyTypeDescription
idstringUnique identifier of the cart.
itemsarrayProducts added to the cart.
messagesstring[]System messages associated with the cart, such as shipping changes or any other relevant information.
shouldSplitItembooleanWhen true, allows cart items to be divided into separate shipments.

storeUrl

Defines the URL of the FastStore online store as a string.

secureSubdomain

Defines the secure subdomain URL for HTTPS connections as a string.

checkoutUrl

Defines the URL for the checkout process as a string.

loginUrl

Defines the URL for the login process as a string.

accountUrl

Defines the URL for the user's account section as a string.

previewRedirects

Maps redirect URLs for the following page types in preview mode.
PropertyTypeDescription
homestringRedirect URL for the homepage.
plpstringRedirect URL for product listing pages (PLP).
searchstringRedirect URL for search results pages.
pdpstringRedirect URL for product detail pages (PDP).

lighthouse

Includes settings for Lighthouse, a tool for auditing and improving the quality of web pages.
PropertyTypeDescription
serverstringThe server URL for running Lighthouse audits.
pagesobjectMaps the URL of pages to be audited by Lighthouse.
  ├─ homestringURL of the homepage.
  ├─ pdpstringURL of a product details page.
  └─ collectionstringURL of a collection page.
Learn more in Lighthouse Scores.

cypress

Contains settings for Cypress, a testing tool.
PropertyTypeDescription
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 details page.
  ├─ collectionstringURL of a collection page.
  ├─ collection_2stringURL of a secondary collection page.
  ├─ collection_filteredstringURL of a filtered collection page.
  └─ searchstringURL of a search results page.
Learn more in enableCypressExtension.

analytics

Defines the Google Tag Manager ID being used.
PropertyTypeDescription
gtmContainerIdstringThe Google Tag Manager container ID.
Learn more in Analytics.

experimental

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

account

Specifies the name of the account as a string.

vtexHeadlessCms

Contains settings for VTEX Headless CMS.
PropertyTypeDescription
webhookUrlsobjectAn object of strings that defines the webhook URLs used to interact with the Headless CMS.
Contributors
3
Photo of the contributor
Photo of the contributor
Photo of the contributor
Was this helpful?
Yes
No
Suggest Edits (GitHub)
Contributors
3
Photo of the contributor
Photo of the contributor
Photo of the contributor
On this page