Skip to content

Releases: statsig-io/node-js-server-sdk

v4.10.0 - ID list improvements

09 Mar 21:12

Choose a tag to compare

Added improvements to ID list logic so that it's more scalable when there are large ID lists.

v4.9.2 - adding support for new operator to check whether a field on user is null

11 Feb 21:09
2f4c942

Choose a tag to compare

Previous versions of the SDK already supports checking for a null field on the user object, but it treats undefined and null differently, which is not necessary. So in this version we changed === to be == for the eq and neq operators so that if a field is undefined, it will also pass the null check

v4.9.1 - Adds initTimeoutMs to StatsigOptions to short circuit long running initialize calls

20 Jan 21:09
04857fa

Choose a tag to compare

If you want to add an upper bound to the amount of time initialize takes to resolve, you can use initTimeoutMs in StatsigOptions to short circuit long running initialize calls. By default, there is no timeout on the initialize call

v4.8.0 - Adds support for overrides, localMode, and typeguards for DynamicConfig

06 Jan 21:57

Choose a tag to compare

Overrides

Introduces the overrideGate and overrideConfig APIs which allow you to override gates and configs globally or at the userID level.

This is primarily intended for automated tests where you want to force users into a certain codepath.

localMode

Introduces a new StatsigOption key called localMode. When enabled, the SDK will not hit the network at all and only return default (or the above overrides) for values. Useful for automated test environments.

Typeguards

In this release we are adding an optional TypeGuard parameter to the get<T> method on DynamicConfig class, so that users can use their own TypeGuard functions to ensure type correctness. Thanks to Statsig user @bilalq for his idea and contribution on this!

interface Thing {
  category: 'real' | 'imaginary'
}

const isThing = (obj: any): obj is Thing => {
  return obj?.category === 'real' || obj?.category === 'imaginary'
}

...

const config = Statsig.getConfig('my_config');
const defaultThing: Thing = { category: 'real' };
const myThing = config.get('my_thing', defaultThing, isThing);

// myThing is now guaranteed to be a Thing, instead of any kind of object.

v4.7.0 - Add support for Segment ID Lists

29 Nov 22:42

Choose a tag to compare

Segment ID lists allow you to manage large lists up to 1 million IDs, and use them in feature gate/dynamic config/experiment targeting

v4.6.0 Adds support for experimentation on custom ID types

09 Nov 21:06

Choose a tag to compare

Adds customIDs to the user object, which can be used to specify experiment randomization unit IDs other than the standard userID and stableID, e.g. to experiment on account IDs, you can add accountID as a new ID type in Statsig console, and set it on the user with

let user = {
  ...
  customIDs: { accountID: 'some_account_id' },
}

Patched a vulnerability in useragent library

19 Oct 00:29

Choose a tag to compare

The "useragent" library used in the SDK has a vulnerability when the user agent string is too long (as the result of hacking attempt). This version patches it when the SDK uses the library.

Minor type declaration fix

18 Oct 19:26
f8fb567

Choose a tag to compare

Added a fix for environment type in the type declaration file index.d.ts

v4.5.3 - Backfill support for node v12+

13 Oct 19:38

Choose a tag to compare

The SDK now uses tsc to transpile the javascript and pollyfill the SDK to work with older versions of node.

v4.5.1 Allow undefined values to be set in user.custom and user.privateAttributes

24 Sep 04:07
b4684b1

Choose a tag to compare

Allows undefined values to be set in user.custom and user.privateAttributes. You cannot create gate conditions to target undefined values, and they are ignored at evaluation time. This is a quality of life typing change