Skip to content

Repository files navigation

Ghost Blocks (and friends)

Tools for publishing to Ghost CMS — plus an unrelated n8n trigger node for the Nodey mobile app that lives in the same monorepo.

This monorepo contains four packages:

Package Description Audience
ghost-blocks Node.js library for publishing to Ghost. Use directly in any Node.js app. Any Node.js consumer
n8n-nodes-ghost-blocks n8n community node, full features (image upload, bookmark/embed auto-enrichment). Self-hosted n8n
n8n-nodes-ghost-blocks-cloud n8n community node, slim verified-compatible edition. n8n Cloud
n8n-nodes-nodey n8n community trigger node — fires a workflow when an NFC tag is scanned via the Nodey mobile app. Verified-compatible. n8n Cloud + self-hosted

Why this exists

Ghost stores content in Lexical — a deeply nested JSON format with format flags, decorator nodes, and 24+ card types. Writing a complete article block by block is painful. Ghost's Admin API also requires short-lived JWT tokens (5-min expiry) generated from a hex-decoded HMAC secret, which most automation tools can't do natively.

Ghost Blocks lets you describe a post like this:

{
  title: "My Article",
  content: [
    { type: "paragraph", text: "First paragraph with **bold** and *italic*." },
    { type: "heading", level: 2, text: "Section" },
    { type: "image", src: "https://...", alt: "Photo" },
    { type: "callout", text: "Important note", emoji: "💡", color: "blue" },
    { type: "paywall" },
    { type: "paragraph", text: "Behind the paywall." }
  ],
  status: "published"
}

…and it builds the full Lexical document, handles auth, and publishes to Ghost.

Quick start

Library:

npm install ghost-blocks
import { GhostPublisher } from 'ghost-blocks';

const publisher = new GhostPublisher({
  url: 'https://my-site.ghost.io',
  adminKey: 'YOUR_ID:YOUR_HEX_SECRET',
});

await publisher.createPost({
  title: 'Hello world',
  content: [{ type: 'paragraph', text: 'My first post **with formatting**.' }],
  status: 'published',
});

See packages/core/README.md for full documentation.

n8n community node:

In your n8n instance, go to Settings → Community Nodes → Install and enter n8n-nodes-ghost-blocks. Then add a Ghost Blocks node to any workflow.

See packages/n8n-node/README.md for setup details.

Development

git clone https://github.com/TheFamousHesham/ghost-blocks
cd ghost-blocks
npm install         # installs all workspaces
npm run build       # builds both packages
npm run test        # runs unit tests across all packages

To run integration tests against a live Ghost instance:

GHOST_URL=https://my-site.ghost.io \
GHOST_ADMIN_KEY=id:hex_secret \
npm run -w ghost-blocks test:integration

Releasing

Releases are published to npm with provenance attestations via GitHub Actions — required for n8n community-node verification from May 2026 onwards.

To release a new version of either package:

  1. Bump the version field in the relevant packages/*/package.json.
  2. Update CHANGELOG.md.
  3. Commit and push to main.
  4. Create and push a tag matching the pattern <package-name>@<version>:
    git tag -a ghost-blocks@0.3.2 -m "Release ghost-blocks 0.3.2"
    git push origin ghost-blocks@0.3.2
  5. The matching GitHub Action will build, test, verify the tag matches the package version, then publish with --provenance.

GitHub Actions secrets required:

  • NPM_TOKEN — granular npm access token with publish rights on ghost-blocks and n8n-nodes-ghost-blocks.

More from the author

  • Nodey (launching soon) — A mobile command centre for n8n. Run and debug workflows from your phone, with an AI workflow builder, geo-fenced location-based triggers, and NFC triggers.
  • n8n workflow templates — A growing collection of production-ready n8n workflow templates for common automation patterns. Free to use and adapt.

License

MIT — see LICENSE.

About

Publish to Ghost CMS using a simple, flat content blocks format. Includes a Node.js library and an n8n community node.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages