Skip to content

Engine: Config

The configuration contract between a shop and the engine: the MagenxConfig types that magenx.config.ts fills in, and EngineConfigProvider / useEngineConfig, which hand it to engine code. Engine code never imports a config file.

Generated from packages/engine/src/config/: 2 files, 26 exported symbols. Signatures and types are shown as written in the source.

@magenxcommerce/engine/config/context

packages/engine/src/config/context.tsxclient

EngineConfigProvider + useEngineConfig

Exposes the engine configuration (Magento connection, feature flags, CMS block identifiers, navigation labels, payment provider) to all client components via React context.

Usage — root layout (server component): import engineConfig from "../../engine.config"; <EngineConfigProvider config={engineConfig}>…</EngineConfigProvider>

Usage — any client component: const { store, features, cms, navigation, payment } = useEngineConfig();

EngineConfigProvider function

EngineConfigProvider({ config, children, }: { config: EngineConfig; children: ReactNode; })

useEngineConfig function

useEngineConfig(): EngineConfig

@magenxcommerce/engine/config/types

packages/engine/src/config/types.ts

Engine configuration type.

Imported from this file so that consuming packages can reference the type without depending on the storefront's root config file. Shops pass a value that satisfies this interface to <EngineConfigProvider>.

StoreConfig interface

MemberTypeDescription
storeCodestringStore-view code used when a caller has no locale of its own — the default entry of stores. "" means "send no Store header" (Magento then answers in its own default store view).
baseUrlstring
currencystringISO 4217 currency of the default store view. Fallback only: prices carry their own currency, and each store view's comes from Magento's default_display_currency_code.
catalogPageSizenumber
searchPageSizenumber
searchSuggestionsPageSizenumber
searchMinLengthnumber
sortOptionsReadonlyArray<{ readonly value: string; readonly label: string }>

ProductPriceDisplay type

type ProductPriceDisplay = "including" | "excluding" | "none"

How catalog / product prices are labelled with respect to tax.

NB: Magento's GraphQL price_range returns a single value already computed for the admin setting; it does NOT expose both the tax-inclusive and tax-exclusive amounts, so only the accompanying note differs. The note text is localized per store-view via the Product.priceTaxIncluded / Product.priceTaxExcluded next-intl messages.

TaxConfig interface

MemberTypeDescription
productPriceDisplayProductPriceDisplayMirror your Magento admin setting at Stores → Configuration → Sales → Tax → Price Display Settings → "Display Product Prices In Catalog": "including" → prices include tax → cart/checkout show tax-inclusive line totals & subtotal, tax rendered as an "incl." note. "excluding" → prices exclude tax → tax added as a separate line. "none" → no tax note rendered (treated like "excluding" for totals).

AnalyticsConfig interface

Web analytics configuration. We load Google Tag Manager as the container (configure GA4 and any other tags inside the GTM web UI) and push GA4 ecommerce events to its dataLayer. Tracking is gated by Google Consent Mode v2, wired to the cookie-consent banner's analytics category.

MemberTypeDescription
gtmContainerIdstringGoogle Tag Manager container ID, e.g. "GTM-XXXXXXX". Empty string disables analytics entirely (the loader and all dataLayer pushes become no-ops), so it is safe to ship before a container exists.

MapsConfig interface

Third-party map integration used by the Contact-page store locator (and any other map surface). The store addresses themselves come from Magento (storePickupLocations); this only carries the embed credentials.

MemberTypeDescription
googleMapsApiKeystringGoogle Maps Embed API key. Empty string disables the embedded map (the store locator then renders the address list + "Open in Google Maps" links only), so it is safe to ship before a key exists. Must be a NEXT_PUBLIC_ var since the embed is rendered in the browser.

FeaturesConfig interface

MemberTypeDescription
wishlistboolean
reviewsEnabledboolean
relatedProductsboolean
crossSellsboolean
recentlyViewedboolean
breadcrumbsboolean
blogbooleanEnable the blog module integration (blog page, post detail, related posts).
checkoutFields?booleanOrder comment and delivery date at checkout (Magenx_CheckoutFieldsGraphQl). Requires the module on the backend; which fields appear is then decided by its admin settings. Off (or absent) means the storefront never queries it.
freeShipping?booleanFree-shipping progress on the product page and cart (Magenx_FreeShippingGraphQl). The threshold, the amount still to go and whether the cart qualifies all come from Magento's Free Shipping carrier settings, so the promise matches the rates charged at checkout. Off (or absent) means the storefront never queries the module and shows no progress indicator.
vatValidation?booleanVAT number on registration, account details and the checkout address forms, the account's business status, and the VAT treatment (reverse charge) on the review step (Magenx_VatValidationGraphQl). Requires the module on the backend, switched on there per website; which countries offer the field also comes from its settings. Off (or absent) means the storefront never queries the module.

CmsConfig interface

