Docusaurus

Last updated:

|Edit 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 Framer analytics, session replay, and more

Framer is a popular no-code site builder that makes it easy to design a high-quality site. To maximize the effectiveness of your Framer site, you need analytics to see how users are using it. Data like pageviews, button clicks, and session replays are critical to improving your site. This tutorial shows you how to set up PostHog on your Framer site for capturing events, session replays, and implementing feature flags. Adding PostHog to your Framer site First, sign up to PostHog and copy…

Read next article