Docusaurus v2 integration

Last updated:

This is a community integration that is not maintained by the PostHog core team.


yarn add posthog-docusaurus


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.

Ask a question