Skip to content

This only links to pages of the documentation. It does not write answers.

Install Compass

Tutorial

In this tutorial, you install Starlight Compass, prepare your content collection, and choose the provider that answers its questions. Then you review your first page.

A Starlight website. If you don’t have one yet, follow the “Getting Started” guide in the Starlight docs.

  1. Install the package:

    Terminal window
    npm install starlight-compass
  2. Extend your content collection schema so that pages can declare their documentation type:

    src/content.config.ts
    import { docsLoader } from "@astrojs/starlight/loaders";
    import { docsSchema } from "@astrojs/starlight/schema";
    import { defineCollection } from "astro:content";
    import { compassSchema } from "starlight-compass/schema";
    export const collections = {
    docs: defineCollection({
    loader: docsLoader(),
    schema: docsSchema(),
    schema: docsSchema({ extend: compassSchema() }),
    }),
    };

Compass sends its questions about your pages to a provider, which you add to your Starlight configuration in the next step. Choose the one that fits you:

Need another API? Write your own provider.