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

Bootstrapping Bloomreach Content

Before you start using our Bloomreach Content integration, you need to bootstrap your Bloomreach Content environment with Alokai schemas. These schemas include content types, folders, components, menus, and layouts that are aligned with our out-of-the-box frontend components.

The bootstrapping process includes generating an auth token, importing integration schemas using Bloomreach Content Manager, and setting up your environment. For detailed instructions, please refer to our Bootstrapping Bloomreach Content guide.

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 SDK modules:

sdk/modules/bloomreach-content.ts
import { defineSdkModule } from '@vue-storefront/next';
import { bloomreachContentModule } from '@vsf-enterprise/bloomreach-content-sdk';

export const bloomreachContent = defineSdkModule(({ buildModule, config, getRequestHeaders }) =>
  buildModule(bloomreachContentModule, {
    apiUrl: `${config.apiUrl}/bloomreachContent`,
    ssrApiUrl: `${config.ssrApiUrl}/bloomreachContent`,
    defaultRequestConfig: {
      headers: getRequestHeaders(),
    },
  }),
);
sdk/modules/index.ts
export * from './bloomreach-content';
// ... other module exports