A FastStore B2B template — a monorepo with the official starter.store
discovery base plus the
@vtex/faststore-plugin-buyer-portal
plugin, the VTEX B2B guideline configuration, and a FastCheckout module,
pre-wired in.
Built from ticket B2BTEAM-3645. Status: beta / partial validation — see Known limitations below.
- Monorepo layout (Turborepo):
packages/discovery(storefront) +packages/checkout(FastCheckout customizations), wired together viafaststore.json. @faststore/cli^4.4.0,@vtex/faststore-plugin-buyer-portal^2.0.9inpackages/discovery.discovery.config.jswith the plugin registered and B2B-oriented defaults (hideUnavailableItems: true,enableFaststoreMyAccount: true).- FastCheckout scaffolded in
packages/checkout(via@vtex/checkout'sdefineExtensions) with no example/demo extension — add your own customizations there. - Root
package.jsonhas thenohoistworkaround already applied for@vtex/faststore-plugin-buyer-portal, required for this monorepo layout. - Cypress test scripts wired to the plugin's own test suite (
yarn test-plugininsidepackages/discovery).
- No CMS content (
cms/folder), no customsrc/overrides beyond the framework defaults (themes/,fonts/) inpackages/discovery— add your store's own sections, components, and theme tokens there perpackages/discovery/AGENTS.md. - No example FastCheckout extensions —
packages/checkout/src/index.tsxships with an emptydefineExtensions({}).
- Replace every
{ACCOUNT_NAME}placeholder with your target VTEX account name:packages/discovery/discovery.config.js—api.storeId,storeUrl,secureSubdomain,checkoutUrl,loginUrl,accountUrl, andvtexHeadlessCms.webhookUrls(this last one uses the account's.myvtex.comdomain, NOT the storefront domain).faststore.json(repo root) — the top-levelstoreskey.
- Install dependencies from the repo root:
yarn install - Run locally (both discovery and checkout, via Turborepo):
yarn dev- Discovery: http://localhost:3001
- Checkout: http://localhost:3002
- Production build:
yarn build
Each package can also be run individually from inside
packages/discovery or packages/checkout using their own yarn dev /
yarn build scripts.
vtex.profile-sessionvtex.authentication-sessionvtex.shopper-sessionvtex.search-sessionvtex.buyer-portal-graphqlvtex.contracts-managementvtex.reviews-and-ratingsvtex.safedatavtex.collections-agentvtex.login(orvtex.login-alternative-keyfor the new B2B Login UI)
| Feature Flag | Owning team | Slack channel |
|---|---|---|
| emailRectification / allow-email-rectification / enableProfileIdentificationByLoggedInUserId | Storage / Payments / Checkout | #team-dev-storage, #team-dev-payments, #team-dev-checkout |
| useUnitsForExtraclaims | Identity | #team-dev-identity |
| enableStorefrontPermissions | Identity | #team-dev-identity |
| useIdentifier / useCustomerId | Identity | #team-dev-identity |
| SIGN_IN_TO_ACCESS | Checkout Experience | #team-dev-checkout |
| Multi delivery | Checkout Experience | #team-dev-checkout |
| useNewContactInfoBehavior | Checkout | #team-dev-checkout |
| allowOrderFormCustomFields | Checkout | #team-dev-checkout |
| Refresh Token → 10 min | Identity | #team-dev-identity |
Important: once enableStorefrontPermissions is active, every user
(including AppKeys) must belong to an Organization Unit and hold at least the
4-Buyer and 9-Address Manager roles (add 5-Personal Cards User if
personal card entry is needed). After enabling the Identity flags, open
/admin/authentication and save (no changes needed) to persist login
behavior.
- VTEX account creation, subdomain (
#traffic) and License Manager setup - Domain migration (
#request-domains-migration), cache policies (#traffic) - CDN / unified domain (contact: Gabriel Paladino)
- VTEX Intelligent Search indexing (prerequisite for Buyer Portal, configured after the store is running)
- Card tokenization (
allow-card-tokenization-by-account,allow-tokenization-deploy) - FastCheckout is scaffolded in this template, but it is only supported in
the US region today (VTEX Commercial Policy) — accounts outside that
region can leave
packages/checkoutunused/unconfigured; the monorepo structure itself doesn't require FastCheckout to be active. - Masterdata: the
addressTypefield must be searchable/indexable on theADtable - Contract Management admin permissions (View/Edit Contracts)
This template was migrated from a single-package starter.store layout to a
monorepo using the official @vtex/fsp-cli tooling
(fsp init --from-discovery to create packages/discovery, then
fsp create {ACCOUNT_NAME} checkout packages/checkout to add the FastCheckout
module). Root-level files:
faststore.json— maps each package (discovery,checkout) to its path and local dev port, keyed by{ACCOUNT_NAME}.turbo.json— Turborepo pipeline (build,dev).package.json— workspaces + thenohoistentry for@vtex/faststore-plugin-buyer-portal(required so the plugin isn't hoisted in a way that breaks its own resolution — this is a known FastStore monorepo workaround, remove it once FastStore supports this scenario natively).
Caveat found during migration: fsp init --from-discovery reads the
locally logged-in VTEX account (via VTEX Toolbelt) and may silently replace
the {ACCOUNT_NAME} placeholder with that real account name in
discovery.config.js and faststore.json instead of preserving the
placeholder. If you re-run this migration yourself, verify both files still
say {ACCOUNT_NAME} afterward — don't assume the placeholder survived.
Dependency conflicts found and fixed while adding FastCheckout to the same
workspace (all in root package.json, needed for yarn build/yarn dev to
work at all — independent of the {ACCOUNT_NAME} placeholder issue below):
**/@vtex/checkout-ui-coreand**/@vtex/checkout-ui-core/**were added tonohoist. Without this, yarn hoists@vtex/checkout-ui-core's bundled Next.js 14 to the workspace rootnode_modules/.bin/next, shadowing the Next.js 16 that@faststore/cli/@faststore/corerequire — the build then fails immediately withnext build: error: unknown option '--webpack'(a flag that only exists on the newer Next.js version).resolutions.autoprefixeris pinned to^10.4.0.@faststore/coreneedsautoprefixer ^10, but a transitive dependency of@vtex/sales-app(draftjs-to-html) needs^9— the version conflict means yarn can't hoist either copy to root, so Next.js's CSS pipeline fails withCannot find module 'autoprefixer'.autoprefixeris also added as an explicit rootdevDependency— theresolutionspin alone was not enough to get yarn to hoist a copy to the rootnode_modules, an explicit top-level dependency was required.resolutions.react/resolutions.react-domare pinned to^18.3.1(matching what@vtex/sales-appneeds) and apostinstallscript removespackages/discovery/node_modules/reactandreact-domafter every install. Even with matching resolved versions, yarn classic still installed a second physical copy of React nested underpackages/discovery, and having two React instances in the same render tree causes crypticTypeError: Cannot read properties of null (reading 'useEffect')crashes during Next.js static prerendering (Node's module resolution walks up directories, so removing the nested copy makes it resolve to the single deduped copy at the workspace root instead).
- Version drift vs. internal guideline v1.4: the guideline documents
@vtex/faststore-plugin-buyer-portal ^1.1.3,@faststore/cli ^3.51.0,experimental.nodeVersion: 20, andexperimental.refreshToken: true. This template uses the latest published versions instead (buyer-portal ^2.0.9,cli ^4.4.0,nodeVersion: 24,refreshToken: false), matching what theb2bfaststoredev.storereference account currently runs.refreshTokenwas not re-verified against the Identity team's current guidance — confirm before relying on it. contentSource.type: "CP"is the current official scaffold default; its interaction with the legacy VTEX Headless CMS webhook flow (vtexHeadlessCms.webhookUrls) has not been validated end-to-end.- Not validated against a live VTEX B2B account —
yarn buildcurrently fails in the default state: TypeScript and webpack compile successfully, and most pages statically generate, but prerendering one of the account-dependent pages (observed on/checkout,/404, or/500depending on build-worker scheduling) fails with HTTP 400 because the{ACCOUNT_NAME}placeholder cannot resolve a real backend. Replacing this placeholder with a provisioned VTEX account (per Setup above) is expected to resolve this. The failure does not confirm whether Buyer Portal or FastCheckout behave correctly against a real account — that requires the prerequisites above. - FastCheckout module is unvalidated against a real account — it was
scaffolded via the official
fsp createcommand with no example extension; end-to-end behavior against a provisioned VTEX account has not been tested. - Never commit
secrets.hidden.json/secrets.revealed.json(insidepackages/discovery) — both are excluded in that package's.gitignore. A sibling reference repo currently hassecrets.hidden.jsontracked in git; do not repeat that mistake here.
- FastStore documentation
- Ticket: B2BTEAM-3645