Produces documentation for the platform API, the set of actions and events available in clients through the message bus.
When run within a project (such as metamask-extension or metamask-mobile), this tool looks for messenger action and event types declared within TypeScript source and declaration files within MetaMask NPM packages. It extracts all of the JSDoc from these actions and events, then outputs them into a searchable Docusaurus site.
- Add this package as a dependency (
yarn add --dev @metamask/platform-api-docsornpm install --save-dev @metamask/platform-api-docs). - Add a script to your project's
package.json. For example:{ "scripts": { "docs:platform-api:build": "platform-api-docs --build --project-label MyProject" } }
platform-api-docs [project-path] [options]
Arguments:
project-path Path to the project to scan (default: current directory)
Options:
--build Generate docs and build static site
--serve Generate docs, build, and serve static site
--dev Generate docs and start dev server with hot reload
--scan-dir <dir> Extra source directory to scan (repeatable)
--output <dir> Output directory (default: <project-path>/.platform-api-docs)
--project-label <label> Short label identifying the project (e.g. "Core", "Extension")
--help Show this help message
This package is part of a monorepo. Instructions for contributing can be found in the monorepo README.