Skip to content

Auto-generated API Docs with Starlight TypeDoc

If you maintain a TypeScript project, keeping API documentation in sync with code is challenging. starlight-typedoc seamlessly integrates TypeDoc generated documentation into your Starlight sidebar.

  • Automation: Generates markdown notes from your TypeScript source.
  • Integration: Pages appear natively in your Starlight structure.
  • Type Safety: Documentation that accurately reflects your types.

It requires typedoc and the plugin:

Terminal window
npm install typedoc starlight-typedoc
import starlightTypeDoc from 'starlight-typedoc';
// ...
plugins: [
starlightTypeDoc({
entryPoints: ['./src/index.ts'],
tsconfig: './tsconfig.json',
}),
],

This will automatically create a new section in your documentation for your API reference!