Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

posthog-js-lite

Package Overview
Dependencies
Maintainers
2
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

posthog-js-lite - npm Package Compare versions

Comparing version 3.0.0-beta.1 to 3.0.0-beta.2

6

CHANGELOG.md

@@ -0,1 +1,7 @@

# 3.0.0-beta.2 - 2024-03-12
- `flushAsync` and `shutdownAsync` are removed with `flush` and `shutdown` now being the async methods.
- Fixed an issue where `shutdownAsync` would potentially exit early if a flush was already in progress
- Flushes will now try to flush up to `maxBatchSize` (default 100) in one go
# 3.0.0-beta.1 - 2024-03-04

@@ -2,0 +8,0 @@

19

lib/index.d.ts

@@ -8,2 +8,4 @@ declare type PostHogCoreOptions = {

flushInterval?: number;
/** The maximum number of queued messages to be flushed as part of a single batch (must be higher than `flushAt`) */
maxBatchSize?: number;
/** If set to true the SDK is essentially disabled (useful for local environments where you don't want to track anything) */

@@ -131,3 +133,5 @@ disabled?: boolean;

private flushAt;
private maxBatchSize;
private flushInterval;
private flushPromise;
private requestTimeout;

@@ -162,3 +166,3 @@ private featureFlagsRequestTimeoutMs;

private buildPayload;
protected addPendingPromise(promise: Promise<any>): void;
protected addPendingPromise<T>(promise: Promise<T>): Promise<T>;
/***

@@ -195,7 +199,12 @@ *** TRACKING

protected enqueue(type: string, _message: any, options?: PostHogCaptureOptions): void;
flushAsync(): Promise<any>;
flush(callback?: (err?: any, data?: any) => void): void;
private clearFlushTimer;
/**
* Helper for flushing the queue in the background
* Avoids unnecessary promise errors
*/
private flushBackground;
flush(): Promise<any[]>;
private _flush;
private fetchWithRetry;
shutdownAsync(shutdownTimeoutMs?: number): Promise<void>;
shutdown(shutdownTimeoutMs?: number): void;
shutdown(shutdownTimeoutMs?: number): Promise<void>;
}

@@ -202,0 +211,0 @@ declare abstract class PostHogCore extends PostHogCoreStateless {

@@ -10,3 +10,5 @@ import { PostHogFetchOptions, PostHogFetchResponse, PostHogAutocaptureElement, PostHogDecideResponse, PostHogCoreOptions, PostHogEventProperties, PostHogPersistedProperty, PostHogCaptureOptions, JsonType } from './types';

private flushAt;
private maxBatchSize;
private flushInterval;
private flushPromise;
private requestTimeout;

@@ -41,3 +43,3 @@ private featureFlagsRequestTimeoutMs;

private buildPayload;
protected addPendingPromise(promise: Promise<any>): void;
protected addPendingPromise<T>(promise: Promise<T>): Promise<T>;
/***

@@ -74,7 +76,12 @@ *** TRACKING

protected enqueue(type: string, _message: any, options?: PostHogCaptureOptions): void;
flushAsync(): Promise<any>;
flush(callback?: (err?: any, data?: any) => void): void;
private clearFlushTimer;
/**
* Helper for flushing the queue in the background
* Avoids unnecessary promise errors
*/
private flushBackground;
flush(): Promise<any[]>;
private _flush;
private fetchWithRetry;
shutdownAsync(shutdownTimeoutMs?: number): Promise<void>;
shutdown(shutdownTimeoutMs?: number): void;
shutdown(shutdownTimeoutMs?: number): Promise<void>;
}

@@ -81,0 +88,0 @@ export declare abstract class PostHogCore extends PostHogCoreStateless {

@@ -8,2 +8,4 @@ export declare type PostHogCoreOptions = {

flushInterval?: number;
/** The maximum number of queued messages to be flushed as part of a single batch (must be higher than `flushAt`) */
maxBatchSize?: number;
/** If set to true the SDK is essentially disabled (useful for local environments where you don't want to track anything) */

@@ -10,0 +12,0 @@ disabled?: boolean;

{
"name": "posthog-js-lite",
"version": "3.0.0-beta.1",
"version": "3.0.0-beta.2",
"main": "lib/index.cjs.js",

@@ -5,0 +5,0 @@ "module": "lib/index.esm.js",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc