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

docusaurus-search-zensearch

v0.1.13

Published

ZenSearch integration for Docusaurus documentation sites

Readme

docusaurus-search-zensearch

ZenSearch integration for Docusaurus documentation sites. Replace the default search with AI-powered documentation search.

Features

  • Fast, AI-powered documentation search
  • Fuzzy matching and semantic search
  • Keyboard navigation (Ctrl/Cmd + K)
  • Dark mode support
  • Customizable styling
  • Analytics tracking
  • Mobile-friendly

Installation

npm install docusaurus-search-zensearch
# or
yarn add docusaurus-search-zensearch
# or
pnpm add docusaurus-search-zensearch

Configuration

Add the plugin to your docusaurus.config.js:

module.exports = {
  // ...
  themes: [
    [
      'docusaurus-search-zensearch',
      {
        // Required: Your ZenSearch publishable API key
        apiKey: 'zsk_pk_xxx...',

        // Optional: Collection ID to search
        collectionId: 'your-collection-id',

        // Optional: Custom API base URL
        // baseUrl: 'https://api.zensearch.dev',

        // Optional: Search placeholder text
        placeholder: 'Search documentation...',

        // Optional: Maximum number of results
        maxResults: 10,

        // Optional: Minimum relevance score (0-1, default: 0.5)
        // Results below this score are filtered out
        minScore: 0.5,

        // Optional: Enable keyboard shortcut (default: true)
        enableKeyboardShortcut: true,

        // Optional: Custom shortcut key (default: 'k')
        keyboardShortcutKey: 'k',

        // Optional: Enable analytics (default: true)
        enableAnalytics: true,
      },
    ],
  ],
};

Getting Your API Key

  1. Sign up at ZenSearch
  2. Create a new collection for your documentation
  3. Index your documentation site
  4. Get your publishable API key from the dashboard

Theme Configuration

You can also configure the search bar in themeConfig:

module.exports = {
  themeConfig: {
    zensearch: {
      // Enable/disable the search bar (default: true)
      enabled: true,

      // Position in navbar: 'left' | 'right' (default: 'right')
      position: 'right',

      // Show on mobile (default: true)
      showOnMobile: true,
    },
  },
};

Customizing Styles

You can override the default styles using CSS variables or custom CSS:

/* src/css/custom.css */
:root {
  /* Customize highlight color */
  --ifm-color-primary-lightest: #e3f2fd;
  --ifm-color-primary-darkest: #1565c0;
}

/* Override search button styles */
.searchButton {
  background: var(--ifm-navbar-background-color);
}

/* Override modal styles */
.modal {
  backdrop-filter: blur(8px);
}

Swizzling

To fully customize the SearchBar component, you can swizzle it:

npm run swizzle docusaurus-search-zensearch SearchBar -- --eject

This will copy the SearchBar component to your project for full customization.

Keyboard Shortcuts

| Shortcut | Action | |----------|--------| | Cmd/Ctrl + K | Open search | | / | Navigate results | | Enter | Select result | | Escape | Close search |

Analytics

When enableAnalytics is true, the plugin tracks:

  • Search queries: What users are searching for
  • Click-through: Which results users click
  • Position: Where in the results the click occurred

This data helps improve search relevance over time.

Troubleshooting

Search not working

  1. Verify your API key is correct
  2. Check that your documentation has been indexed
  3. Check browser console for errors

Keyboard shortcut not working

Some browsers or extensions may intercept Cmd/Ctrl + K. Try a different shortcut:

keyboardShortcutKey: '/',  // Use "/" instead

Styling issues in dark mode

Ensure you're using CSS variables that adapt to dark mode:

html[data-theme='dark'] .searchButton {
  background: var(--ifm-navbar-background-color);
}

Support

License

MIT