posthog-node 2.0.0-alpha9 → 2.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 +25 -0
- package/README.md +0 -2
- package/index.ts +0 -3
- package/lib/index.cjs.js +950 -91
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +87 -11
- package/lib/index.esm.js +949 -89
- package/lib/index.esm.js.map +1 -1
- package/lib/posthog-core/src/index.d.ts +19 -6
- package/lib/posthog-core/src/types.d.ts +6 -2
- package/lib/posthog-node/index.d.ts +0 -2
- package/lib/posthog-node/src/feature-flags.d.ts +50 -0
- package/lib/posthog-node/src/fetch.d.ts +2 -0
- package/lib/posthog-node/src/posthog-node.d.ts +32 -5
- package/lib/posthog-node/src/types.d.ts +69 -6
- package/package.json +4 -7
- package/src/feature-flags.ts +412 -0
- package/src/fetch.ts +20 -0
- package/src/posthog-node.ts +190 -32
- package/src/types.ts +72 -8
- package/test/feature-flags.spec.ts +3190 -0
- package/test/posthog-node.spec.ts +317 -40
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# 2.1.0 - 2022-09-08
|
|
2
|
+
|
|
3
|
+
1. Swaps `unidici` for `axios` in order to support older versions of Node
|
|
4
|
+
2. The `fetch` implementation can be overridden as an option for those who wish to use an alternative implementation
|
|
5
|
+
3. Fixes the minimum Node version to >=14.17.0
|
|
6
|
+
|
|
7
|
+
# 2.0.2 - 2022-08-23
|
|
8
|
+
|
|
9
|
+
1. Removes references to `cli.js`
|
|
10
|
+
2. Removes default `PostHogGlobal` export, and unifies import signature for `typescript`, `commonjs` and `esm` builds.
|
|
11
|
+
|
|
12
|
+
# 2.0.1 - 2022-08-15
|
|
13
|
+
|
|
14
|
+
Breaking changes:
|
|
15
|
+
|
|
16
|
+
1. Feature flag defaults are no more. When we fail to compute any flag, we return `undefined`. All computed flags return either `true`, `false` or `String`.
|
|
17
|
+
2. Minimum PostHog version requirement is 1.38
|
|
18
|
+
3. Default polling interval for feature flags is now set at 30 seconds. If you don't want local evaluation, don't set a personal API key in the library.
|
|
19
|
+
4. The `callback` parameter passed as an optional last argument to most of the methods is no longer supported
|
|
20
|
+
5. The CLI is no longer supported
|
|
21
|
+
|
|
22
|
+
What's new:
|
|
23
|
+
|
|
24
|
+
1. You can now evaluate feature flags locally (i.e. without sending a request to your PostHog servers) by setting a personal API key, and passing in groups and person properties to `isFeatureEnabled` and `getFeatureFlag` calls.
|
|
25
|
+
2. Introduces a `getAllFlags` method that returns all feature flags. This is useful for when you want to seed your frontend with some initial flags, given a user ID.
|
package/README.md
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
# PostHog Node.js
|
|
2
2
|
|
|
3
|
-
> 🚧 This is a WIP. Currently the only officially supported way of using PostHog on the web is [posthog-node](https://github.com/PostHog/posthog-node)
|
|
4
|
-
|
|
5
3
|
Please see the main [PostHog docs](https://www.posthog.com/docs).
|
|
6
4
|
|
|
7
5
|
Specifically, the [Node.js integration](https://posthog.com/docs/integrate/server/node) details.
|
package/index.ts
CHANGED