https://github.com/posthog/posthog-docusaurus
🦔 PostHog plugin for Docusaurus v2
https://github.com/posthog/posthog-docusaurus
Last synced: 9 months ago
JSON representation
🦔 PostHog plugin for Docusaurus v2
- Host: GitHub
- URL: https://github.com/posthog/posthog-docusaurus
- Owner: PostHog
- License: mit
- Created: 2020-06-18T10:24:30.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-03-18T08:12:43.000Z (10 months ago)
- Last Synced: 2025-04-02T22:43:28.385Z (9 months ago)
- Language: JavaScript
- Size: 244 KB
- Stars: 8
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PostHog plugin for Docusaurus
Easily track and improve your Docusaurus site with PostHog. See [our docs on this plugin](https://posthog.com/docs/libraries/docusaurus) for more information.
## Installing the plugin
```bash
npm install posthog-docusaurus --save
```
or
```bash
yarn add posthog-docusaurus
```
## Configuring the plugin
```javascript
// docusaurus.config.js
module.exports = {
plugins: [
[
"posthog-docusaurus",
{
apiKey: "",
appUrl: "", // optional, defaults to "https://us.i.posthog.com"
enableInDevelopment: false, // optional
},
],
],
};
```
> **Note:**You can pass additional PostHog [config options](/docs/libraries/js#config) 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.