MemberTypeDescription
homepageBlockIdentifiersReadonlyArray<string>
headerInfoBarBlockIdentifierstring
announcementBarBlockIdentifierstring
homepageCategoryUrlKeysReadonlyArray<string>
contactInfoBlockIdentifierstring
newsletterContentBlockIdentifierstring
categoryPromoBlockIdentifiersReadonlyArray<string>
brandBlockIdentifierPrefixstringPrefix for the per-brand hero CMS block identifier looked up on /search when the query exactly matches a manufacturer brand title, e.g. prefix "brand_" + brand "Asus" → block identifier brand_asus.
homepageBlogCategoryIdstringBlog category ID whose posts are shown in the homepage blog section (4 posts before the footer). Set to an empty string to fetch the latest posts across all categories instead.

NavLinkConfig interface

A single navigation link entry used in header and footer navigation. Links with a cms_block identifier render a CMS-block-backed page at the given link path. Links without cms_block point to a built-in route (e.g. /blog, /contact).

MemberTypeDescription
titlestringDisplay label shown in the nav
linkstringURL path segment without leading slash, e.g. "deals" or "privacy-policy"
cms_block?stringMagento CMS block identifier rendered on the linked page

NavigationConfig interface

MemberTypeDescription
headerMenuButtonNamestring
headerLinksNavLinkConfig[]Links rendered in the header nav bar and mobile menu drawer
footerLinksNavLinkConfig[]Links rendered in the footer bottom bar

PaymentConfig interface

Checkout renders whatever Magento returns in cart.available_payment_methods, so enabling a method is an admin task, not a storefront one. Stripe is the only gateway with bespoke on-site code (Elements + 3DS); PayPal Express and Mollie leave the storefront for a hosted page and come back. All are keyed off the method code at runtime. The flags below exist because those providers' documents select fields only their Magento module defines, and Magento rejects a whole document over one unknown field — so the storefront must know not to issue them on a store without the module.

MemberTypeDescription
stripe{ /** * Whether the Magento Stripe module is installed. False stops the * storefront issuing `getStripeConfiguration`, which would otherwise fail * schema validation on a store without the module. */ enabled: boolean; }
mollie{ /** * Whether Mollie Payments for Magento 2 (`mollie/magento2`) is installed. * False stops the storefront issuing any Mollie document (issuer lookup, * `placeOrder` with `mollie_return_url`, `mollieProcessTransaction`), which * would fail schema validation on a store without the module, and keeps * the Mollie checkout code out of the page entirely (it is a lazy chunk). * It does NOT enable or disable any method — Magento admin owns that. */ enabled: boolean; /** * Card details entered on the checkout page itself (Mollie Components, * js.mollie.com) for `mollie_methods_creditcard`, instead of on Mollie's * hosted card page. Needs a Mollie profile ID configured in Magento; with * none, card entry falls back to the hosted page on its own. */ components: boolean; }

SeoBehaviorConfig interface

Behavioural / deployment-level SEO concerns (robots, verification tokens, referrer policy, manifest path). Brand identity SEO (authors, og image, application name) lives in SeoBrandConfig.

MemberTypeDescription
referrerstring
formatDetection{ email: boolean; address: boolean; telephone: boolean }
manifeststring
verification{ google: string }
robots{ index: boolean; follow: boolean; nocache: boolean; googleBot: { index: boolean; follow: boolean; noimageindex: boolean; "max-video-preview": number; "max-image-preview": "none" | "standard" | "large"; "max-snippet": number; }; }

SeoBrandConfig interface

Brand identity layer for SEO: authorship, publisher, default OG image, baseline keywords. Behavioural concerns live in SeoBehaviorConfig.

MemberTypeDescription
applicationNamestring
siteNamestring
creatorstring
publisherstring
authors{ name: string; url?: string }[]
defaultKeywordsstring[]
ogImage{ url: string; width: number; height: number; alt: string; }

StoreEntry interface

One entry per Magento store-view exposed by the storefront. The locale string is the URL segment (e.g. /en/, /de/, /fr/) and also drives next-intl routing. storeCode is the Magento store-view code forwarded in the Store GraphQL header. Mark exactly one entry as the default for the locale router and Apollo fallback.

MemberTypeDescription
storeCodestring
localestring
default?boolean
storeName?stringMagento store name — the language switcher's label.
currency?stringISO 4217 display currency of this store view.

ShippingConfig interface

Shipping & returns messaging shown on the product page (the <ProductShippingInfo> panel below add-to-cart). These are display copy — mirror them to your Magento shipping configuration; they do not drive the actual rates charged at checkout. The free-shipping threshold is not here: it is read from Magento (see FeaturesConfig.freeShipping).

MemberTypeDescription
deliveryEstimatestringHuman-readable delivery window, e.g. "5 - 7 working days". Empty string hides the delivery line.
returnDaysnumberReturn window in days shown as "N Days return policy". 0 hides the line.

