So I am putting together a NextJS + Ghost CMS decoupled blog and am playing around with the Ghost JS API (specifically the Content API Client Library).
One of their endpoints, the api.posts.browse() one, is said to return data in this format, according to their documentation:
The docs you linked to are for the Content API HTTP interface, this is what’s returned when making requests to the Ghost API.
The code you’ve shown is using the content-api sdk, which wraps these requests/responses, and returns Promises for arrays of content - this is designed to make it easier to work with. As for the meta this isn’t inside the array, but a property on it.
api.posts.browse(opts).then(posts => {
posts.forEach(post => console.log(post)); // each of these is a post object
console.log(posts.meta); // this contains meta information e.g. pagination
});
Though I wish that the docs you linked to were more explicit about the structure of the data that those functions return. For example it would be nice to know about meta property being returned on the array.