
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
docusaurus-plugin-typedoc
Advanced tools
A Docusaurus plugin to build TypeScript API documentation with TypeDoc.
Install Docusaurus in the root of your project and install the plugin dependencies in the same location as the Docusaurus website directory.
typedoc and typedoc-plugin-markdown are peer dependencies.
npm install docusaurus-plugin-typedoc typedoc typedoc-plugin-markdown@next --save-dev
Add the plugin to docusaurus.config.js and specify the required options (see options).
module.exports = {
plugins: [
[
'docusaurus-plugin-typedoc',
// Plugin / TypeDoc options
{
entryPoints: ['../src/index.ts'],
tsconfig: '../tsconfig.json',
},
],
],
};
TypeDoc will be bootstraped with the Docusaurus start and build cli commands:
"start": "docusaurus start",
"build": "docusaurus build",
Once built the docs will be available at http://localhost:3000/docs/api (or equivalent out directory).
Typical directory structure:
├── docusaurus-website
├── build/ (static site dir)
├── docs/
│ ├── api/ (compiled typedoc markdown)
├── docusaurus.config.js
├── package.json
├── sidebars.js
├──package.json
├──src (typescript source files)
├──tsconfig.json
Options can be declared:
typedoc.json file.typedocOptions key in tsconfig.json.Please see https://typedoc.org/options/configuration for general TypeDoc option configuration.
The following TypeDoc / Markdown plugin options can be passed to config:
The following typedoc-plugin-markdown options are preset with the plugin.
{
"out": "./docs/api",
"hideInPageTOC": true,
"hideBreadcrumbs": true,
"hidePageHeader": true,
"entryFileName": "index.md"
}
Options specific to the plugin should also be declared in the same object.
--sidebarsidebar.autoConfiguration
Set to false to disable sidebar generation. Defaults to true.
sidebar.filteredIds
Ids of pages to be filtered from the sidebar. This would typically be used to filter README or index pages from the sidebar.
sidebar.pretty
Pretty format the sidebar JSON.
Previous versions of this plugin recommended an
autogeneratedsidebar configuration. However we have decided it is more deterministic and configurable to use a manual sidebar configuration with a generated sidebar file.
A docusaurus sidebar file typedoc-sidebar.cjs is published to the relevant output directory along with the generated markdown documentation.
This file should be referenced in sidebars.js using a sidebar slice and can be configured in following ways:
module.exports = {
typedocSidebar: require('./docs/api/typedoc-sidebar.cjs'),
};
module.exports = {
typedocSidebar: {
'Typedoc Docs': require('./docs/api/typedoc-sidebar.cjs'),
},
};
Note the linked category page can be removed from sidebar using
sidebar.filteredIds.
module.exports = {
typedocSidebar: [
{
type: 'category',
label: 'Typedoc Docs',
link: {
type: 'doc',
id: 'api/index',
},
items: require('./docs/api/typedoc-sidebar.cjs'),
},
],
};
Please see https://docusaurus.io/docs/sidebar for sidebar documentation.
A navbar item can be configured in themeConfig options in docusaurus.config.js:
themeConfig: {
navbar: {
items: [
{
to: 'docs/api/', // 'api' is the 'out' directory
activeBasePath: 'docs',
label: 'API',
position: 'left',
},
],
},
},
Please see https://docusaurus.io/docs/api/themes/configuration#navbar-items for navbar documentation.
It is possible to build multi TypeDoc instances by passing in multiple configs with unique ids:
docusaurus.config.js
module.exports = {
plugins: [
[
'docusaurus-plugin-typedoc',
{
id: 'api-1',
entryPoints: ['../api-1/src/index.ts'],
tsconfig: '../api-1/tsconfig.json',
out: 'api-1',
},
],
[
'docusaurus-plugin-typedoc',
{
id: 'api-2',
entryPoints: ['../api-2/src/index.ts'],
tsconfig: '../api-2/tsconfig.json',
out: 'api-2',
},
],
],
};
sidebars.js
module.exports = {
typedocSidebar: {
'API 1': require('./docs/api-1/typedoc-sidebar.cjs'),
'API 2': require('./docs/api-2/typedoc-sidebar.cjs'),
},
};
Watching files is supported by passing in the watch: true option see https://typedoc.org/guides/options/#watch.
Targetting the option in development mode only can be achieved using Node.js Environment Variables:
package.json
"start": "TYPEDOC_WATCH=true docusaurus start",
"build": "TYPEDOC_WATCH=false docusaurus build",
docusaurus.config.js
module.exports = {
plugins: [
[
'docusaurus-plugin-typedoc',
{
entryPoints: ['../src/index.ts'],
tsconfig: '../tsconfig.json',
watch: process.env.TYPEDOC_WATCH,
},
],
],
};
To add frontmatter to page please use typedoc-plugin-frontmatter and add options exposed by the plugin to the config.
FAQs
A Docusaurus plugin to integrate TypeDoc ( + typedoc-plugin-markdown ) into the Docusaurus CLI.
The npm package docusaurus-plugin-typedoc receives a total of 50,027 weekly downloads. As such, docusaurus-plugin-typedoc popularity was classified as popular.
We found that docusaurus-plugin-typedoc demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.