About VitePress
The vitepress-plugin-moss package adds real-time semantic search to any VitePress documentation site. It auto-indexes your Markdown content at build time, provides a search UI activated by Ctrl+K / Cmd+K, and uses a two-phase search strategy: cloud-based search on first query while the WASM runtime downloads, then fully local sub-10ms search once loaded.
Why Use Moss with VitePress
01
Drop-in Vite plugin
Add `mossIndexerPlugin()` to your VitePress config and search is live
02
Auto-indexes all Markdown content at build time
No manual document management needed
03
Two-phase search strategy
Cloud hot-path on first query, then fully local WASM once downloaded
04
Built-in search UI with Ctrl+K / Cmd+K keyboard shortcut
No custom components needed
05
Sub-10ms local search after WASM initialization
Instant results as users type
Quick Start
import { defineConfig } from 'vitepress'
import { mossIndexerPlugin } from 'vitepress-plugin-moss'
export default defineConfig({
title: 'My Docs',
themeConfig: {
search: {
provider: 'moss' as any,
options: {
projectId: process.env.MOSS_PROJECT_ID!,
projectKey: process.env.MOSS_PROJECT_KEY!,
indexName: process.env.MOSS_INDEX_NAME!,
},
},
},
vite: {
plugins: [mossIndexerPlugin()],
},
})Get Started in 3 Steps
01
Install the plugin
Run npm install vitepress-plugin-moss to add the search plugin to your VitePress project.
02
Add to VitePress config
Import mossIndexerPlugin and add it to the vite.plugins array in .vitepress/config.ts. Pass your project credentials and index name.
03
Build and search
Run vitepress build. The plugin auto-indexes your Markdown content. Users can press Ctrl+K to search instantly.
Frequently asked questions
Ready to ship faster AI products?
Moss gives you production-ready semantic retrieval without infrastructure complexity.