Skip to content

Configuration

Pass options to starlightCompass() in your Starlight configuration:

astro.config.mjs
starlight({
plugins: [
starlightCompass({
audit: { failOn: "warning" },
devToolbar: true,
provider: typesafe({ model: "jev-1.13.0" }),
rules: [diataxis({ minConfidence: 0.7 })],
}),
],
});

Type: object

Options for audits.

Type: "error" | "warning" | "never"
Default: "error"

The lowest finding level that fails an audit. With "never", audits only report findings.

Type: boolean
Default: true

Whether to add the Compass app to the Astro dev toolbar. The app is only added when the provider is configured.

Type: CompassProvider
Default: typesafe()

The provider answering the questions of every rule. See Providers.

Type: CompassRule[]
Default: [diataxis()]

The rules reviewing every page. Setting this option replaces the default rules. See Rules.

Compass reads environment variables from the shell and from .env, .env.local, .env.[mode] and .env.[mode].local files in the project root, like Vite. Variables set in the shell take precedence.

Set to 1 or true to run an audit at the end of astro build. The build fails if the provider is not configured.

The API key read by the typesafe() provider.

Extend your docs schema with compassSchema() from starlight-compass/schema to add the following fields:

src/content.config.ts
docsSchema({ extend: compassSchema() });

Type: "tutorial" | "how-to" | "reference" | "explanation" | false

The documentation type the page is meant to be, checked by the diataxis rule. Set it to false to skip the rule for this page.