Accessing data stored in Netlify CMS

Identity and the CMS are functioning properly and storing my markdown files inside my git repository via git gateway. I need a way to reference the files created in Netlify CMS.

The Netlify CMS documentation says

The available selectors are:

selectEntry: Selects a single entry, given the collection and a slug.

selectEntries: Selects all entries for a given collection.

getAsset: Selects a single AssetProxy object for the given path.

My question is how can I include these functions in my project? Are they available when I include the Netlify CMS cdn? I imported the npm module, but I don’t think there is a typed module exporting the functions?

Second question, I know Netlify CMS uses a redux store to store data for your site is there a way to reference that via an endpoint?

Thank you in advance.

Hi @tskulley.
Accessing data stored with Netlify CMS is usually done via a designated build step that reads the markdown files generated by the CMS and transforms them into queryable data.
For example, when using Gatsby that data will be available via GraphQL.

The CMS itself runs as a self contained React App so you can’t access its internal selectors/redux store (nor you shouldn’t) from within your application.

If you don’t have a designated build step to process markdown files, you could read them directly from the repo (using GitHub API for example) and process them in the browser context.

1 Like

Thank you for the help Erez.

1 Like