PostHog plugin for Docusaurus v2
Please see the main PostHog docs.
Specifically, the Docusaurus v2 integration details.
Installing the plugin
yarn add posthog-docusaurusor
npm install posthog-docusaurus --saveConfiguring the plugin
// docusaurus.config.js
module.exports = {
plugins: ["posthog-docusaurus"],
themeConfig: {
posthog: {
apiKey: "YOURAPIKEY",
appUrl: "https://app.posthog.com", // optional
enableInDevelopment: false, // optional
// other options are passed to posthog-js init as is
}
}
};Using the plugin
That's it! You're ready to go!