Skip to main content

Working Example

Authentication

The client requires the host address of your Ghost API and an Admin API key in order to authenticate.
  • url - API domain, must not end in a trailing slash.
  • key - string copied from the “Integrations” screen in Ghost Admin
  • version - minimum version of the API your code works with
The url and key values can be obtained by creating a new Custom Integration under the Integrations screen in Ghost Admin.
See the documentation on Admin API authentication for more explanation.

Endpoints

All endpoints & parameters provided to integrations by the Admin API are supported.

Publishing Example

A bare minimum example of how to create a post from HTML content, including extracting and uploading images first.

Installation

yarn add @tryghost/admin-api npm install @tryghost/admin-api

Usage

ES modules:
Node.js: