posthog-node 2.0.1 → 2.0.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.
@@ -1,3 +1 @@
1
- import { PostHogGlobal } from './src/posthog-node';
2
1
  export * from './src/posthog-node';
3
- export default PostHogGlobal;
@@ -7,7 +7,7 @@ export declare type PostHogOptions = PosthogCoreOptions & {
7
7
  requestTimeout?: number;
8
8
  maxCacheSize?: number;
9
9
  };
10
- export declare class PostHogGlobal implements PostHogNodeV1 {
10
+ export declare class PostHog implements PostHogNodeV1 {
11
11
  private _sharedClient;
12
12
  private featureFlagsPoller?;
13
13
  private maxCacheSize;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "posthog-node",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "PostHog Node.js integration",
5
5
  "repository": "PostHog/posthog-node",
6
6
  "scripts": {
@@ -30,8 +30,5 @@
30
30
  "stats",
31
31
  "analysis",
32
32
  "funnels"
33
- ],
34
- "bin": {
35
- "posthog": "cli.js"
36
- }
33
+ ]
37
34
  }
@@ -25,7 +25,7 @@ export type PostHogOptions = PosthogCoreOptions & {
25
25
  const THIRTY_SECONDS = 30 * 1000
26
26
  const MAX_CACHE_SIZE = 50 * 1000
27
27
 
28
- class PostHog extends PostHogCore {
28
+ class PostHogClient extends PostHogCore {
29
29
  private _memoryStorage = new PostHogMemoryStorage()
30
30
 
31
31
  constructor(apiKey: string, options: PostHogOptions = {}) {
@@ -65,15 +65,15 @@ class PostHog extends PostHogCore {
65
65
  }
66
66
 
67
67
  // The actual exported Nodejs API.
68
- export class PostHogGlobal implements PostHogNodeV1 {
69
- private _sharedClient: PostHog
68
+ export class PostHog implements PostHogNodeV1 {
69
+ private _sharedClient: PostHogClient
70
70
  private featureFlagsPoller?: FeatureFlagsPoller
71
71
  private maxCacheSize: number
72
72
 
73
73
  distinctIdHasSentFlagCalls: Record<string, string[]>
74
74
 
75
75
  constructor(apiKey: string, options: PostHogOptions = {}) {
76
- this._sharedClient = new PostHog(apiKey, options)
76
+ this._sharedClient = new PostHogClient(apiKey, options)
77
77
  if (options.personalApiKey) {
78
78
  this.featureFlagsPoller = new FeatureFlagsPoller({
79
79
  pollingInterval:
@@ -1,6 +1,6 @@
1
- // import PostHog from '../'
1
+ // import { PostHog } from '../'
2
2
  // Uncomment below line while developing to not compile code everytime
3
- import { PostHogGlobal as PostHog } from '../src/posthog-node'
3
+ import { PostHog as PostHog } from '../src/posthog-node'
4
4
  import { matchProperty, InconclusiveMatchError } from '../src/feature-flags'
5
5
  jest.mock('undici')
6
6
  import undici from 'undici'
@@ -1,5 +1,5 @@
1
- // import PostHog from '../'
2
- import { PostHogGlobal as PostHog } from '../src/posthog-node'
1
+ // import { PostHog } from '../'
2
+ import { PostHog as PostHog } from '../src/posthog-node'
3
3
  jest.mock('undici')
4
4
  import undici from 'undici'
5
5
  import { decideImplementation, localEvaluationImplementation } from './feature-flags.spec'