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

vitepress-plugin-cloudflare-ai-search

v0.0.1

Published

Replace VitePress default-theme search with Cloudflare AI Search

Readme

vitepress-plugin-cloudflare-ai-search

npm version npm downloads License pkg.pr.new

Replace the VitePress default-theme search with Cloudflare AI Search.

  • 🔎 Native VitePress integration: Replaces the default navbar search surface without changing your theme.
  • ☁️ Cloudflare-powered search: Uses Cloudflare's official search-modal-snippet component for search, results, favorites, and analytics.
  • ⌨️ Keyboard ready: Opens with Cloudflare's built-in Cmd/Ctrl+K shortcut.
  • 🌗 Theme aware: Follows VitePress light and dark mode unless you choose a theme explicitly.
  • 🖥️ SSR safe: Loads Cloudflare's browser-only component after mount.

Installation

pnpm add vitepress-plugin-cloudflare-ai-search

Usage

Add the plugin to the VitePress vite.plugins array:

// .vitepress/config.ts
import { defineConfig } from 'vitepress'
import { cloudflareAISearch } from 'vitepress-plugin-cloudflare-ai-search'

export default defineConfig({
  vite: {
    plugins: [
      cloudflareAISearch({
        endpoint: 'https://search.example.com',
      }),
    ],
  },
})

[!NOTE] Do not configure themeConfig.search. This plugin replaces VitePress's local or Algolia search UI.

The required endpoint is the public AI Search endpoint root. It must use http or https and must not include credentials, query parameters, a hash, or the /search path. Redundant trailing slashes are removed automatically.

Options

All Cloudflare modal settings are optional and use Cloudflare's defaults when omitted.

cloudflareAISearch({
  endpoint: 'https://search.example.com',
  placeholder: 'Search the docs',
  theme: 'auto',
  maxResults: 10,
  disableAnalytics: true,
  cssVariables: {
    '--search-snippet-primary-color': '#646cff',
  },
})

| Option | Description | | --- | --- | | endpoint | Required. Public AI Search endpoint root. | | placeholder, maxResults, maxRenderResults, debounceMs | Search input and result-list behavior. | | theme | light, dark, or auto. Omit it to synchronize with VitePress. | | hideBranding, showUrl, showDate, hideThumbnails, groupBy, seeMore | Cloudflare search result presentation. | | shortcut, useMetaKey | Keyboard shortcut customization. Defaults to k and true. | | requestOptions | Additional public request fields, headers, and query parameters. | | disableAnalytics | Disables Cloudflare analytics. Analytics are enabled by default. | | translations | Cloudflare modal translations. searchButtonLabel also controls the navbar label. | | cssVariables | --search-snippet-* properties forwarded to the component host for Shadow DOM styling. |

The navbar label uses translations.searchButtonLabel, then placeholder, then Search.

[!WARNING] The endpoint and every option are sent to the browser. AI Search endpoints are public browser endpoints, so never add API tokens, Authorization values, Cloudflare Access service-token secrets, or other credentials to requestOptions.

Cloudflare setup

Create and configure an AI Search instance in Cloudflare, enable its public /search endpoint, and add your development and production origins to its authorized hosts. Index only content that is safe to expose publicly.

Review your plan's rate limits, query quotas, indexing delay, analytics behavior, and Access limitations. If you configure content selectors, verify that they match your rendered VitePress main-content selector.

Sponsors

License

MIT License © 2026-PRESENT Estéban Soubiran