Releases: statsig-io/node-js-server-sdk
v4.10.0 - ID list improvements
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
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
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
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
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
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
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
Added a fix for environment type in the type declaration file index.d.ts
v4.5.3 - Backfill support for node v12+
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
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