Socket
Socket
Sign inDemoInstall

posthog-node

Package Overview
Dependencies
Maintainers
6
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 2.5.3 to 2.5.4

3

CHANGELOG.md

@@ -0,1 +1,4 @@

# 2.5.4 - 2023-02-27
1. Fix error log for local evaluation of feature flags (InconclusiveMatchError(s)) to only show during debug mode.
# 2.5.3 - 2023-02-21

@@ -2,0 +5,0 @@

@@ -106,2 +106,3 @@ /// <reference types="node" />

private removeDebugCallback?;
private debugMode;
private pendingPromises;

@@ -323,2 +324,3 @@ private _optoutOverride;

disable(): void;
debug(enabled?: boolean): void;
capture({ distinctId, event, properties, groups, sendFeatureFlags, timestamp }: EventMessageV1): void;

@@ -325,0 +327,0 @@ identify({ distinctId, properties }: IdentifyMessageV1): void;

@@ -14,2 +14,3 @@ import { PostHogFetchOptions, PostHogFetchResponse, PostHogAutocaptureElement, PostHogDecideResponse, PosthogCoreOptions, PostHogEventProperties, PostHogPersistedProperty, PosthogCaptureOptions, JsonType } from './types';

private removeDebugCallback?;
private debugMode;
private pendingPromises;

@@ -16,0 +17,0 @@ private _optoutOverride;

@@ -30,3 +30,5 @@ /// <reference types="node" />

fetch: (url: string, options: PostHogFetchOptions) => Promise<PostHogFetchResponse>;
debugMode: boolean;
constructor({ pollingInterval, personalApiKey, projectApiKey, timeout, host, ...options }: FeatureFlagsPollerOptions);
debug(enabled?: boolean): void;
getFeatureFlag(key: string, distinctId: string, groups?: Record<string, string>, personProperties?: Record<string, string>, groupProperties?: Record<string, Record<string, string>>): Promise<string | boolean | undefined>;

@@ -33,0 +35,0 @@ computeFeatureFlagPayloadLocally(key: string, matchValue: string | boolean): Promise<JsonType | undefined>;

@@ -26,2 +26,3 @@ import { JsonType, PosthogCoreOptions, PostHogCoreStateless, PostHogFetchOptions, PostHogFetchResponse, PosthogFlagsAndPayloadsResponse, PostHogPersistedProperty } from '../../posthog-core/src';

disable(): void;
debug(enabled?: boolean): void;
capture({ distinctId, event, properties, groups, sendFeatureFlags, timestamp }: EventMessageV1): void;

@@ -28,0 +29,0 @@ identify({ distinctId, properties }: IdentifyMessageV1): void;

2

package.json
{
"name": "posthog-node",
"version": "2.5.3",
"version": "2.5.4",
"description": "PostHog Node.js integration",

@@ -5,0 +5,0 @@ "repository": "PostHog/posthog-node",

@@ -54,2 +54,3 @@ import { createHash } from 'crypto'

fetch: (url: string, options: PostHogFetchOptions) => Promise<PostHogFetchResponse>
debugMode: boolean = false

@@ -80,2 +81,6 @@ constructor({

debug(enabled: boolean = true): void {
this.debugMode = enabled
}
async getFeatureFlag(

@@ -107,5 +112,10 @@ key: string,

response = this.computeFlagLocally(featureFlag, distinctId, groups, personProperties, groupProperties)
if (this.debugMode) {
console.debug(`Successfully computed flag locally: ${key} -> ${response}`)
}
} catch (e) {
if (e instanceof InconclusiveMatchError) {
console.error(`InconclusiveMatchError when computing flag locally: ${key}: ${e}`)
if (this.debugMode) {
console.debug(`InconclusiveMatchError when computing flag locally: ${key}: ${e}`)
}
} else if (e instanceof Error) {

@@ -112,0 +122,0 @@ console.error(`Error computing flag locally: ${key}: ${e}`)

@@ -95,2 +95,7 @@ import { version } from '../package.json'

debug(enabled: boolean = true): void {
super.debug(enabled)
this.featureFlagsPoller?.debug(enabled)
}
capture({ distinctId, event, properties, groups, sendFeatureFlags, timestamp }: EventMessageV1): void {

@@ -97,0 +102,0 @@ const _capture = (props: EventMessageV1['properties']): void => {

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