Fetch data from custom API endpoint

Hello,

I am using Frontity for about a week now and I am already excited. However, building a new website I found a topic that is not very well documented (at least for me). I am using WP REST API Sidebars plugin to expose widgets in the REST API, however as the plugin creates a custom endpoint, I am not sure how to access this endpoint and get the info.

For example, for a CPT I am using the following code in my theme’s index.js file:

actions: {
    theme: {
      beforeSSR: async ({ actions }) => {
        await actions.source.fetch('/my-cpt/');
      }
    }

How can I get the info from a custom endpoint? Is there any example in the documentation I missed?

Thanks in advance.

I was able to find the answer on this topic: How to access ACF Options pages

It seems it was easier than I thought. :slight_smile:

1 Like