posthog-node 3.1.1 → 3.1.2

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.
@@ -74,6 +74,7 @@ export declare abstract class PostHogCore extends PostHogCoreStateless {
74
74
  private flagCallReported;
75
75
  protected _decideResponsePromise?: Promise<PostHogDecideResponse | undefined>;
76
76
  protected _sessionExpirationTimeSeconds: number;
77
+ protected sessionProps: PostHogEventProperties;
77
78
  constructor(apiKey: string, options?: PosthogCoreOptions);
78
79
  protected setupBootstrap(options?: Partial<PosthogCoreOptions>): void;
79
80
  private get props();
@@ -83,15 +84,19 @@ export declare abstract class PostHogCore extends PostHogCoreStateless {
83
84
  on(event: string, cb: (...args: any[]) => void): () => void;
84
85
  reset(propertiesToKeep?: PostHogPersistedProperty[]): void;
85
86
  protected getCommonEventProperties(): any;
86
- private enrichProperties;
87
+ enrichProperties(properties?: PostHogEventProperties): any;
87
88
  getSessionId(): string | undefined;
88
89
  resetSessionId(): void;
89
90
  getAnonymousId(): string;
90
91
  getDistinctId(): string;
92
+ unregister(property: string): void;
91
93
  register(properties: {
92
94
  [key: string]: any;
93
95
  }): void;
94
- unregister(property: string): void;
96
+ registerForSession(properties: {
97
+ [key: string]: any;
98
+ }): void;
99
+ unregisterForSession(property: string): void;
95
100
  /***
96
101
  *** TRACKING
97
102
  ***/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "posthog-node",
3
- "version": "3.1.1",
3
+ "version": "3.1.2",
4
4
  "description": "PostHog Node.js integration",
5
5
  "repository": "PostHog/posthog-node",
6
6
  "scripts": {
@@ -207,6 +207,7 @@ export class PostHog extends PostHogCoreStateless implements PostHogNodeV1 {
207
207
  $feature_flag: key,
208
208
  $feature_flag_response: response,
209
209
  locally_evaluated: flagWasLocallyEvaluated,
210
+ [`$feature/${key}`]: response,
210
211
  },
211
212
  groups,
212
213
  disableGeoip,
@@ -555,6 +555,7 @@ describe('PostHog Node.js', () => {
555
555
  $lib: 'posthog-node',
556
556
  $lib_version: '1.2.3',
557
557
  locally_evaluated: true,
558
+ '$feature/beta-feature': true,
558
559
  }),
559
560
  },
560
561
  ])
@@ -610,6 +611,7 @@ describe('PostHog Node.js', () => {
610
611
  properties: expect.objectContaining({
611
612
  $feature_flag: 'beta-feature',
612
613
  $feature_flag_response: true,
614
+ '$feature/beta-feature': true,
613
615
  $lib: 'posthog-node',
614
616
  $lib_version: '1.2.3',
615
617
  locally_evaluated: true,
@@ -652,6 +654,7 @@ describe('PostHog Node.js', () => {
652
654
  $lib: 'posthog-node',
653
655
  $lib_version: '1.2.3',
654
656
  locally_evaluated: true,
657
+ '$feature/beta-feature': true,
655
658
  $groups: { x: 'y' },
656
659
  })
657
660
  mockedFetch.mockClear()
@@ -688,6 +691,7 @@ describe('PostHog Node.js', () => {
688
691
  $lib: 'posthog-node',
689
692
  $lib_version: '1.2.3',
690
693
  locally_evaluated: false,
694
+ '$feature/decide-flag': 'decide-value',
691
695
  $groups: { organization: 'org1' },
692
696
  }),
693
697
  })