Window Nimstrata Properties

window.Nimstrata is the storefront configuration object read by Nimstrata App Block JavaScript.

For normal Online Store 2.0 installs, Shopify Liquid App Blocks create the required values from app settings, Shopify localization data, and app metafields. Add custom window.Nimstrata properties only for a manual Online Store 1.0 install or a bespoke theme integration that cannot be configured in the Retail Cloud Connect Shopify App.

Define any manual values before loading the Nimstrata storefront bundle.


Property Reference

Property Used by Purpose
window.Nimstrata.settings Search, collection, recommendations Overrides saved storefront settings such as product-card layout, filter layout, fields, and order settings. Prefer the Retail Cloud Connect Shopify App UI for Online Store 2.0.
window.Nimstrata.search.defaultFilters Search, collection Hidden filters appended to each search/browse request. Accepts an array or a sync/async function returning an array.
window.Nimstrata.search.customFilters Search, collection Visible custom switch filters that can render in the toolbar or filter drawer.
window.Nimstrata.search.customFields Search, collection Extra fields to request for custom-filter relevance checks when the field is not a normal App Block filter.
window.Nimstrata.search.keyMappings Search, collection Maps legacy or short URL query parameters to Retail API facet keys. Use only for migrations or bespoke URL contracts.
window.Nimstrata.recs.defaultFilters Recommendations Hidden filters appended to recommendation predict requests. The recommendations block adds an in-stock filter unless an availability filter is provided.
window.Nimstrata.hooks.postProductRender Search, collection Optional callback invoked after product cards re-render. Use only for legacy scripts that must attach to rendered product-card DOM.
window.Nimstrata.t.searchButtonInner Search, collection Optional HTML override for the search button inner content in manual installs. Prefer App Block translations and CSS for normal installs.
window.Nimstrata.translations.default App Blocks Flat storefront translation dictionary for UI copy and filter headings. Online Store 2.0 App Blocks inject this automatically.
window.Nimstrata.translations.filters Search, collection Per-facet filter-value translations. Online Store 2.0 App Blocks inject this automatically.
window.Nimstrata.translations.document Document search Document-search UI translations. Online Store 2.0 App Blocks inject this automatically.
window.Nimstrata.filterOrder Search, collection Optional per-facet comparator functions for custom filter-value ordering.
window.Nimstrata.project Autocomplete Google Cloud project name for manual autocomplete installs. App Blocks set this from app metafields.
window.Nimstrata.language Autocomplete Shopify storefront language code for manual autocomplete installs.
window.Nimstrata.country Autocomplete Shopify storefront country code for manual autocomplete installs.
window.Nimstrata.token Autocomplete Shopify Storefront API token when Shopify autocomplete tracking is enabled.
window.Nimstrata.identity Autocomplete, search Store identity, normally the shop permanent domain or its prefix depending on the block.

Manual Search Example

<script>
  window.Nimstrata = window.Nimstrata || {};
  window.Nimstrata.search = window.Nimstrata.search || {};

  window.Nimstrata.search.defaultFilters = [
    {
      field: 'attributes.available_in_market',
      value: ['GB'],
      type: 'string',
    },
  ];

  window.Nimstrata.search.customFilters = [
    {
      name: 'in_stock',
      displayName: 'In stock',
      displayComponent: 'switch',
      displayLocation: 'toolbar',
      filter: {
        field: 'availability',
        value: ['IN_STOCK'],
        type: 'string',
      },
    },
  ];
</script>

Manual Translation Example

Use this only for manual installs that cannot use the Retail Cloud Connect Shopify App Translations page.

window.Nimstrata = window.Nimstrata || {};
window.Nimstrata.translations = window.Nimstrata.translations || {};

window.Nimstrata.translations.default = {
  'search.placeholder': 'Search',
  'toolbar.refine_filters': 'Refine Filters',
  brands: 'Brand',
};

window.Nimstrata.translations.filters = {
  sizes: {
    sizes: 'Size',
    Small: 'Small',
    Medium: 'Medium',
    Large: 'Large',
  },
};

Manual Recommendation Example

window.Nimstrata = window.Nimstrata || {};
window.Nimstrata.recs = window.Nimstrata.recs || {};

window.Nimstrata.recs.defaultFilters = [
  {
    field: 'attributes.available_in_market',
    value: ['GB'],
    type: 'string',
  },
];

When no availability filter is provided, recommendations add { field: 'availability', value: ['IN_STOCK'], type: 'string' } automatically.


Safer Alternatives

Before adding custom JavaScript, check whether the app already covers the need: