A Starlight plugin that integrates Typesense with the DocSearch interface to add lightning-fast, typo-tolerant search to your Starlight documentation site.
Typesense is an open-source, lightning-fast search engine that delivers instant, typo-tolerant results with minimal setup. It's an open source alternative to Algolia and an easier-to-use alternative to ElasticSearch.
Starlight is a documentation framework built on Astro, focused on performance, accessibility, and customization. It helps developers create elegant, content-rich documentation sites with ease.
Together, Typesense, Starlight and DocSearch provide a seamless way to add powerful, blazingly-fast search to modern documentation websites.
To power the search experience, you'll need to index your site's content into Typesense. There are two ways to do it:
- Built-in indexing: set the plugin's
indexingoption and your site is indexed at the end ofastro build, with one collection per language. No crawler to run or configure. typesense-docsearch-scraper: a crawler that scans your deployed documentation pages, extracts structured content (like titles, headings, and paragraphs), and uploads it into your Typesense collection. EnablefilterByLanguageon multilingual sites to only show results in the current language.
This repository uses Bun workspaces: the plugin lives in packages/starlight-typesense and its documentation site in docs.
bun install
bun run typesense:start # start a local Typesense server with Docker (API key: xyz)
bun run dev # start the docs site
bun run typecheck
bun run test # unit tests
bun run test:integration # integration tests, requires the local Typesense server- Run
bun run changesetto describe your changes, and commit the generated file. - Run
bun run bumpto update the package version and changelog from the changesets, then commit and merge. - Create a GitHub release tagged
v<version>(e.g.v2.0.0). The publish workflow publishes the package to npm with trusted publishing and provenance.
Check out the Getting Started Guide to add Typesense search to your Starlight site quickly.
Licensed under the Apache License 2.0, Copyright © Typesense.
See LICENSE for more information.
