Milestone 2: Create a Frontend App



To make the most of this tutorial, acquire our publicly available credentials to log in to a shared developer environment. (This is different from your personal developer trial account credentials that leads you to a private trial environment.)

Milestone Overview


Create a frontend app to render the channel you created in milestone 1.

Estimated Time to Complete

5-10 minutes


In this milestone, you will take the Delivery API output for the channel you created in the previous milestone and use the Bloomreach SPA SDK to create your own frontend app that consumes the API output and renders the channel as a website.



The code examples on this page are for a React-based frontend app. You can find Angular and Vue versions of the example app, as well as the full React app, in our Github repository.

A Brief Look at the Delivery API Response

Bloomreach Content provides a Delivery API for frontend applications to retrieve channel and page data. The API's Pages endpoint provides all the data needed to render a particular page including any containers, components, and content items on that page.

The Pages endpoint for your channel's single page can be accessed at a URL of the following format, where [account_name] and [channel_name] should be replaced with the appropriate values:


For example, if your account is named "trial-1234abcd" and you named your channel "getting started", the URL would be:

Enter the API URL in your browser and have a brief look at the JSON response. It contains a lot of objects including the page and a flattened hierarchy of containers and components on the page. You don't have to understand everything yet at this point but can you match some of the objects in the JSON data with the page elements you see in the Experience manager preview?



See Pages JSON Representation in the Delivery API reference documentation for a full description of the data format.

Create a Frontend App

Now that you have created a channel and can retrieve a page from the Delivery API, it is time to create a frontend application that can consume the API response and render the page.

Watch the video below which will give you an overview on how to create a frontend app. This will be followed by commands that you need to use to create a frontend app below the video.

Create a new React app using the following command:

npx create-react-app my-react-content-app

To simplify integration with Javascript-based frontend applications, Bloomreach provides a Bloomreach SPA SDK that interacts transparently with the Delivery API and exposes a simplified and framework-agnostic interface to the API's data model. You'll be using the SDK to build up your frontend app.

Use the following command to install the SDK libraries as well as the axios library:

cd my-react-content-app
npm install @bloomreach/spa-sdk @bloomreach/react-sdk axios

Open src/App.js in your favorite editor and change its contents to the following:


import logo from './logo.svg';
import './App.css';
import axios from "axios";
import { BrPage } from "@bloomreach/react-sdk";
import { ContentPage } from "./components/ContentPage";

function App() {
  return (
    <div className="App">
      <header className="App-header">
        <img src={logo} className="App-logo" alt="logo" />
          Edit <code>src/App.js</code> and save to reload.
        <BrPage configuration={{
          endpoint: '',
          httpClient: axios
        }} mapping={{ ContentPage }}>

export default App;

Study the code above and note the following:

  • The BrPage element (imported from the SDK) is a placeholder in your frontend application which will render components in the page's JSON representation as returned by the Delivery API.
  • The endpoint property specifies the URL of the Delivery API's Pages endpoint (make sure to update the URL to reflect your Bloomreach Content account!).
  • The mapping property maps your React components their counterparts in the JSON representation.
  • A Content component (which you will implement in a moment) is imported and mapped.



Make sure to modify the endpoint URL in the code to reflect your Bloomreach Content account!

In the src folder, create a subfolder called components and inside it, create a file ContentPage.jsx with the contents below. This is will be the frontend implementation of the ContentPage component you added to the page in the previous milestone.


export function ContentPage({ component, page }) {

  const document = page.getDocument();

  const { title, content, introduction } = document.getData();

  return (
      <div dangerouslySetInnerHTML={{ __html: content.value }} />

At this point, you are ready to launch your app using the following command:

npm start

This will load the app in your browser (at http://localhost:3000/) and if everything went well you should see the following page:


Congratulations, you created your first frontend app for Bloomreach Content!

Now go back into the Experience manager application and make some changes to the content (see Milestone 1 for instructions, don't forget to publish!) and refresh the frontend app to see the updated content.

Full Code

Find the complete code for milestone 2 in React, Angular, and Vue in Github:


Now that you have created a channel and a frontend app, your next step is to set up a development project and configure it to use your frontend app to render the preview.