@posthog/rollup-plugin 1.1.6 → 1.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +86 -2
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,3 +1,87 @@
1
- # PostHog Rollup Plugin
1
+ # @posthog/rollup-plugin
2
2
 
3
- Please see the main [PostHog docs](https://www.posthog.com/docs).
3
+ Rollup plugin for uploading source maps to PostHog for error tracking.
4
+
5
+ [SEE FULL DOCS](https://posthog.com/docs/error-tracking/upload-source-maps/rollup)
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install @posthog/rollup-plugin --save-dev
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ Add the plugin to your Rollup configuration:
16
+
17
+ ```javascript
18
+ import posthog from '@posthog/rollup-plugin'
19
+
20
+ export default {
21
+ input: './src/index.ts',
22
+ output: {
23
+ format: 'es',
24
+ dir: 'dist',
25
+ },
26
+ plugins: [
27
+ posthog({
28
+ personalApiKey: process.env.POSTHOG_PERSONAL_API_KEY,
29
+ envId: process.env.POSTHOG_PROJECT_ID,
30
+ sourcemaps: {
31
+ enabled: true,
32
+ project: 'my-app',
33
+ version: '1.0.0',
34
+ },
35
+ }),
36
+ ],
37
+ }
38
+ ```
39
+
40
+ ### Configuration Options
41
+
42
+ | Option | Type | Required | Default | Description |
43
+ | ------------------------------ | ---------------------------------------------------- | -------- | -------------------------- | ------------------------------------------- |
44
+ | `personalApiKey` | `string` | Yes | - | Your PostHog personal API key |
45
+ | `envId` | `string` | Yes | - | Your PostHog project/environment ID |
46
+ | `host` | `string` | No | `https://us.i.posthog.com` | PostHog instance host |
47
+ | `logLevel` | `'debug' \| 'info' \| 'warn' \| 'error' \| 'silent'` | No | `'info'` | Logging verbosity |
48
+ | `cliBinaryPath` | `string` | No | Auto-detected | Path to the PostHog CLI binary |
49
+ | `sourcemaps.enabled` | `boolean` | No | `true` | Enable source map processing |
50
+ | `sourcemaps.project` | `string` | No | - | Project name for source map grouping |
51
+ | `sourcemaps.version` | `string` | No | - | Version identifier for the release |
52
+ | `sourcemaps.deleteAfterUpload` | `boolean` | No | `true` | Delete source maps after upload |
53
+ | `sourcemaps.batchSize` | `number` | No | - | Number of source maps to upload in parallel |
54
+
55
+ ### Full Example
56
+
57
+ ```javascript
58
+ import posthog from '@posthog/rollup-plugin'
59
+ import packageJson from './package.json' with { type: 'json' }
60
+
61
+ export default {
62
+ input: './src/index.ts',
63
+ output: [
64
+ {
65
+ format: 'es',
66
+ dir: 'dist/esm',
67
+ },
68
+ ],
69
+ plugins: [
70
+ posthog({
71
+ personalApiKey: process.env.POSTHOG_PERSONAL_API_KEY,
72
+ envId: process.env.POSTHOG_PROJECT_ID,
73
+ host: process.env.POSTHOG_API_HOST,
74
+ logLevel: 'info',
75
+ sourcemaps: {
76
+ enabled: true,
77
+ project: packageJson.name,
78
+ version: packageJson.version,
79
+ },
80
+ }),
81
+ ],
82
+ }
83
+ ```
84
+
85
+ ## Questions?
86
+
87
+ ### [Check out our community page.](https://posthog.com/docs/error-tracking/upload-source-maps/rollup)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@posthog/rollup-plugin",
3
- "version": "1.1.6",
3
+ "version": "1.1.8",
4
4
  "description": "PostHog Rollup plugin",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,7 +16,7 @@
16
16
  ],
17
17
  "dependencies": {
18
18
  "@posthog/cli": "~0.5.20",
19
- "@posthog/core": "1.9.0"
19
+ "@posthog/core": "1.10.0"
20
20
  },
21
21
  "peerDependencies": {
22
22
  "rollup": ">= 4.0.0"