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.
Unified API (recommended)
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:
| Method | Description |
|---|---|
searchProducts | Keyword and category search with normalized products, facets, and pagination |
getProductDetails | Single product lookup by ID with normalized product data |
Available Raw APIs
The bloomreachDiscovery SDK module exposes all Bloomreach Discovery endpoints:
| Method | Description |
|---|---|
productSearchApi | Full-text product search with faceting and sorting |
categorySearchApi | Search within a product category |
autosuggest | Real-time search suggestions |
contentSearchApi | Search through content items |
bestsellerApi | Bestselling products |
itemBasedRecommendationsApi | "Frequently bought together" and similar |
personalizedRecommendationsApi | User-personalized recommendations |
All methods are fully typed — explore the parameters via your IDE's autocomplete.
Next Steps
- Unified Extension — configure and use the normalized search API
- Manual Setup — wire the integration without the module installer