posthog-node 4.18.0 → 5.0.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/lib/index.d.ts CHANGED
@@ -52,8 +52,8 @@ type PostHogCoreOptions = {
52
52
  remoteConfigRequestTimeoutMs?: number;
53
53
  /** For Session Analysis how long before we expire a session (defaults to 30 mins) */
54
54
  sessionExpirationTimeSeconds?: number;
55
- /** Whether to post events to PostHog in JSON or compressed format. Defaults to 'json' */
56
- captureMode?: 'json' | 'form';
55
+ /** Whether to disable GZIP compression */
56
+ disableCompression?: boolean;
57
57
  disableGeoip?: boolean;
58
58
  /** Special flag to indicate ingested data is for a historical migration. */
59
59
  historicalMigration?: boolean;
@@ -92,7 +92,7 @@ type PostHogFetchOptions = {
92
92
  headers: {
93
93
  [key: string]: string;
94
94
  };
95
- body?: string;
95
+ body?: string | Blob;
96
96
  signal?: AbortSignal;
97
97
  };
98
98
  type PostHogCaptureOptions = {
@@ -110,10 +110,18 @@ type PostHogFetchResponse = {
110
110
  type PostHogEventProperties = {
111
111
  [key: string]: JsonType;
112
112
  };
113
+ declare enum Compression {
114
+ GZipJS = "gzip-js",
115
+ Base64 = "base64"
116
+ }
113
117
  type PostHogRemoteConfig = {
114
118
  sessionRecording?: boolean | {
115
119
  [key: string]: JsonType;
116
120
  };
121
+ /**
122
+ * Supported compression algorithms
123
+ */
124
+ supportedCompression?: Compression[];
117
125
  /**
118
126
  * Whether surveys are enabled
119
127
  */
@@ -363,8 +371,6 @@ declare enum ActionStepStringMatching {
363
371
  type ActionStepType = {
364
372
  event?: string;
365
373
  selector?: string;
366
- /** @deprecated Only `selector` should be used now. */
367
- tag_name?: string;
368
374
  text?: string;
369
375
  /** @default StringMatching.Exact */
370
376
  text_matching?: ActionStepStringMatching;
@@ -439,11 +445,11 @@ declare abstract class PostHogCoreStateless {
439
445
  private requestTimeout;
440
446
  private featureFlagsRequestTimeoutMs;
441
447
  private remoteConfigRequestTimeoutMs;
442
- private captureMode;
443
448
  private removeDebugCallback?;
444
449
  private disableGeoip;
445
450
  private historicalMigration;
446
451
  protected disabled: boolean;
452
+ protected disableCompression: boolean;
447
453
  private defaultOptIn;
448
454
  private pendingPromises;
449
455
  protected _events: SimpleEventEmitter;
@@ -632,8 +638,6 @@ type PostHogFeatureFlag = {
632
638
  };
633
639
  deleted: boolean;
634
640
  active: boolean;
635
- /** @deprecated This field will be removed in a future version. **/
636
- is_simple_flag: boolean;
637
641
  rollout_percentage: null | number;
638
642
  ensure_experience_continuity: boolean;
639
643
  experiment_set: number[];