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

posthog-node

Package Overview
Dependencies
Maintainers
6
Versions
67
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.1 to 2.5.2

6

CHANGELOG.md

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

# 2.5.2 - 2023-02-17
1. Fix issue where properties passed to `.identify` were not set correctly
# 2.5.1 - 2023-02-16
1. Make sure shutdown waits for pending promises to resolve. Fixes a problem with using PostHog Node in serverless environments.
# 2.5.0 - 2023-02-15

@@ -8,2 +13,3 @@

2. Sets minimum version of node.js to 15
# 2.4.0 - 2023-02-02

@@ -10,0 +16,0 @@

2

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

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

@@ -120,3 +120,8 @@ import { version } from '../package.json'

identify({ distinctId, properties }: IdentifyMessageV1): void {
super.identifyStateless(distinctId, properties)
// Catch properties passed as $set and move them to the top level
const personProperties = properties?.$set || properties
super.identifyStateless(distinctId, {
$set: personProperties,
})
}

@@ -123,0 +128,0 @@

@@ -117,3 +117,5 @@ // import { PostHog } from '../'

properties: {
foo: 'bar',
$set: {
foo: 'bar',
},
},

@@ -124,2 +126,20 @@ },

it('should handle identify mistakenly using $set', async () => {
expect(mockedFetch).toHaveBeenCalledTimes(0)
posthog.identify({ distinctId: '123', properties: { foo: 'bar', $set: { foo: 'other' } } })
jest.runOnlyPendingTimers()
const batchEvents = getLastBatchEvents()
expect(batchEvents).toMatchObject([
{
distinct_id: '123',
event: '$identify',
properties: {
$set: {
foo: 'other',
},
},
},
])
})
it('should capture alias events on shared queue', async () => {

@@ -126,0 +146,0 @@ expect(mockedFetch).toHaveBeenCalledTimes(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

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