@molecule/app-analytics-posthog 1.0.2 → 1.0.5
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.
- package/LICENSE +111 -24
- package/README.md +35 -33
- package/dist/provider.d.ts +2 -0
- package/dist/provider.d.ts.map +1 -1
- package/dist/provider.js +44 -1
- package/dist/provider.js.map +1 -1
- package/package.json +6 -6
package/LICENSE
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
|
|
1
2
|
Apache License
|
|
2
3
|
Version 2.0, January 2004
|
|
3
4
|
http://www.apache.org/licenses/
|
|
@@ -34,21 +35,33 @@
|
|
|
34
35
|
|
|
35
36
|
"Work" shall mean the work of authorship, whether in Source or
|
|
36
37
|
Object form, made available under the License, as indicated by a
|
|
37
|
-
copyright notice that is included in or attached to the work
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
38
40
|
|
|
39
41
|
"Derivative Works" shall mean any work, whether in Source or Object
|
|
40
42
|
form, that is based on (or derived from) the Work and for which the
|
|
41
43
|
editorial revisions, annotations, elaborations, or other modifications
|
|
42
|
-
represent, as a whole, an original work of authorship.
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
49
62
|
|
|
50
63
|
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
51
|
-
on behalf of whom a Contribution has been received by
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
52
65
|
subsequently incorporated within the Work.
|
|
53
66
|
|
|
54
67
|
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
@@ -61,8 +74,18 @@
|
|
|
61
74
|
3. Grant of Patent License. Subject to the terms and conditions of
|
|
62
75
|
this License, each Contributor hereby grants to You a perpetual,
|
|
63
76
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
64
|
-
|
|
65
|
-
and otherwise transfer the Work
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
66
89
|
|
|
67
90
|
4. Redistribution. You may reproduce and distribute copies of the
|
|
68
91
|
Work or Derivative Works thereof in any medium, with or without
|
|
@@ -84,23 +107,87 @@
|
|
|
84
107
|
(d) If the Work includes a "NOTICE" text file as part of its
|
|
85
108
|
distribution, then any Derivative Works that You distribute must
|
|
86
109
|
include a readable copy of the attribution notices contained
|
|
87
|
-
within such NOTICE file
|
|
88
|
-
|
|
89
|
-
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
90
138
|
|
|
91
139
|
6. Trademarks. This License does not grant permission to use the trade
|
|
92
|
-
names, trademarks, service marks, or product names of the Licensor
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
93
143
|
|
|
94
144
|
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
95
|
-
agreed to in writing, Licensor provides the Work
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
104
191
|
|
|
105
192
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
106
193
|
you may not use this file except in compliance with the License.
|
package/README.md
CHANGED
|
@@ -3,17 +3,17 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
|
3
3
|
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
4
|
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
5
|
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
-
Generated: 2026-
|
|
6
|
+
Generated: 2026-11-01T03:27:30.420Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/app-analytics-posthog
|
|
10
10
|
|
|
11
|
+
PostHog analytics provider for molecule.dev frontend.
|
|
12
|
+
|
|
11
13
|
> **Auto-generated, AI-first package reference** for the [molecule.dev](https://molecule.dev) ecosystem.
|
|
12
14
|
> It is written to be read by coding agents as much as by people, and is generated from this
|
|
13
15
|
> package's source — edit `src/index.ts` JSDoc, not this file.
|
|
14
16
|
|
|
15
|
-
PostHog analytics provider for molecule.dev frontend.
|
|
16
|
-
|
|
17
17
|
## Quick Start
|
|
18
18
|
|
|
19
19
|
```typescript
|
|
@@ -45,6 +45,35 @@ npm install @molecule/app-analytics-posthog @molecule/app-analytics posthog-js
|
|
|
45
45
|
|
|
46
46
|
### Interfaces
|
|
47
47
|
|
|
48
|
+
#### `PostHogOptions`
|
|
49
|
+
|
|
50
|
+
Options for creating a PostHog provider.
|
|
51
|
+
|
|
52
|
+
```typescript
|
|
53
|
+
interface PostHogOptions {
|
|
54
|
+
apiKey?: string
|
|
55
|
+
host?: string
|
|
56
|
+
autocapture?: boolean
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
#### `AnalyticsUserProps`
|
|
61
|
+
|
|
62
|
+
User properties for analytics identification.
|
|
63
|
+
|
|
64
|
+
```typescript
|
|
65
|
+
interface AnalyticsUserProps {
|
|
66
|
+
/** Unique user identifier. */
|
|
67
|
+
userId: string
|
|
68
|
+
/** User email address. */
|
|
69
|
+
email?: string
|
|
70
|
+
/** User display name. */
|
|
71
|
+
name?: string
|
|
72
|
+
/** Arbitrary key-value traits to associate with the user. */
|
|
73
|
+
traits?: Record<string, unknown>
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
48
77
|
#### `AnalyticsEvent`
|
|
49
78
|
|
|
50
79
|
Event properties for analytics tracking.
|
|
@@ -141,35 +170,6 @@ interface AnalyticsProvider {
|
|
|
141
170
|
}
|
|
142
171
|
```
|
|
143
172
|
|
|
144
|
-
#### `AnalyticsUserProps`
|
|
145
|
-
|
|
146
|
-
User properties for analytics identification.
|
|
147
|
-
|
|
148
|
-
```typescript
|
|
149
|
-
interface AnalyticsUserProps {
|
|
150
|
-
/** Unique user identifier. */
|
|
151
|
-
userId: string
|
|
152
|
-
/** User email address. */
|
|
153
|
-
email?: string
|
|
154
|
-
/** User display name. */
|
|
155
|
-
name?: string
|
|
156
|
-
/** Arbitrary key-value traits to associate with the user. */
|
|
157
|
-
traits?: Record<string, unknown>
|
|
158
|
-
}
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
#### `PostHogOptions`
|
|
162
|
-
|
|
163
|
-
Options for creating a PostHog provider.
|
|
164
|
-
|
|
165
|
-
```typescript
|
|
166
|
-
interface PostHogOptions {
|
|
167
|
-
apiKey?: string
|
|
168
|
-
host?: string
|
|
169
|
-
autocapture?: boolean
|
|
170
|
-
}
|
|
171
|
-
```
|
|
172
|
-
|
|
173
173
|
### Functions
|
|
174
174
|
|
|
175
175
|
#### `createProvider(options)`
|
|
@@ -194,6 +194,8 @@ a bonds.ts setup function) does NOT re-configure the SDK: `posthog-js`'s
|
|
|
194
194
|
is a no-op that keeps the FIRST configuration. This logs one actionable
|
|
195
195
|
warning naming the ignored call before the SDK's own generic warning fires.
|
|
196
196
|
|
|
197
|
+
SDK-added location/referrer properties are scrubbed by the installed `before_send` hook.
|
|
198
|
+
|
|
197
199
|
```typescript
|
|
198
200
|
function createProvider(options?: PostHogOptions): AnalyticsProvider
|
|
199
201
|
```
|
|
@@ -243,7 +245,7 @@ if (apiKey) {
|
|
|
243
245
|
|
|
244
246
|
Peer dependencies:
|
|
245
247
|
|
|
246
|
-
- `@molecule/app-analytics` ^1.
|
|
248
|
+
- `@molecule/app-analytics` ^1.1.1
|
|
247
249
|
|
|
248
250
|
### Environment Variables
|
|
249
251
|
|
package/dist/provider.d.ts
CHANGED
|
@@ -28,6 +28,8 @@ import type { PostHogOptions } from './types.js';
|
|
|
28
28
|
* is a no-op that keeps the FIRST configuration. This logs one actionable
|
|
29
29
|
* warning naming the ignored call before the SDK's own generic warning fires.
|
|
30
30
|
*
|
|
31
|
+
* SDK-added location/referrer properties are scrubbed by the installed `before_send` hook.
|
|
32
|
+
*
|
|
31
33
|
* @param options - PostHog configuration including `apiKey`, optional `host`, and `autocapture`.
|
|
32
34
|
* @returns An `AnalyticsProvider` backed by the PostHog browser SDK.
|
|
33
35
|
*/
|
package/dist/provider.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAGV,iBAAiB,EAElB,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAGV,iBAAiB,EAElB,MAAM,yBAAyB,CAAA;AAGhC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAsChD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,cAAc,GAAI,UAAU,cAAc,KAAG,iBA+GzD,CAAA;AAID,6DAA6D;AAC7D,eAAO,MAAM,QAAQ,EAAE,iBAUrB,CAAA"}
|
package/dist/provider.js
CHANGED
|
@@ -6,6 +6,31 @@
|
|
|
6
6
|
* @module
|
|
7
7
|
*/
|
|
8
8
|
import { posthog } from 'posthog-js';
|
|
9
|
+
import { snapshotAnalyticsSdkUrls } from '@molecule/app-analytics';
|
|
10
|
+
/** Runs after posthog-js has added location, referrer, session and person properties. */
|
|
11
|
+
const scrubSdkUrls = (event) => snapshotAnalyticsSdkUrls(event);
|
|
12
|
+
const DETACHED_OBSERVERS = Symbol.for('@molecule/app-analytics-posthog/detached-observers');
|
|
13
|
+
/** The production ESM build minifies the emitter's field name, but not its public shape. */
|
|
14
|
+
const captureObserverEmitter = () => Object.values(Object.getOwnPropertyDescriptors(posthog))
|
|
15
|
+
.map((descriptor) => descriptor.value)
|
|
16
|
+
.find((value) => value !== null &&
|
|
17
|
+
typeof value === 'object' &&
|
|
18
|
+
typeof Reflect.get(value, 'emit') === 'function' &&
|
|
19
|
+
typeof Reflect.get(value, 'on') === 'function');
|
|
20
|
+
/** eventCaptured is an observer API: mutations must not reach the already-captured request. */
|
|
21
|
+
const detachCaptureObservers = () => {
|
|
22
|
+
const emitter = captureObserverEmitter();
|
|
23
|
+
if (!emitter || emitter[DETACHED_OBSERVERS])
|
|
24
|
+
return;
|
|
25
|
+
const emit = emitter.emit;
|
|
26
|
+
Object.defineProperty(emitter, DETACHED_OBSERVERS, { value: true });
|
|
27
|
+
emitter.emit = function (event, ...args) {
|
|
28
|
+
const captured = event === 'eventCaptured' && args.length > 0
|
|
29
|
+
? [snapshotAnalyticsSdkUrls(args[0]), ...args.slice(1)]
|
|
30
|
+
: args;
|
|
31
|
+
return Reflect.apply(emit, this, [event, ...captured]);
|
|
32
|
+
};
|
|
33
|
+
};
|
|
9
34
|
/**
|
|
10
35
|
* Creates a PostHog analytics provider using `posthog-js`. Initializes the SDK with the
|
|
11
36
|
* provided API key and host, and returns an `AnalyticsProvider` that maps molecule events to
|
|
@@ -27,6 +52,8 @@ import { posthog } from 'posthog-js';
|
|
|
27
52
|
* is a no-op that keeps the FIRST configuration. This logs one actionable
|
|
28
53
|
* warning naming the ignored call before the SDK's own generic warning fires.
|
|
29
54
|
*
|
|
55
|
+
* SDK-added location/referrer properties are scrubbed by the installed `before_send` hook.
|
|
56
|
+
*
|
|
30
57
|
* @param options - PostHog configuration including `apiKey`, optional `host`, and `autocapture`.
|
|
31
58
|
* @returns An `AnalyticsProvider` backed by the PostHog browser SDK.
|
|
32
59
|
*/
|
|
@@ -75,7 +102,22 @@ export const createProvider = (options) => {
|
|
|
75
102
|
...(options?.host ? { api_host: options.host } : {}),
|
|
76
103
|
autocapture: options?.autocapture ?? false,
|
|
77
104
|
capture_pageview: false, // We handle page views manually via auto-tracking
|
|
105
|
+
before_send: scrubSdkUrls,
|
|
78
106
|
});
|
|
107
|
+
// A pre-initialized singleton keeps its first config. Compose in that case and put this hook
|
|
108
|
+
// LAST so another hook cannot re-add a location/referrer credential after the scrub.
|
|
109
|
+
const configuredBeforeSend = posthog.config?.before_send;
|
|
110
|
+
if (configuredBeforeSend !== scrubSdkUrls && typeof posthog.set_config === 'function') {
|
|
111
|
+
const previous = Array.isArray(configuredBeforeSend)
|
|
112
|
+
? configuredBeforeSend
|
|
113
|
+
: configuredBeforeSend
|
|
114
|
+
? [configuredBeforeSend]
|
|
115
|
+
: [];
|
|
116
|
+
posthog.set_config({
|
|
117
|
+
before_send: [...previous.filter((hook) => hook !== scrubSdkUrls), scrubSdkUrls],
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
detachCaptureObservers();
|
|
79
121
|
return {
|
|
80
122
|
async identify(user) {
|
|
81
123
|
posthog.identify(user.userId, {
|
|
@@ -88,7 +130,8 @@ export const createProvider = (options) => {
|
|
|
88
130
|
// posthog-js supports a client-set timestamp via CaptureOptions — honor
|
|
89
131
|
// the interface's `timestamp` field instead of silently dropping it.
|
|
90
132
|
if (event.timestamp) {
|
|
91
|
-
|
|
133
|
+
const timestamp = event.timestamp instanceof Date ? event.timestamp : new Date(String(event.timestamp));
|
|
134
|
+
posthog.capture(event.name, event.properties, { timestamp });
|
|
92
135
|
}
|
|
93
136
|
else {
|
|
94
137
|
posthog.capture(event.name, event.properties);
|
package/dist/provider.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAsB,OAAO,EAAE,MAAM,YAAY,CAAA;AAQxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAA;AAIlE,yFAAyF;AACzF,MAAM,YAAY,GAAG,CAAC,KAAoB,EAAiB,EAAE,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAA;AAE7F,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAAC,oDAAoD,CAAC,CAAA;AAM3F,4FAA4F;AAC5F,MAAM,sBAAsB,GAAG,GAAgC,EAAE,CAC/D,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,yBAAyB,CAAC,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1
|
{
|
|
2
2
|
"name": "@molecule/app-analytics-posthog",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "PostHog analytics provider for molecule.dev frontend",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -27,16 +27,16 @@
|
|
|
27
27
|
],
|
|
28
28
|
"license": "Apache-2.0",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"posthog-js": "1.
|
|
30
|
+
"posthog-js": "1.438.21"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@molecule/app-analytics": "^1.
|
|
33
|
+
"@molecule/app-analytics": "^1.1.1"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@molecule/app-analytics": "1.
|
|
37
|
-
"@types/node": "26.
|
|
36
|
+
"@molecule/app-analytics": "1.1.2",
|
|
37
|
+
"@types/node": "26.6.5",
|
|
38
38
|
"typescript": "6.0.3",
|
|
39
|
-
"vitest": "4.1.
|
|
39
|
+
"vitest": "4.1.12"
|
|
40
40
|
},
|
|
41
41
|
"repository": {
|
|
42
42
|
"type": "git",
|