Hysen Labs
CLI tool
TryGhost/algolia avatar
TryGhost

algolia

JavaScript CLI and Netlify Functions for indexing Ghost posts in Algolia

22 stars19 forksTypeScriptMIT
DEEP OPEN-SOURCE ANALYSIS

Ghost Algolia tools keep a search index in sync with posts

This JavaScript monorepo turns Ghost posts into Algolia records and keeps the index current through a CLI and Netlify Functions.

What the tools do

Ghost Algolia tools are JavaScript utilities for turning Ghost posts into search records and keeping an Algolia index up to date. The README states that maintenance of the repository has resumed, and it notes that the CLI now supports Ghost 6 by requesting up to 100 posts at a time and following Ghost's pagination metadata until every post has been fetched. The project is organized as a pnpm monorepo with five packages. The @tryghost/algolia package provides a CLI for the initial indexing of a site's published posts. The @tryghost/algolia-netlify package provides Netlify Functions that process Ghost post webhooks and update an index. The @tryghost/algolia-fragmenter package converts Ghost posts into Algolia records and splits their HTML by heading. The @tryghost/algolia-indexer package manages Algolia index settings, records, and deletions. The @tryghost/algolia-html-extractor package extracts ordered text fragments from rendered Ghost HTML. Together these packages cover the full lifecycle from a first bulk load to incremental updates driven by webhooks. The README does not claim a specific index size or sync latency, and it treats the packages as building blocks that a site owner wires into a Ghost deployment and a Netlify site. The resumption note signals that the code is once again receiving attention after a period of inactivity, which matters to anyone evaluating whether to depend on it for production search.

Usage and a security warning

The README documents two ways to use the tools. The Netlify Functions path deploys handlers that react to Ghost post webhooks and update the Algolia index, and the CLI path performs the initial batch index of published posts. The README includes a warning about the Netlify handlers: it states that the current handlers do not enforce authentication when the query parameter is omitted, and it cautions that a public function URL is not a secret. The instruction is direct: do not expose these functions publicly until authentication is enforced or access is restricted outside the handlers. This is an important operational caveat, because a publicly reachable webhook endpoint could let outsiders trigger index updates or probe the function. Deployment, Algolia configuration, and Ghost webhook setup are described in the @tryghost/algolia-netlify guide rather than inline. The CLI install, configuration, and options are documented in the @tryghost/algolia guide. The README notes that the Netlify deployment publishes only a static landing page alongside the functions, and that the repository's package and function files are not site assets. A site owner should therefore treat the function URL as sensitive and place it behind access controls before relying on it in production. The warning is a frank acknowledgment of the current limitation rather than a hidden behavior.

Development and release process

The development section describes a standard pnpm workflow. The README tells contributors to use the Node version declared in .nvmrc, run pnpm install to link the workspaces, and then pnpm test for the full suite including lint checks or pnpm lint for lint and formatting only. Package specific commands live in each package README. For publishing, the repository uses Nx to version packages independently. Routine releases run from a clean checkout of main with root aliases such as pnpm ship:patch, pnpm ship:minor, or pnpm ship:major, and a single package can be released with pnpm ship plus its Nx project name, optionally with a dry run first. The ship command runs the test suite, updates the selected versions and their internal dependants, creates the release commit and tags, and pushes them upstream; a Publish workflow then publishes those versions through npm trusted publishing. The README is explicit that nobody should run npm publish by hand. Copyright is held by the Ghost Foundation for 2013 to 2026, and the code is released under the MIT license. With 22 stars in the metadata, this is a small but official Ghost affiliated project. The combination of an independent versioning scheme, a tested release script, and a trusted publishing flow shows that the tooling is meant to be maintained as part of the broader Ghost ecosystem rather than as a one off script.

Editorial conclusion

The tools are released under the MIT license by the Ghost Foundation and the most recent commit was on 2026-08-26.

DEEP OPEN-SOURCE ANALYSIS

Official sources

Community notes

Community notes