Easily track and improve your Docusaurus site with PostHog. See our docs on this plugin for more information.
npm install posthog-docusaurus --save
or
yarn add posthog-docusaurus
// 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 assanitize_properties
) are not supported.
Once running, this autocaptures pageviews, events, and session replay (if enabled) and enables usage of other PostHog features like surveys.