posthog-js-lite 2.0.1 → 2.2.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.
@@ -1,4 +1,4 @@
1
- import { PostHogFetchOptions, PostHogFetchResponse, PostHogAutocaptureElement, PostHogDecideResponse, PosthogCoreOptions, PostHogEventProperties, PostHogPersistedProperty, JsonType } from './types';
1
+ import { PostHogFetchOptions, PostHogFetchResponse, PostHogAutocaptureElement, PostHogDecideResponse, PosthogCoreOptions, PostHogEventProperties, PostHogPersistedProperty, PosthogCaptureOptions, JsonType } from './types';
2
2
  import { RetriableOptions } from './utils';
3
3
  export * as utils from './utils';
4
4
  import { LZString } from './lz-string';
@@ -50,20 +50,20 @@ export declare abstract class PostHogCore {
50
50
  /***
51
51
  *** TRACKING
52
52
  ***/
53
- identify(distinctId?: string, properties?: PostHogEventProperties): this;
53
+ identify(distinctId?: string, properties?: PostHogEventProperties, options?: PosthogCaptureOptions): this;
54
54
  capture(event: string, properties?: {
55
55
  [key: string]: any;
56
- }, forceSendFeatureFlags?: boolean): this;
56
+ }, options?: PosthogCaptureOptions): this;
57
57
  alias(alias: string): this;
58
- autocapture(eventType: string, elements: PostHogAutocaptureElement[], properties?: PostHogEventProperties): this;
58
+ autocapture(eventType: string, elements: PostHogAutocaptureElement[], properties?: PostHogEventProperties, options?: PosthogCaptureOptions): this;
59
59
  /***
60
60
  *** GROUPS
61
61
  ***/
62
62
  groups(groups: {
63
63
  [type: string]: string | number;
64
64
  }): this;
65
- group(groupType: string, groupKey: string | number, groupProperties?: PostHogEventProperties): this;
66
- groupIdentify(groupType: string, groupKey: string | number, groupProperties?: PostHogEventProperties): this;
65
+ group(groupType: string, groupKey: string | number, groupProperties?: PostHogEventProperties, options?: PosthogCaptureOptions): this;
66
+ groupIdentify(groupType: string, groupKey: string | number, groupProperties?: PostHogEventProperties, options?: PosthogCaptureOptions): this;
67
67
  /***
68
68
  * PROPERTIES
69
69
  ***/
@@ -94,9 +94,6 @@ export declare abstract class PostHogCore {
94
94
  onFeatureFlags(cb: (flags: PostHogDecideResponse['featureFlags']) => void): () => void;
95
95
  onFeatureFlag(key: string, cb: (value: string | boolean) => void): () => void;
96
96
  overrideFeatureFlag(flags: PostHogDecideResponse['featureFlags'] | null): void;
97
- _sendFeatureFlags(event: string, properties?: {
98
- [key: string]: any;
99
- }): void;
100
97
  /***
101
98
  *** QUEUEING AND FLUSHING
102
99
  ***/
@@ -41,6 +41,9 @@ export declare type PostHogFetchOptions = {
41
41
  body?: string;
42
42
  signal?: AbortSignal;
43
43
  };
44
+ export declare type PosthogCaptureOptions = {
45
+ timestamp?: Date;
46
+ };
44
47
  export declare type PostHogFetchResponse = {
45
48
  status: number;
46
49
  text: () => Promise<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "posthog-js-lite",
3
- "version": "2.0.1",
3
+ "version": "2.2.0",
4
4
  "main": "lib/index.cjs.js",
5
5
  "module": "lib/index.esm.js",
6
6
  "types": "lib/index.d.ts",