Support Forums

Fetch data from the cms in create react app

Hi all, I want to use NetlifyCMS as a CMS for my react webapp so my users can add content and I want to fetch the user generated content as a json to present it in unique ways. I don’t want to use any static site generator. I understand from NetlifyCMS docs that I need to use git-gateway if I want to allow any user access to the CMS but I do not understand from the docs where the data will be stored and how I can fetch it. What confuses me is that in the backend configuration docs it states that the field “repo” is ignored when using git-gateway and the field “api_root” is only necessary when using github enterprise or self hosted gitlab. So which api do I query to get the data when using git-gateway option?**

Netlify CMS is a git-based CMS. So all the data is stored in the git repo you configure. It’s explained in more detail here: Configuration Options | Netlify CMS | Open-Source Content Management System.

1 Like

You can simply use JSON as a file format and publish it to your public folder. You react app can fetch it from there. There are some CRA + Netlify CMS examples out there, shouldn’t be too hard to find some good inspiration.

1 Like