Skip to content

Out-of-the-box Spartacus Storefront integration for Bloomreach Content SaaS

Notifications You must be signed in to change notification settings

bloomreach/bloomreach-spartacus-storefront

Repository files navigation

BrxSpartacus

This project was generated with Angular CLI. Please check the documentation for all the configuration and CLI commands.

Development server

Set Environment Varaibles

Configure environment variables in src > environments.ts file

export const environment = {
  production: true/false,
  netlifyEnvUrl: "https://..../.netlify/functions/get-env-variables",
  libConfig: {
    endpoint: 'https://...../pages',
    smEndPoint: 'https://....',
    smSuggestionEndPoint: 'https://suggest.xyzz.com/api/',
    accountId : "1234",
    domainKey : "abc_123",
    authKey : "etdr235dfh"
  },
  appConfig: {
    defaultLoadingTime: 2 // in seconds
  }
};

Install dependencies and run the app as follows:

npm ci
npm start

Navigate to http://localhost:3000/. The app will automatically reload if you change any of the source files. For more on components and environment varaibles check out the Bloomreach Spartacus Library documentation.

Production build

Environment Varaibles

Configure environment variables(as here) in src > environments.prod.ts file

Install dependencies and build the app as follows:

npm ci
npm run build

Accessing Environment Variables from Netlify

  • Deploy Netlify function along with App distribution to Netlify
  • Netlify provides an endpoint of the deployed function to access the environment variables
  • Copy the endpoint URL from Netlify functions dashboard and add it to "netlifyEnvUrl" property in the environment file as shown above
  • Use 'brx_' as prefix while setting ENV variables names in Netlify (Eg: brx_endpoint)
  • If adding/editing environment variables in Netlify, you'll need to rebuild and re-deploy the App to get the latest value of environment variables

Other links

About

Out-of-the-box Spartacus Storefront integration for Bloomreach Content SaaS

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •