posthog-js-lite 3.6.0 → 4.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
@@ -50,8 +50,8 @@ type PostHogCoreOptions = {
50
50
  remoteConfigRequestTimeoutMs?: number;
51
51
  /** For Session Analysis how long before we expire a session (defaults to 30 mins) */
52
52
  sessionExpirationTimeSeconds?: number;
53
- /** Whether to post events to PostHog in JSON or compressed format. Defaults to 'json' */
54
- captureMode?: 'json' | 'form';
53
+ /** Whether to disable GZIP compression */
54
+ disableCompression?: boolean;
55
55
  disableGeoip?: boolean;
56
56
  /** Special flag to indicate ingested data is for a historical migration. */
57
57
  historicalMigration?: boolean;
@@ -90,7 +90,7 @@ type PostHogFetchOptions = {
90
90
  headers: {
91
91
  [key: string]: string;
92
92
  };
93
- body?: string;
93
+ body?: string | Blob;
94
94
  signal?: AbortSignal;
95
95
  };
96
96
  type PostHogCaptureOptions = {
@@ -119,10 +119,18 @@ type PostHogAutocaptureElement = {
119
119
  nth_of_type?: number;
120
120
  order?: number;
121
121
  } & PostHogEventProperties;
122
+ declare enum Compression {
123
+ GZipJS = "gzip-js",
124
+ Base64 = "base64"
125
+ }
122
126
  type PostHogRemoteConfig = {
123
127
  sessionRecording?: boolean | {
124
128
  [key: string]: JsonType;
125
129
  };
130
+ /**
131
+ * Supported compression algorithms
132
+ */
133
+ supportedCompression?: Compression[];
126
134
  /**
127
135
  * Whether surveys are enabled
128
136
  */
@@ -368,8 +376,6 @@ declare enum ActionStepStringMatching {
368
376
  type ActionStepType = {
369
377
  event?: string;
370
378
  selector?: string;
371
- /** @deprecated Only `selector` should be used now. */
372
- tag_name?: string;
373
379
  text?: string;
374
380
  /** @default StringMatching.Exact */
375
381
  text_matching?: ActionStepStringMatching;
@@ -410,11 +416,11 @@ declare abstract class PostHogCoreStateless {
410
416
  private requestTimeout;
411
417
  private featureFlagsRequestTimeoutMs;
412
418
  private remoteConfigRequestTimeoutMs;
413
- private captureMode;
414
419
  private removeDebugCallback?;
415
420
  private disableGeoip;
416
421
  private historicalMigration;
417
422
  protected disabled: boolean;
423
+ protected disableCompression: boolean;
418
424
  private defaultOptIn;
419
425
  private pendingPromises;
420
426
  protected _events: SimpleEventEmitter;
@@ -590,18 +596,10 @@ declare abstract class PostHogCore extends PostHogCoreStateless {
590
596
  [type: string]: string;
591
597
  }): void;
592
598
  resetPersonPropertiesForFlags(): void;
593
- /** @deprecated - Renamed to setPersonPropertiesForFlags */
594
- personProperties(properties: {
595
- [type: string]: string;
596
- }): void;
597
599
  setGroupPropertiesForFlags(properties: {
598
600
  [type: string]: Record<string, string>;
599
601
  }): void;
600
602
  resetGroupPropertiesForFlags(): void;
601
- /** @deprecated - Renamed to setGroupPropertiesForFlags */
602
- groupProperties(properties: {
603
- [type: string]: Record<string, string>;
604
- }): void;
605
603
  private remoteConfigAsync;
606
604
  /***
607
605
  *** FEATURE FLAGS