posthog-js
Advanced tools
Comparing version 1.157.2 to 1.158.0
@@ -28,3 +28,3 @@ /** | ||
}; | ||
interface SegmentContext { | ||
export interface SegmentContext { | ||
event: { | ||
@@ -38,3 +38,3 @@ event: string; | ||
type SegmentFunction = (ctx: SegmentContext) => Promise<SegmentContext> | SegmentContext; | ||
interface SegmentPlugin { | ||
export interface SegmentPlugin { | ||
name: string; | ||
@@ -41,0 +41,0 @@ version: string; |
{ | ||
"name": "posthog-js", | ||
"version": "1.157.2", | ||
"version": "1.158.0", | ||
"description": "Posthog-js allows you to automatically capture usage and send events to PostHog.", | ||
@@ -71,3 +71,3 @@ "repository": "https://github.com/PostHog/posthog-js", | ||
"compare-versions": "^6.1.0", | ||
"cypress": "13.13.2", | ||
"cypress": "13.6.3", | ||
"cypress-localstorage-commands": "^2.2.6", | ||
@@ -74,0 +74,0 @@ "date-fns": "^3.6.0", |
@@ -28,3 +28,3 @@ /** | ||
}; | ||
interface SegmentContext { | ||
export interface SegmentContext { | ||
event: { | ||
@@ -38,3 +38,3 @@ event: string; | ||
type SegmentFunction = (ctx: SegmentContext) => Promise<SegmentContext> | SegmentContext; | ||
interface SegmentPlugin { | ||
export interface SegmentPlugin { | ||
name: string; | ||
@@ -41,0 +41,0 @@ version: string; |
@@ -16,9 +16,8 @@ import { logger } from '../utils/logger'; | ||
// This is our only way of detecting that segment's analytics.reset() has been called so we also call it | ||
logger.info('Segment integration does not have a userId set, resetting PostHog'); | ||
posthog.reset(); | ||
} | ||
if (ctx.event.userId && ctx.event.userId !== posthog.get_distinct_id()) { | ||
posthog.register({ | ||
distinct_id: ctx.event.userId, | ||
}); | ||
posthog.reloadFeatureFlags(); | ||
logger.info('Segment integration has a userId set, identifying with PostHog'); | ||
posthog.identify(ctx.event.userId); | ||
} | ||
@@ -25,0 +24,0 @@ var additionalProperties = posthog._calculate_event_properties(eventName, (_a = ctx.event.properties) !== null && _a !== void 0 ? _a : {}, new Date()); |
{ | ||
"name": "posthog-js", | ||
"version": "1.157.2", | ||
"version": "1.158.0", | ||
"description": "Posthog-js allows you to automatically capture usage and send events to PostHog.", | ||
@@ -71,3 +71,3 @@ "repository": "https://github.com/PostHog/posthog-js", | ||
"compare-versions": "^6.1.0", | ||
"cypress": "13.13.2", | ||
"cypress": "13.6.3", | ||
"cypress-localstorage-commands": "^2.2.6", | ||
@@ -74,0 +74,0 @@ "date-fns": "^3.6.0", |
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
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
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7851870