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.0.1 to 2.0.2

10

CHANGELOG.md

@@ -0,1 +1,6 @@

# 2.0.2 - 2022-08-23
1. Removes references to `cli.js`
2. Removes default `PostHogGlobal` export, and unifies import signature for `typescript`, `commonjs` and `esm` builds.
# 2.0.1 - 2022-08-15

@@ -8,6 +13,9 @@

3. Default polling interval for feature flags is now set at 30 seconds. If you don't want local evaluation, don't set a personal API key in the library.
4. The `callback` parameter passed as an optional last argument to most of the methods is no longer supported
5. The CLI is no longer supported
What's new:
1. You can now evaluate feature flags locally (i.e. without sending a request to your PostHog servers) by setting a personal API key, and passing in groups and person properties to `isFeatureEnabled` and `getFeatureFlag` calls.
2. Introduces a `getAllFlags` method that returns all feature flags. This is useful for when you want to seed your frontend with some initial flags, given a user ID.
2. Introduces a `getAllFlags` method that returns all feature flags. This is useful for when you want to seed your frontend with some initial flags, given a user ID.

3

index.ts

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

import { PostHogGlobal } from './src/posthog-node'
export * from './src/posthog-node'
export default PostHogGlobal

@@ -138,3 +138,3 @@ declare type PosthogCoreOptions = {

};
declare class PostHogGlobal implements PostHogNodeV1 {
declare class PostHog implements PostHogNodeV1 {
private _sharedClient;

@@ -182,2 +182,2 @@ private featureFlagsPoller?;

export { PostHogGlobal, PostHogOptions, PostHogGlobal as default };
export { PostHog, PostHogOptions };

@@ -1,3 +0,1 @@

import { PostHogGlobal } from './src/posthog-node';
export * from './src/posthog-node';
export default PostHogGlobal;

@@ -10,3 +10,3 @@ import { PosthogCoreOptions } from '../../posthog-core/src';

};
export declare class PostHogGlobal implements PostHogNodeV1 {
export declare class PostHog implements PostHogNodeV1 {
private _sharedClient;

@@ -13,0 +13,0 @@ private featureFlagsPoller?;

{
"name": "posthog-node",
"version": "2.0.1",
"version": "2.0.2",
"description": "PostHog Node.js integration",

@@ -33,6 +33,3 @@ "repository": "PostHog/posthog-node",

"funnels"
],
"bin": {
"posthog": "cli.js"
}
]
}

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

class PostHog extends PostHogCore {
class PostHogClient extends PostHogCore {
private _memoryStorage = new PostHogMemoryStorage()

@@ -69,4 +69,4 @@

// The actual exported Nodejs API.
export class PostHogGlobal implements PostHogNodeV1 {
private _sharedClient: PostHog
export class PostHog implements PostHogNodeV1 {
private _sharedClient: PostHogClient
private featureFlagsPoller?: FeatureFlagsPoller

@@ -78,3 +78,3 @@ private maxCacheSize: number

constructor(apiKey: string, options: PostHogOptions = {}) {
this._sharedClient = new PostHog(apiKey, options)
this._sharedClient = new PostHogClient(apiKey, options)
if (options.personalApiKey) {

@@ -81,0 +81,0 @@ this.featureFlagsPoller = new FeatureFlagsPoller({

@@ -1,3 +0,3 @@

// import PostHog from '../'
import { PostHogGlobal as PostHog } from '../src/posthog-node'
// import { PostHog } from '../'
import { PostHog as PostHog } from '../src/posthog-node'
jest.mock('undici')

@@ -4,0 +4,0 @@ import undici from 'undici'

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

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