Fetching and Using Tier Information via the Ghost CMS Content API

Hello,

I’m developing a Next.js application and am using the Ghost CMS as a headless CMS for my content. I’ve been utilizing the Content API to fetch posts, authors, tags, and other content successfully, but I’ve encountered a roadblock when it comes to handling membership tiered content.

When I use the Content API to fetch content it only retrieves public content, while I would need all the content classified by its visibility.

It is a not a good security practice using Admin API (with CUD rights) just to fetch data.

Any help or guidance would be greatly appreciated. Thank you in advance!

Best,
Luis Alberto

1 Like

As long as you’re not fetching data from the client, then it’s safe to use the Admin API. In fact, it’ll be the only way to fetch protected content, since, as you mention, the Content API can only fetch public content.

In the context of Next, this means you’ll need to fetch the data at build time or have the server render the protected content.