Docusaurus v2 integration
Last updated:
This is a community integration that is not maintained by the PostHog core team.
Install
yarn add posthog-docusaurus
or
npm install --save posthog-docusaurus
How to use
// in docusaurus.config.jsmodule.exports = {plugins: ["posthog-docusaurus"],themeConfig: {posthog: {apiKey: "<ph_project_api_key>",appUrl: "<ph_instance_address>", // optionalenableInDevelopment: false // optional}}};
This will automatically start tracking pageviews, clicks and more.
For instructions on the JS library itself, see JS library.