# Integrating Gatsby/Jamstack/Static Site Generation(SSG) with Headless BRXM

**URL:** <https://community.bloomreach.com/t/integrating-gatsby-jamstack-static-site-generation-ssg-with-headless-brxm/3161>\
**Category:** Experience Manager (PaaS/OnPrem)\
**Created:** [April 19, 2022, 10:13am UTC](https://community.bloomreach.com/t/integrating-gatsby-jamstack-static-site-generation-ssg-with-headless-brxm/3161 "2022-04-19T10:13:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gprice](https://avatars.discourse-cdn.com/v4/letter/g/278dde/32.png) [@gprice](https://community.bloomreach.com/u/gprice)\
**Post date:** [April 19, 2022, 10:13am UTC](https://community.bloomreach.com/t/integrating-gatsby-jamstack-static-site-generation-ssg-with-headless-brxm/3161/1 "2022-04-19T10:13:49Z")

</div>

I am currently investigating the potential of using BRXM as a headless CMS with a jamstack approach.

There are a few articles found on the BR blog about this. For example:

> **[GatsbyJS and Bloomreach CMS | Bloomreach Developers](https://developers.bloomreach.com/blog/2018/gatsbyjs-and-bloomreach-cms.html)**
>
> With the release of version 12.3 Bloomreach massively improved the support for Single Page Applications. With our the first version of the React SDK, we made it even easier to develop SPAs on top of the platform. Read more about how easy it is to...

(This is very out of date now and didn’t work)

and

> **[Headless CMS and the Jamstack, Explained](https://developers.bloomreach.com/blog/2021/headless-cms-and-the-jamstack-explained.html)**
>
> If you’ve been exploring the world of headless content management systems and decoupled architectures, you might have come across the term “Jamstack”. For those accustomed to building websites with all-in-one website platforms, the world of API-first...

Some questions:

1. Can editors still preview with this approach?
2. How do you handle documents that are edited after an SSG has been deployed?
3. Has anyone successfully achieved this?

I see many other CMS apps being officially listed on the Gatsby site, but not Bloomreach. Is there any plan to move in this direction?

---

<div class="post-metadata">

**Author:** ![giacomolm](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/giacomolm/32/1733_2.png) [@giacomolm](https://community.bloomreach.com/u/giacomolm)\
**Post date:** [April 20, 2022, 2:09pm UTC](https://community.bloomreach.com/t/integrating-gatsby-jamstack-static-site-generation-ssg-with-headless-brxm/3161/2 "2022-04-20T14:09:32Z")

</div>

Hi,  
I can try to answer to some of your concerns, maybe from a generic perspective.

Headless integrations in Bloomreach XM are driven by the (Page) Delivery API[1]. In a nutshell, the front-end gets a JSON containing the (HST) page definition/description: this would include the details about each component of the requested page.

In addition, the JSON contains all the documents defined/needed as part of that page. Please also note that Bloomreach provides the SPA SDK library [2], that automatically processes the Page Delivery API.

At the moment SSG is not automatically handled OOTB: for example, if you are searching for an event based mechanism, that’s not available OOTB at the moment. But it may be possible to implement that if needed, and it should not be difficult in my opinion.

Regards,

[1] [Delivery API](https://documentation.bloomreach.com/content/reference/delivery-api)  
[2] [@bloomreach/spa-sdk - npm](https://www.npmjs.com/package/@bloomreach/spa-sdk)

---

<div class="post-metadata">

**Author:** ![gprice](https://avatars.discourse-cdn.com/v4/letter/g/278dde/32.png) [@gprice](https://community.bloomreach.com/u/gprice)\
**Post date:** [April 26, 2022, 9:23am UTC](https://community.bloomreach.com/t/integrating-gatsby-jamstack-static-site-generation-ssg-with-headless-brxm/3161/3 "2022-04-26T09:23:48Z")

</div>

Thanks for your response. I think some more experimentation and exploration will need to be done.

My main confusion is not so much consuming the endpoints, it’s about what happens when an editor makes a change and publishes it. Does the entire SSG build have to re-run or is there a more clever approach?

---

<div class="post-metadata">

**Author:** ![giacomolm](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/giacomolm/32/1733_2.png) [@giacomolm](https://community.bloomreach.com/u/giacomolm)\
**Post date:** [April 26, 2022, 4:20pm UTC](https://community.bloomreach.com/t/integrating-gatsby-jamstack-static-site-generation-ssg-with-headless-brxm/3161/4 "2022-04-26T16:20:08Z")

</div>

Yes, if an editor makes a new change and publishes it, then a new site deployment needs to be triggered and the entire SSG would need to re-run.

If with “a more clever approach” you mean re-building only what has been changed, that probably depends on the front-end hosting platform you are using: most likely several optimisation are done on that level.
