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

@rubixstudios/payload-typesense

v1.6.12

Published

A production-ready search plugin that integrates Typesense with Payload CMS, offering fast, typo-tolerant search with real-time synchronization. This fork by Rubix Studios reduces bloat and introduces targeted changes for improved performance, maintainabi

Readme

PayloadCMS + Typesense Plugin

Rubix Studios' Typesense integration for Payload CMS is built for production search workflows, with a lightweight, modular structure and optional support for advanced capabilities such as vector querying.

The plugin is actively maintained by Rubix Studios.

npm version Release

Installation

pnpm add @rubixstudios/payload-typesense
// payload.config.ts
import { buildConfig } from 'payload/config'
import { typesenseSearch } from '@rubixstudios/payload-typesense'

export default buildConfig({
  plugins: [
    typesenseSearch({
      typesense: {
        apiKey: 'xyz',
        nodes: [
          {
            host: 'localhost',
            port: 8108,
            protocol: 'http',
          },
        ],
      },
      collections: {
        posts: {
          enabled: true,
          searchFields: ['title', 'content'],
          facetFields: ['category', 'status'],
          displayName: 'Blog Posts',
          icon: '📝',
          syncLimit: 500, // Overrides the default sync limit of 1000
        },
      },
      // This feature is experimental
      vectorSearch: {
        enabled: true, // Enables vector-based semantic search
        embedFrom: ['title', 'content'], // Omit to fall back to collection searchFields
        embeddingModel: 'azure/text-embedding-ada-002',
        modelConfig: {
          api_key: 'your-api-key',
          url: 'https://modelendpoint.com/openai',
        },
    }),
  ],
})
import { HeadlessSearchInput } from '@rubixstudios/payload-typesense'

export function GlobalSearchPage() {
  return (
    <HeadlessSearchInput
      baseUrl="http://localhost:3000"
      theme="modern" // Available themes: "modern" | "dark"
      placeholder="Search everything..."
      onResultClick={(result) => {
        console.log('Selected document:', result.document)
      }}
    />
  )
}

export function CollectionSearch() {
  return (
    <HeadlessSearchInput
      baseUrl="http://localhost:3000"
      collections={['posts', 'products']}
      placeholder="Search posts and products..."
      onResultClick={(result) => {
        console.log('Selected document:', result.document)
      }}
    />
  )
}

export function VectorSearch() {
  return (
    <HeadlessSearchInput
      baseUrl="http://localhost:3000"
      vector={true} // Vector search enabled
      collections={['posts', 'products']}
      placeholder="Search posts and products..."
      onResultClick={(result) => {
        console.log('Selected document:', result.document)
      }}
    />
  )
}

Features

  • Performance
    Sub-millisecond search responses with optimized request handling.
  • Flexible Search
    Single-collection, multi-collection, or universal search using one component.
  • Vector Search
    Optional semantic search using embeddings, with graceful fallback to keyword search.
  • Modern UI
    Headless, responsive implementation compatible with Tailwind CSS.
  • Real-Time Synchronisation
    Continuous indexing and sync with Payload CMS.
  • Efficient Caching
    In-memory caching with configurable TTL and race-condition safeguards.
  • Production Ready
    Robust error handling, deployment-safe defaults, and platform compatibility.
  • Tree-Shakable Architecture
    Modular design enabling smaller bundles and selective feature usage.

Endpoints

  • GET /api/search - Universal search across all collections
  • GET /api/search/{collection} - Search specific collection
  • POST /api/search/{collection} - Advanced search with filters
  • GET /api/search/{collection}/suggest - Search suggestions
  • GET /api/search/collections - Collection metadata
  • GET /api/search/health - Health check

Components

  • HeadlessSearchInput: Single component supporting all search patterns:
  • Collections: collections={['posts', 'products']} - Smart filtering with universal search
  • Universal Search: No collection props - Search across all collections
  • Complete UI Control: Customizable rendering with comprehensive theme system

Themes

The plugin includes a powerful theme system with 2 pre-built themes and unlimited customization:

Pre-built

// Modern theme (default)
<HeadlessSearchInput theme="modern" />

// Dark theme
<HeadlessSearchInput theme="dark" />

Custom

const customTheme = {
  theme: 'modern',
  colors: {
    inputBorderFocus: '#10b981',
    inputBackground: '#f0fdf4',
    resultsBackground: '#f0fdf4',
  },
  spacing: {
    inputPadding: '1rem 1.25rem',
    inputBorderRadius: '1.5rem',
  },
  enableAnimations: true,
  enableShadows: true,
}

<HeadlessSearchInput theme={customTheme} />

Theme Features

  • 2 Pre-built Themes: Modern, Dark
  • Unlimited Customization: Override any color, spacing, typography, or animation
  • Performance Options: Disable animations/shadows for better performance
  • Responsive Design: Automatic mobile optimization
  • CSS Variables: Advanced styling with CSS custom properties
  • TypeScript Support: Full type safety for all theme configurations

Production

  • Race Condition Protection: ensureCollection prevents startup crashes
  • Type Safety: Proper Payload CMS types prevent runtime errors
  • Document Validation: Filters malformed data before sync
  • Graceful Degradation: Silent failures don't break Payload operations

Developer

  • Smaller Components: Easier to understand and maintain
  • Maintainable: Single Responsibility Principle enforced
  • Well-Documented: Clear separation of concerns

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For support or inquiries:

Author

Rubix Studios
https://rubixstudios.com.au

Acknowledgments