Vue Storefront is now Alokai! Learn More
Installation

Installation

By default, Alokai integration for Bloomreach Content is meant to be used as a Storefront module. However, it can also be installed in any Next or Nuxt application.

Requirements

If you don't have a Bloomreach Content environment yet, we suggest you get in touch with Bloomreach and request a demo.

Installing dependencies

In your frontend application, install the following dependencies:

yarn
yarn add @bloomreach/spa-sdk @vsf-enterprise/bloomreach-content-sdk

In your Server Middleware application, install the following dependencies:

yarn
yarn add @vsf-enterprise/bloomreach-content-api

Configuring Server Middleware

The next step is configuring the Bloomreach Content integration in the Server Middleware.

Key concept - Server Middleware

Middleware concept is described in detail in our Key concepts: Server Middleware docs.

Add the following configuration to your Server Middleware configuration file. Replace <bloomreach_environment_name> with the name of your Bloomreach Content environment (e.g. vuestorefront):

middleware.config.ts
import type { Integration } from "@vue-storefront/middleware";
import type { MiddlewareConfig as BloomreachContentMiddlewareConfig } from "@vsf-enterprise/bloomreach-content-api";

export default {
  integrations: {
    bloomreachContent: {
      location: '@vsf-enterprise/bloomreach-content-api/server',
      configuration: {
        environment: '<bloomreach_environment_name>',
      },
    } satisfies Integration<BloomreachContentMiddlewareConfig>,
  },
}

Configuring Alokai SDK

The last step in the process is configuring Alokai SDK for Bloomreach Content in your frontend application.

Key concept - SDK

SDK core is described in detail in our SDK docs.

Add the following configuration to your Alokai SDK configuration file:

sdk.config.ts
import { bloomreachContentModule } from '@vsf-enterprise/bloomreach-content-sdk';

export function getSdkConfig() {
  return defineSdkConfig(({ buildModule, config }) => ({
    bloomreachContent: buildModule(bloomreachContentModule, {
      apiUrl: `${config.middlewareUrl}/bloomreachContent`
    }),
  }));
}