Commons recipes
Here is a growing collections of things you can achieve with the @ts-ghost/admin-api
.
Getting all the posts (including Authors) with pagination
Here we will use the paginate
function of the fetcher to get the next page fetcher directly if it is defined.
Fetching the Settings of your Ghost instance
Settings is a specific resource, you cannot build query against it like the other resources. You can only fetch the settings, so calling api.settings
will directly give you a fetcher. It will return an array of Key/Value. The keys are the settings names and the values are the settings values.
This settings
resource is different from the @ts-ghost/content-api
settings
resource. The Admin API settings
gives more info but just in key/value form.