posthog-docusaurus

2.0.2 • Public • Published

PostHog plugin for Docusaurus

Easily track and improve your Docusaurus site with PostHog. See our docs on this plugin for more information.

Installing the plugin

npm install posthog-docusaurus --save

or

yarn add posthog-docusaurus

Configuring the plugin

// docusaurus.config.js
module.exports = {
  plugins: [
    [
      "posthog-docusaurus",
      {
        apiKey: "<ph_project_api_key>",
        appUrl: "<ph_client_api_host>", // optional, defaults to "https://us.i.posthog.com"
        enableInDevelopment: false, // optional
      },
    ],
  ],
};

**Note:**You can pass additional PostHog config options to the plugin, but they are passed through JSON.stringify(), so functions (such as sanitize_properties) are not supported.

Using the plugin

Once running, this autocaptures pageviews, events, and session replay (if enabled) and enables usage of other PostHog features like surveys.

Readme

Keywords

none

Package Sidebar

Install

npm i posthog-docusaurus

Weekly Downloads

4,313

Version

2.0.2

License

MIT

Unpacked Size

6.74 kB

Total Files

5

Last publish

Collaborators

  • mariusandra
  • timgl