Vue Storefront is now Alokai! Learn More
Quick Start

Quick Start

Prerequisites

  • Node.js version 20.x or 22.14+
  • Yarn package manager
  • Bloomreach Discovery account with API credentials

Installation

To install the module, you need an enterprise license and credentials. Contact the Alokai Support Team to get access.

From the root of your project:

npx @vsf-enterprise/storefront-cli add-module search-bloomreach -e sapcc

Follow the CLI instructions. Once complete, verify that apps/storefront-middleware/sf-modules/search-bloomreach exists.

The module sets up everything automatically — middleware integration, unified extension, and SDK modules for both raw and normalized API access.

Environment Variables

Add to your .env file:

BLOOMREACH_DISCOVERY_ACCOUNT_ID=your_account_id   # Required
BLOOMREACH_DISCOVERY_DOMAIN_KEY=your_domain_key    # Required
BLOOMREACH_DISCOVERY_AUTH_KEY=your_auth_key         # Optional (for authenticated accounts)

You can obtain these credentials from your Bloomreach representative.

Start the Application

yarn alokai-cli store dev

Verify It Works

The module gives you two SDK modules — use bloomreachUnified for normalized data (recommended) or bloomreachDiscovery for the raw Bloomreach API.

const { products, facets, pagination } = await sdk.bloomreachUnified.searchProducts({
  search: 'shoes',
  pageSize: 12,
});

Raw API

const results = await sdk.bloomreachDiscovery.productSearchApi({
  q: 'shoes',
  rows: 12,
});

All common parameters (accountId, domainKey, tracking cookies) are injected automatically — you only provide request-specific params like q and rows.

Available Unified APIs

The bloomreachUnified SDK module exposes normalized Bloomreach Discovery endpoints:

MethodDescription
searchProductsKeyword and category search with normalized products, facets, and pagination
getProductDetailsSingle product lookup by ID with normalized product data

Available Raw APIs

The bloomreachDiscovery SDK module exposes all Bloomreach Discovery endpoints:

MethodDescription
productSearchApiFull-text product search with faceting and sorting
categorySearchApiSearch within a product category
autosuggestReal-time search suggestions
contentSearchApiSearch through content items
bestsellerApiBestselling products
itemBasedRecommendationsApi"Frequently bought together" and similar
personalizedRecommendationsApiUser-personalized recommendations

All methods are fully typed — explore the parameters via your IDE's autocomplete.

Next Steps