AssistantSettings interface

Shopper AI assistant (@magenxcommerce/engine/assistant/*). Optional; omit or set enabled: false to hide the widget and 404 the route. The API key and the session-sealing key are never configured here: they are read from the server environment (ANTHROPIC_API_KEY, ASSISTANT_SEAL_KEY).

MemberTypeDescription
enabledboolean
modelstringClaude model id, e.g. "claude-haiku-5-5".
effort?"low" | "medium" | "high"Reasoning effort. Default "low": the assistant's work is routine lookups.
persona?{ name?: string; tone?: string }Name and tone the assistant uses when talking to shoppers.
policies?{ shipping?: string; returns?: string; contact?: string; other?: string }Short store policy texts the assistant may quote (shipping, returns, contact). Part of the cached system prompt, so keep them brief and static.
instructions?stringShop-specific notes for the assistant: opening hours, phone number, extra policies, things to say or avoid. Added to the system prompt (cut at 2,000 characters); the assistant's own rules take priority over them.
pages?ReadonlyArray<string>Storefront pages the assistant may link to, besides the built-in ones (contact, guest order, cart, checkout, account pages). Paths without the locale prefix, each with an optional note on what it is for, e.g. "/deals (current offers and discounted products)". Part of the cached system prompt: at most 20 entries of 200 characters are used.
disabledTools?ReadonlyArray<string>Tool names to withhold from the model. Unknown names fail start-up.
limits?Partial<AssistantLimits>Override individual limits; the rest keep their defaults.

AssistantLimits interface

Hard per-turn and per-conversation budgets.

MemberTypeDescription
maxStepsnumberModel calls per shopper message.
maxToolCallsnumberTool calls per shopper message.
maxMessageCharsnumberCharacters accepted in one shopper message.
turnTimeoutMsnumberWall-clock budget for one shopper message, in milliseconds.
maxHistoryMessagesnumberShopper messages kept in the conversation history before it is summarised (tool results and context notes do not count).
maxConversationTokensnumberTotal input + output tokens one conversation may spend.
maxGuestLookupsnumberGuest order lookups one conversation may attempt (enumeration guard).
messagesPerMinutenumberShopper messages per client per minute.
maxOutputTokensnumberOutput tokens per model call.

EngineConfig interface

MemberTypeDescription
storeStoreConfig
storesReadonlyArray<StoreEntry>Magento store-views available to this storefront (one per locale).
taxTaxConfig
shipping?ShippingConfigShipping & returns messaging for the product page. Optional; omit to hide the panel.
analytics?AnalyticsConfigWeb analytics (GTM container + GA4 ecommerce). Optional; omit to disable.
maps?MapsConfigMap embed credentials (Contact-page store locator). Optional; omit to disable.
featuresFeaturesConfig
cmsCmsConfig
navigationNavigationConfig
paymentPaymentConfig
seoBehaviorSeoBehaviorConfig
assistant?AssistantSettingsShopper AI assistant. Optional; omit to disable.

BrandConfig interface

MemberTypeDescription
namestring
taglinestring
logoSrcstring
iconsMetadata["icons"]
manifestIconsMetadataRoute.Manifest["icons"]
socialLinks?ReadonlyArray<BrandSocialLink>

LayoutConfig interface

Layout values consumed by TypeScript.

Purely visual tokens (colors, type scale, spacing, radii, shadows, container widths, header height) are NOT modelled here: they live as CSS custom properties in src/app/globals.css and are consumed through Tailwind's @theme mapping. Keeping a second, parallel copy in TypeScript produced four config blocks with zero readers whose values had already drifted out of sync with the CSS (e.g. radii.md vs --radius). Only values that real TS code reads belong in this interface.

MemberTypeDescription
productGridColumns2 | 3 | 4 | 5Product grid columns at the widest breakpoint. Narrower breakpoints step down through the theme's PRODUCT_GRID_COL_CLASSES (src/lib/product-grid-columns.ts), which keys on this value.

ProductGridSort type

type ProductGridSort = | "position" | "newest" | "price_asc" | "price_desc" | "name_asc"

HomepageProductGridConfig interface

MemberTypeDescription
idstring
sectionLabelstring
titlestring
categoryUrlKeysstring[]
pageSizenumber
sortProductGridSort
newOnlyboolean

HomeTrustBadgeConfig interface

MemberTypeDescription
idstring
valuestring
labelstring
descriptionstring

MagenxConfig interface

Unified Magenx storefront configuration: engine behaviour + brand / visual theme rolled into a single object. Each client maintains their own magenx.config.ts at the storefront root.

MemberTypeDescription
brandBrandConfig
seoSeoBrandConfig
layoutLayoutConfig
homepageProductGridsHomepageProductGridConfig[]
homeTrustBadgesHomeTrustBadgeConfig[]