posthog-node 2.2.0 → 2.2.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.
@@ -8,6 +8,7 @@ export declare abstract class PostHogCore {
8
8
  host: string;
9
9
  private flushAt;
10
10
  private flushInterval;
11
+ private requestTimeout;
11
12
  private captureMode;
12
13
  private sendFeatureFlagEvent;
13
14
  private flagCallReported;
@@ -13,6 +13,7 @@ export declare type PosthogCoreOptions = {
13
13
  };
14
14
  fetchRetryCount?: number;
15
15
  fetchRetryDelay?: number;
16
+ requestTimeout?: number;
16
17
  sessionExpirationTimeSeconds?: number;
17
18
  captureMode?: 'json' | 'form';
18
19
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "posthog-node",
3
- "version": "2.2.0",
3
+ "version": "2.2.2",
4
4
  "description": "PostHog Node.js integration",
5
5
  "repository": "PostHog/posthog-node",
6
6
  "scripts": {
@@ -17,7 +17,7 @@ export type PostHogOptions = PosthogCoreOptions & {
17
17
  personalApiKey?: string
18
18
  // The interval in milliseconds between polls for refreshing feature flag definitions
19
19
  featureFlagsPollingInterval?: number
20
- // Timeout in milliseconds for feature flag definitions calls. Defaults to 30 seconds.
20
+ // Timeout in milliseconds for any calls. Defaults to 10 seconds.
21
21
  requestTimeout?: number
22
22
  // Maximum size of cache that deduplicates $feature_flag_called calls per user.
23
23
  maxCacheSize?: number
@@ -84,7 +84,7 @@ export class PostHog implements PostHogNodeV1 {
84
84
  : THIRTY_SECONDS,
85
85
  personalApiKey: options.personalApiKey,
86
86
  projectApiKey: apiKey,
87
- timeout: options.requestTimeout,
87
+ timeout: options.requestTimeout ?? 10,
88
88
  host: this._sharedClient.host,
89
89
  fetch: options.fetch,
90
90
  })