Project Configuration Differences with PWA Kit

PWA Kit uses JavaScript configuration with looser runtime validation and flatter structures. Storefront Next introduces typed config definitions, structured namespaces, and an environment-variable override model designed for safer server-client separation. Access patterns also become more context-aware on the server and hook-based in React components.

AspectPWA KitStorefront Next
LanguageJavaScriptTypeScript
Type SafetyNone (runtime)Full type definitions
Locationconfig/default.jsconfig.server.ts
Helper FunctionNonedefineConfig() for IDE autocomplete
Multi-site ConfigSeparate sites.js fileSimplified (single locale and currency)
AspectPWA KitStorefront Next
Override SystemLimited (specific vars only)Full path-based override system
Naming ConventionCustom per variablePUBLIC__path__to__config
JSON ParsingManualAutomatic
ValidationNoneStrict schema validation
Client ExposureN/APUBLIC__ prefix = client-safe
AspectPWA KitStorefront Next
Server AccessgetConfig()getConfig(context)
Client AccessgetConfig()getConfig() or useConfig()
React ComponentsgetConfig()useConfig() hook required
Type InferenceNoneFull TypeScript types
Context RequiredNoYes (server-side)
FeaturePWA KitStorefront Next
Commerce APIapp.commerceAPI.parametersapp.commerce.api
Feature FlagsTop-level booleansapp.site.features namespace
Analyticsapp.einsteinAPI, app.dataCloudAPIapp.engagement.adapters
UI SettingsN/Aapp.pages, app.global
PerformanceN/Aapp.performance
i18nIn sites.jsapp.i18n

PWA Kit:

Storefront Next:

PWA Kit:

Storefront Next:


  1. Type Safety: Storefront Next provides full TypeScript type definitions, while PWA Kit uses plain JavaScript with no type checking.

  2. Environment Variables: Storefront Next has a sophisticated environment variable override system with validation, while PWA Kit relies on hardcoded values or manually-implemented env var handling.

  3. Context Requirement: Storefront Next requires passing router context to access config in server-side code, enabling proper isolation between requests. PWA Kit uses a global singleton.

  4. React Integration: Storefront Next requires using useConfig() hook in React components (proper React Context pattern), while PWA Kit allows calling getConfig() anywhere.

  5. Configuration Scope: Storefront Next organizes configuration into clear namespaces (pages, commerce, site, global, performance, engagement), while PWA Kit uses a flatter structure with mixed concerns.

  6. Multi-Site: PWA Kit has built-in multi-site configuration in sites.js with complex locale and currency mappings. Storefront Next simplifies this with single locale and currency values. Multi-site can be handled differently.

PWA KitStorefront Next
config/default.jsconfig.server.ts
config/sites.jsLocale and currency in app.site
app.commerceAPI.parameters.clientIdapp.commerce.api.clientId
app.storeLocatorEnabledMove to extension config
app.multishipEnabledMove to extension config

Before (PWA Kit):

After (Storefront Next):

Before (PWA Kit):

After (Storefront Next):

In Storefront Next, server-only secrets (like SLAS private key) should NOT use the PUBLIC__ config system: