npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@humaan/payload-algolia-search

v1.3.1

Published

Algolia Search Plugin for Payload CMS

Readme

Payload Algolia Search Plugin

A powerful Payload CMS plugin that provides seamless integration with Algolia search, including automatic indexing and manual reindexing capabilities.

Core Features

Installation

pnpm add @humaan/payload-algolia-search

Basic Usage

In the plugins array of your Payload Config, call the plugin with options:

import { algoliaSearchPlugin } from '@humaan/payload-algolia-search'

export const config = buildConfig({
  plugins: [
    algoliaSearchPlugin({
      collections: ['pages', 'posts'],
      credentials: {
        appId: process.env.ALGOLIA_APP_ID!,
        adminApiKey: process.env.ALGOLIA_ADMIN_API_KEY!,
        indexName: process.env.ALGOLIA_INDEX_NAME!,
      },
    }),
  ],
})

Environment Variables

Create a .env file with your Algolia credentials:

ALGOLIA_APP_ID="your_algolia_app_id"
ALGOLIA_ADMIN_API_KEY="your_algolia_admin_api_key"
ALGOLIA_INDEX_NAME="your_index_name"

The adminApiKey credential must be an Algolia Admin API key, or an API key with the settings, editSettings, addObject, deleteObject, and browse ACLs. Never expose this key to the client.

When Payload initializes, the plugin configures collection as a filter-only facet on the configured Algolia index. This setting is required for collection reindexing. Existing facets and other index settings are preserved. The configured index must exist before Payload initializes.

Options

collections

The collections property is an array of collection slugs to enable syncing to search. Enabled collections receive a beforeChange and afterDelete hook that creates, updates, and deletes its respective search record as it changes over time.

beforeSync

Before creating or updating a search record, the beforeSync function runs. This is an afterChange hook that allows you to modify the data or provide fallbacks before its search record is created or updated.

// payload.config.ts
{
  // ...
  searchPlugin({
    beforeSync: ({ originalDoc, searchDoc }) => ({
      ...searchDoc,
      // - Modify your docs in any way here, this can be async
      // - You also need to add the `excerpt` field in the `searchOverrides` config
      excerpt: originalDoc?.excerpt || 'This is a fallback excerpt',
    }),
  }),
}

syncDrafts

When syncDrafts is true, draft documents will be synced to search. This is false by default. You must have Payload Drafts enabled for this to apply.

reindexBatchSize

A number that, when specified, will be used as the value to determine how many search documents to fetch for reindexing at a time in each batch. If not set, this will default to 50.

Collection reindexing

Collection reindexing allows you to recreate search documents from your search-enabled collections on demand. This is useful if you have existing documents that don't already have search indexes, commonly when adding plugin-algolia-search to an existing project. To get started, navigate to the Algolia Search global and click the pill in the top right actions slot of the list view labelled Reindex. This will open a popup with options to select one of your search-enabled collections, or all, for reindexing.

Releasing

Releases are driven by the shared workflows in humaan/actions.

  1. In the Actions tab, run Start release and pick the bump type (patch, minor, major, prerelease or a custom version). It bumps package.json, regenerates CHANGELOG.md from the Conventional Commit PR titles, opens a chore(release): vX.Y.Z pull request as humaan-bot and enables auto-merge.
  2. Once the required checks pass, the pull request squash-merges on its own.
  3. Publish release (automatic) runs after CI succeeds on main. When the merged commit is a chore(release): commit it publishes to npm via trusted publishing, tags vX.Y.Z and creates the GitHub release. Any other commit on main is ignored.

Pull request titles must follow Conventional Commits because the changelog and release notes are generated from them. To preview a bump locally without opening a PR, run pnpm release:bump <patch|minor|major|prerelease|x.y.z> and discard the changes afterwards.