Skip to main content

Store configuration

By the end of this page

A store that shows your brand, your contact channels and your payment details, and an understanding of why the admin panel can override any of it.

Passing config​

config accepts a CatalogConfig object. Every field is optional.

<CatalogApp
config={{
companyName: 'Bloom Cosmetics',
tagline: 'Clean beauty, delivered',
currency: 'BRL',
whatsappPhone: '5511999998888',
pixKey: 'bloom@example.com',
pixMerchantCity: 'Sao Paulo',
}}
/>

Every option​

Identity​

OptionTypeShown where
companyNamestringHeader logo text, footer, order messages. Falls back to the theme's name
taglinestringFooter, under the brand. Falls back to the theme's tagline
footerTextstringFooter copyright line
shippingBannerstringThe thin bar above the header
logoDataUrlstringBase64 image next to the brand name in the header
faviconDataUrlstringBase64 image injected as the page favicon

Contact and social​

OptionTypeNotes
contactEmailstringFooter and contact page
contactPhonestringFooter and contact page
addressstringFooter and contact page
whatsappPhonestringDigits only, with country code — 5511999998888. Powers the footer icon, the floating order button and WhatsApp checkout
instagramUrlstringFull URL
tiktokUrlstringFull URL
facebookUrlstringFull URL

Commerce​

OptionTypeNotes
currency'BRL' | 'USD' | 'EUR'Formatting only — see Currency. Prices are never converted
pixKeystringCPF, CNPJ, e-mail, phone or random key. Enables the Pix option at checkout
pixMerchantCitystringMax 15 characters, ASCII. Defaults to BRASIL if empty
publicSlugstringPublic catalog route: my-store serves /c/my-store
Pix requires BRL

The checkout only offers Pix when currency is BRL and pixKey is set. A Pix code in euros would not be payable.

Analytics​

OptionTypeNotes
gaIdstringGA4 measurement id, G-XXXXXXXX
metaPixelIdstringNumeric Meta Pixel id

Setting either injects the script and starts emitting view_item, add_to_cart, begin_checkout and purchase. See Analytics.

Config is a seed, not a lock​

This surprises people, so it is worth being explicit.

config is merged into localStorage when the provider mounts, under the key ecom-site-config. From that moment the store reads the stored copy, which the built-in admin panel can edit at runtime.

Consequences:

  • Changing a value in config and reloading does update the store, because the merge runs on every mount and your prop wins.
  • Anything an admin changed in the panel persists in that browser until the same key is passed in config again.
  • Clearing site data resets the store to whatever config says.

To inspect or change configuration from your own components:

import { useSiteConfig } from '@neverleans-labs/plug-store-core';

function ShippingNotice() {
const { config, updateConfig } = useSiteConfig();

return (
<button onClick={() => updateConfig({ shippingBanner: 'Free shipping today' })}>
{config.shippingBanner}
</button>
);
}

Coupons​

Coupons live in runtime config rather than in CatalogConfig, because they are something a store owner changes often. Four ship by default:

CodeEffect
SAVE1010% off
SAVE2020% off
WELCOME55 off the total
FREESHIPRemoves the shipping cost

Replace them through updateConfig:

const { updateConfig } = useSiteConfig();

updateConfig({
coupons: [
{ code: 'BLOOM15', type: 'percent', value: 15, label: '15% off' },
{ code: 'FRETEGRATIS', type: 'flat', value: 0, label: 'Free shipping' },
],
});

Other provider props​

These sit next to config, not inside it:

PropTypePurpose
defaultThemestringStarting theme id — see Themes
customThemeThemeConfigA theme built with defineTheme
defaultLanguage'pt' | 'en'Initial UI language
dataProviderCatalogDataProviderYour backend — see Data providers
queryClientQueryClientShare a react-query cache with the host app

Next​