posthog-js 1.111.0 → 1.111.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.
@@ -6,7 +6,7 @@ import { RequestQueue } from './request-queue';
6
6
  import { RetryQueue } from './retry-queue';
7
7
  import { SessionIdManager } from './sessionid';
8
8
  import { RequestRouter } from './utils/request-router';
9
- import { AutocaptureConfig, CaptureOptions, CaptureResult, Compression, DecideResponse, EarlyAccessFeatureCallback, GDPROptions, isFeatureEnabledOptions, JSC, JsonType, OptInOutCapturingOptions, PostHogConfig, Properties, Property, RequestCallback, SessionIdChangedCallback, SnippetArrayItem, ToolbarParams, XHROptions } from './types';
9
+ import { AutocaptureConfig, CaptureOptions, CaptureResult, Compression, DecideResponse, EarlyAccessFeatureCallback, GDPROptions, isFeatureEnabledOptions, JsonType, OptInOutCapturingOptions, PostHogConfig, Properties, Property, RequestCallback, SessionIdChangedCallback, SnippetArrayItem, ToolbarParams, XHROptions } from './types';
10
10
  import { SentryIntegration } from './extensions/sentry-integration';
11
11
  import { PageViewManager } from './page-view';
12
12
  import { PostHogSurveys } from './posthog-surveys';
