posthog-js-lite 3.0.1 → 3.1.0
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/CHANGELOG.md +23 -3
- package/README.md +5 -1
- package/lib/index.cjs.js +120 -126
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +25 -17
- package/lib/index.esm.js +120 -126
- package/lib/index.esm.js.map +1 -1
- package/lib/posthog-core/src/index.d.ts +7 -4
- package/lib/posthog-core/src/types.d.ts +19 -14
- package/lib/posthog-web/src/storage.d.ts +1 -1
- package/lib/posthog-web/src/types.d.ts +1 -1
- package/package.json +1 -1
- package/src/storage.ts +1 -1
- package/test/posthog-web.spec.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
# Next
|
|
2
|
+
|
|
3
|
+
# 3.1.0 - 2024-11-21
|
|
4
|
+
|
|
5
|
+
## Changed
|
|
6
|
+
|
|
7
|
+
1. chore: default `captureMode` changed to `json`.
|
|
8
|
+
1. To keep using the `form` mode, just set the `captureMode` option to `form` when initializing the PostHog client.
|
|
9
|
+
2. fix: identify method allows passing a $set_once object
|
|
10
|
+
|
|
11
|
+
# 3.0.2 - 2024-06-15
|
|
12
|
+
|
|
13
|
+
## Fixed
|
|
14
|
+
|
|
15
|
+
1. Fixed and error that prevented localstorage from ever being used and instead falling back to sessionstorage for persistence
|
|
16
|
+
|
|
17
|
+
## Changed
|
|
18
|
+
|
|
19
|
+
1. chore: change host to new address.
|
|
20
|
+
|
|
1
21
|
# 3.0.1 - 2024-04-25
|
|
2
22
|
|
|
3
23
|
1. Prevent double JSON parsing of feature flag payloads, which would convert the payload [1] into 1.
|
|
@@ -56,8 +76,8 @@
|
|
|
56
76
|
|
|
57
77
|
# 2.5.0 - 2023-12-04
|
|
58
78
|
|
|
59
|
-
1.
|
|
60
|
-
2.
|
|
79
|
+
1. Renamed `personProperties` to `setPersonPropertiesForFlags` to match `posthog-js` and more clearly indicated what it does
|
|
80
|
+
2. Renamed `groupProperties` to `setGroupPropertiesForFlags` to match `posthog-js` and more clearly indicated what it does
|
|
61
81
|
|
|
62
82
|
# 2.4.0 - 2023-04-20
|
|
63
83
|
|
|
@@ -88,4 +108,4 @@
|
|
|
88
108
|
|
|
89
109
|
# 2.0.1 - 2023-01-25
|
|
90
110
|
|
|
91
|
-
|
|
111
|
+
1. Ensures the distinctId used in `.groupIdentify` is the same as the currently identified user
|
package/README.md
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
# PostHog Web
|
|
2
2
|
|
|
3
|
-
> 🚧 This is a
|
|
3
|
+
> 🚧 This is a reduced feature set package. Currently the only officially supported feature complete way of using PostHog on the web is [posthog-js](https://github.com/PostHog/posthog-js)
|
|
4
4
|
|
|
5
5
|
This package is currently published to npm as [posthog-js-lite](https://www.npmjs.com/package/posthog-js-lite) and is a simplified version of the recommended and offically supported `posthog-js`.
|
|
6
6
|
|
|
7
|
+
You'd want to use this only if you're very conscious about package sizes, and this reduced feature set (only analytics and feature flags) works for your use case. The most common use case is in chrome extensions.
|
|
8
|
+
|
|
7
9
|
## Installation
|
|
8
10
|
|
|
9
11
|
```bash
|
|
@@ -27,6 +29,8 @@ posthog.capture('my-event', { myProperty: 'foo' })
|
|
|
27
29
|
|
|
28
30
|
// Identify a user (e.g. on login)
|
|
29
31
|
posthog.identify('my-unique-user-id', { email: 'exampke@posthog.com', name: 'Jane Doe' })
|
|
32
|
+
// ...or with Set Once additional properties
|
|
33
|
+
posthog.identify('my-unique-user-id', { $set: { email: 'exampke@posthog.com', name: 'Jane Doe' }, $set_once: { vip: true } })
|
|
30
34
|
|
|
31
35
|
// Reset a user (e.g. on logout)
|
|
32
36
|
posthog.reset()
|