Docusaurus v2 Integration

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.js
module.exports = {
plugins: ["posthog-docusaurus"],
themeConfig: {
posthog: {
apiKey: "<ph_project_api_key>",
appUrl: "<ph_instance_address>", // optional
enableInDevelopment: false // optional
}
}
};

This will automatically start tracking pageviews, clicks and more.

For instructions on the JS library itself, see JS Library.



Was this page helpful?