@@ -43,7 +43,6 @@ export declare class PostHog {
43
43
  webPerformance: DeprecatedWebPerformanceObserver;
44
44
  _triggered_notifs: any;
45
45
  compression: Partial<Record<Compression, boolean>>;
46
- _jsc: JSC;
47
46
  __captureHooks: ((eventName: string) => void)[];
48
47
  __request_queue: [url: string, data: Record<string, any>, options: XHROptions, callback?: RequestCallback][];
49
48
  __autocapture: boolean | AutocaptureConfig | undefined;
@@ -80,16 +79,6 @@ export declare class PostHog {
80
79
  _loaded(): void;
81
80
  _start_queue_if_opted_in(): void;
82
81
  _dom_loaded(): void;
83
- /**
84
- * _prepare_callback() should be called by callers of _send_request for use
85
- * as the callback argument.
86
- *
87
- * If there is no callback, this returns null.
88
- * If we are going to make XHR/XDR requests, this returns a function.
89
- * If we are going to use script tags, this returns a string to use as the
90
- * callback GET param.
91
- */
92
- _prepare_callback(callback?: RequestCallback, data?: Properties): RequestCallback | null | string;
93
82
  _handle_unload(): void;
94
83
  _handle_queued_event(url: string, data: Record<string, any>, options?: XHROptions): void;
95
84
  __compress_and_send_json_request(url: string, jsonData: string, options: XHROptions, callback?: RequestCallback): void;
@@ -119,7 +119,6 @@ export interface PostHogConfig {
119
119
  advanced_disable_toolbar_metrics: boolean;
120
120
  get_device_id: (uuid: string) => string;
121
121
  name: string;
122
- callback_fn: string;
123
122
  _onCapture: (eventName: string, eventData: CaptureResult) => void;
124
123
  capture_performance?: boolean;
125
124
  disable_compression: boolean;
@@ -319,10 +318,6 @@ export interface PostData {
319
318
  compression?: Compression;
320
319
  data?: string;
321
320
  }
322
- export interface JSC {
323
- (): void;
324
- [key: string]: (response: any) => void;
325
- }
326
321
  export type SnippetArrayItem = [method: string, ...args: any[]];
327
322
  export type JsonType = string | number | boolean | null | {
328
323
  [key: string]: JsonType;
@@ -12,6 +12,7 @@ export declare enum RequestRouterRegion {
12
12
  export type RequestRouterTarget = 'api' | 'ui' | 'assets';
13
13
  export declare class RequestRouter {
14
14
  instance: PostHog;
15
+ private _regionCache;
15
16
  constructor(instance: PostHog);
16
17
  get apiHost(): string;
17
18
  get uiHost(): string | undefined;
package/dist/module.d.ts CHANGED
@@ -232,7 +232,6 @@ interface PostHogConfig {
232
232
  advanced_disable_toolbar_metrics: boolean;
233
233
  get_device_id: (uuid: string) => string;
234
234
  name: string;
235
- callback_fn: string;
236
235
  _onCapture: (eventName: string, eventData: CaptureResult) => void;
237
236
  capture_performance?: boolean;
238
237
  disable_compression: boolean;
@@ -432,10 +431,6 @@ interface PostData {
432
431
  compression?: Compression;
433
432
  data?: string;
434
433
  }
435
- interface JSC {
436
- (): void;
437
- [key: string]: (response: any) => void;
438
- }
439
434
  type SnippetArrayItem = [method: string, ...args: any[]];
440
435
  type JsonType = string | number | boolean | null | {
441
436
  [key: string]: JsonType;
@@ -1024,6 +1019,7 @@ declare enum RequestRouterRegion {
1024
1019
  type RequestRouterTarget = 'api' | 'ui' | 'assets';
1025
1020
  declare class RequestRouter {
1026
1021
  instance: PostHog;
1022
+ private _regionCache;
1027
1023
  constructor(instance: PostHog);
1028
1024
  get apiHost(): string;
1029
1025
  get uiHost(): string | undefined;
@@ -1268,7 +1264,6 @@ declare class PostHog {
1268
1264
  webPerformance: DeprecatedWebPerformanceObserver;
1269
1265
  _triggered_notifs: any;
1270
1266
  compression: Partial<Record<Compression, boolean>>;
1271
- _jsc: JSC;
1272
1267
  __captureHooks: ((eventName: string) => void)[];
1273
1268
  __request_queue: [url: string, data: Record<string, any>, options: XHROptions, callback?: RequestCallback][];
1274
1269
  __autocapture: boolean | AutocaptureConfig | undefined;
@@ -1305,16 +1300,6 @@ declare class PostHog {
1305
1300
  _loaded(): void;
1306
1301
  _start_queue_if_opted_in(): void;
1307
1302
  _dom_loaded(): void;
1308
- /**
1309
- * _prepare_callback() should be called by callers of _send_request for use
1310
- * as the callback argument.
1311
- *
1312
- * If there is no callback, this returns null.
1313
- * If we are going to make XHR/XDR requests, this returns a function.
1314
- * If we are going to use script tags, this returns a string to use as the
1315
- * callback GET param.
1316
- */
1317
- _prepare_callback(callback?: RequestCallback, data?: Properties): RequestCallback | null | string;
1318
1303
  _handle_unload(): void;
1319
1304
  _handle_queued_event(url: string, data: Record<string, any>, options?: XHROptions): void;
1320
1305
  __compress_and_send_json_request(url: string, jsonData: string, options: XHROptions, callback?: RequestCallback): void;
@@ -1939,4 +1924,4 @@ declare class PostHog {
1939
1924
 
1940
1925
  declare const posthog: PostHog;
1941
1926
 
1942
- export { type AutoCaptureCustomProperty, type AutocaptureCompatibleElement, type AutocaptureConfig, type BasicSurveyQuestion, type Breaker, type CaptureCallback, type CaptureOptions, type CaptureResult, type CapturedNetworkRequest, Compression, type CompressionData, type DecideResponse, type DomAutocaptureEvents, type EarlyAccessFeature, type EarlyAccessFeatureCallback, type EarlyAccessFeatureResponse, type EventHandler, type FeatureFlagsCallback, type FlagVariant, type GDPROptions, type Headers, type InitiatorType, type JSC, type JsonType, type LinkSurveyQuestion, type MinimalHTTPResponse, type MultipleSurveyQuestion, type NetworkRecordOptions, type NetworkRequest, type OptInOutCapturingOptions, type PersistentStore, type PostData, PostHog, type PostHogConfig, type Properties, type Property, type QueuedRequestData, type RatingSurveyQuestion, type RequestCallback, type RequestData, type RetryQueueElement, type SessionIdChangedCallback, type SessionRecordingOptions, type SnippetArrayItem, type Survey, type SurveyAppearance, type SurveyCallback, type SurveyQuestion, SurveyQuestionType, type SurveyResponse, SurveyType, type SurveyUrlMatchType, type ToolbarParams, type ToolbarSource, type ToolbarUserIntent, type ToolbarVersion, type XHROptions, posthog as default, type isFeatureEnabledOptions, posthog };
1927
+ export { type AutoCaptureCustomProperty, type AutocaptureCompatibleElement, type AutocaptureConfig, type BasicSurveyQuestion, type Breaker, type CaptureCallback, type CaptureOptions, type CaptureResult, type CapturedNetworkRequest, Compression, type CompressionData, type DecideResponse, type DomAutocaptureEvents, type EarlyAccessFeature, type EarlyAccessFeatureCallback, type EarlyAccessFeatureResponse, type EventHandler, type FeatureFlagsCallback, type FlagVariant, type GDPROptions, type Headers, type InitiatorType, type JsonType, type LinkSurveyQuestion, type MinimalHTTPResponse, type MultipleSurveyQuestion, type NetworkRecordOptions, type NetworkRequest, type OptInOutCapturingOptions, type PersistentStore, type PostData, PostHog, type PostHogConfig, type Properties, type Property, type QueuedRequestData, type RatingSurveyQuestion, type RequestCallback, type RequestData, type RetryQueueElement, type SessionIdChangedCallback, type SessionRecordingOptions, type SnippetArrayItem, type Survey, type SurveyAppearance, type SurveyCallback, type SurveyQuestion, SurveyQuestionType, type SurveyResponse, SurveyType, type SurveyUrlMatchType, type ToolbarParams, type ToolbarSource, type ToolbarUserIntent, type ToolbarVersion, type XHROptions, posthog as default, type isFeatureEnabledOptions, posthog };