Integrations and plugins
Stainless Docs is built on top of Astro, so you can take advantage of a broad ecosystem of existing Astro integrations to extend and enhance the functionality of your site.
Additionally, Stainless Docs provides experimental support for using Starlight plugins.
Astro integrations
Section titled “Astro integrations”Stainless Docs supports most Astro integrations. If you’re hosting your site with Stainless, the integrations you add must support a static output target.
To add an Astro integration, add it to the integrations array in astro.config.ts file alongside the stainlessDocs integration.
import { defineConfig } from "astro/config";import { generateAPIReferenceItems, stainlessDocs,} from "@stainless/stl-starlight/stainless-docs";
// https://astro.build/configexport default defineConfig({ integrations: [ stainlessDocs({ ... }), anotherIntegration(), ],});Confirmed working integrations
Section titled “Confirmed working integrations”Below is a non-exhaustive list of the integrations that we’ve tested and confirmed work with Stainless Docs:
If you want to use an integration not listed above we encourage you to give it a try. Chances are it will work, but if it doesn’t please let us know!
Starlight plugins (experimental)
Section titled “Starlight plugins (experimental)”Stainless Docs currently uses Starlight under the hood and has experimental support for Starlight plugins.
To add a Starlight plugin to your Stainless Docs site, first import it at the top of your astro.config.ts file, then add it to the experimental.starlightCompat.plugins array inside your stainlessDocs integration.
Here’s an example that shows how to add the starlight-links-validator plugin:
import { defineConfig } from "astro/config";import { stainlessDocs } from "@stainless-api/docs";import starlightLinksValidator from "starlight-links-validator";
export default defineConfig({ integrations: [ stainlessDocs({ title: "My Docs", experimental: { starlightCompat: { plugins: [starlightLinksValidator()], }, }, }), ],});