On this page

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

Install

Terminal
yarn add posthog-docusaurus

or

Terminal
npm install --save posthog-docusaurus

How to use

JavaScript
// in docusaurus.config.js
module.exports = {
plugins: [
[
"posthog-docusaurus",
{
apiKey: "<ph_project_api_key>'",
appUrl: "<ph_instance_address>", // optional
enableInDevelopment: false, // optional
// other options are passed to posthog-js init as is
},
],
],
};

This will automatically start tracking pageviews, clicks and more.

For more instructions, see the browser JS library.

Questions?

Was this page useful?

Next article

How to set up Python feature flags in Flask

Feature flags make it easy to conditionally run code and show content based on users or conditions. In this tutorial, we show how to create a basic Python Flask app, add PostHog, and set up feature flags to conditionally show content in the app. Creating a Flask app and adding PostHog To showcase feature flags, we use Flask , a Python web framework, to create an app. To start, we create a folder for our app named flag-demo and create a file named hello.py in that folder. Next, create a…

Read next article