Socket
Socket
Sign inDemoInstall

posthog-node

Package Overview
Dependencies
Maintainers
4
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

posthog-node - npm Package Compare versions

Comparing version 4.0.0-beta.3 to 4.0.0

25

CHANGELOG.md

@@ -0,1 +1,26 @@

# 4.0.0 - 2024-03-18
## Added
1. Adds a `disabled` option and the ability to change it later via `posthog.disabled = true`. Useful for disabling PostHog tracking for example in a testing environment without having complex conditional checking
2. Adds a new `featureFlagsRequestTimeoutMs` timeout parameter for feature flags which defaults to 3 seconds, updated from the default 10s for all other API calls.
3. `shutdown` takes a `shutdownTimeoutMs` param with a default of 30000 (30s). This is the time to wait for flushing events before shutting down the client. If the timeout is reached, the client will be shut down regardless of pending events.
4. Flushes will now try to flush up to `maxBatchSize` (default 100) in one go
5. Queued events are limited up to `maxQueueSize` (default 1000) and the oldest events are dropped when the limit is reached
6. Sets `User-Agent` headers with SDK name and version for RN
## Removed
1. `flushAsync` and `shutdownAsync` are removed with `flush` and `shutdown` now being the async methods.
## Changed
1. `flush` and `shutdown` now being async methods.
## Fixed
1. Fixed an issue where `shutdown` would potentially exit early if a flush was already in progress
2. Fixes some typos in types
# 4.0.0-beta.3 - 2024-03-13

@@ -2,0 +27,0 @@

@@ -11,2 +11,6 @@ /// <reference types="node" />

maxBatchSize?: number;
/** The maximum number of cached messages either in memory or on the local storage.
* Defaults to 1000, (must be higher than `flushAt`)
*/
maxQueueSize?: number;
/** If set to true the SDK is essentially disabled (useful for local environments where you don't want to track anything) */

@@ -129,2 +133,3 @@ disabled?: boolean;

private maxBatchSize;
private maxQueueSize;
private flushInterval;

@@ -131,0 +136,0 @@ private flushPromise;

1

lib/posthog-core/src/index.d.ts

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

private maxBatchSize;
private maxQueueSize;
private flushInterval;

@@ -13,0 +14,0 @@ private flushPromise;

@@ -11,2 +11,6 @@ /// <reference types="node" />

maxBatchSize?: number;
/** The maximum number of cached messages either in memory or on the local storage.
* Defaults to 1000, (must be higher than `flushAt`)
*/
maxQueueSize?: number;
/** If set to true the SDK is essentially disabled (useful for local environments where you don't want to track anything) */

@@ -13,0 +17,0 @@ disabled?: boolean;

2

package.json
{
"name": "posthog-node",
"version": "4.0.0-beta.3",
"version": "4.0.0",
"description": "PostHog Node.js integration",

@@ -5,0 +5,0 @@ "repository": {

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