Socket
Socket
Sign inDemoInstall

configcat-js-ssr

Package Overview
Dependencies
Maintainers
4
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

configcat-js-ssr - npm Package Compare versions

Comparing version 5.6.1 to 6.0.0

lib/esm/Cache.js

2

lib/Cache.d.ts

@@ -7,4 +7,4 @@ import { ICache, ProjectConfig } from "configcat-common";

set(key: string, config: ProjectConfig): void;
get(key: string): ProjectConfig;
get(key: string): ProjectConfig | null;
}
//# sourceMappingURL=Cache.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LocalStorageCache = void 0;
var configcat_common_1 = require("configcat-common");
var LocalStorageCache = /** @class */ (function () {

@@ -26,2 +27,5 @@ function LocalStorageCache() {

var config_1 = JSON.parse(atob(configString));
// JSON.parse creates a plain object instance, so we need to manually restore the prototype
// (so we don't run into "... is not a function" errors).
(Object.setPrototypeOf || (function (o, proto) { return o["__proto__"] = proto; }))(config_1, configcat_common_1.ProjectConfig.prototype);
if (config_1) {

@@ -28,0 +32,0 @@ this.cache[key] = config_1;

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

import { FetchResult, IConfigFetcher, OptionsBase } from "configcat-common";
import { IConfigFetcher, IFetchResponse, OptionsBase } from "configcat-common";
export declare class HttpConfigFetcher implements IConfigFetcher {
fetchLogic(options: OptionsBase, lastEtag: string, callback: (result: FetchResult) => void): void;
fetchLogic(options: OptionsBase, lastEtag: string | null): Promise<IFetchResponse>;
}
export default IConfigFetcher;
//# sourceMappingURL=ConfigFetcher.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.HttpConfigFetcher = void 0;
var tslib_1 = require("tslib");
var axios_1 = require("axios");

@@ -9,44 +10,60 @@ var configcat_common_1 = require("configcat-common");

}
HttpConfigFetcher.prototype.fetchLogic = function (options, lastEtag, callback) {
// If we are not running in browser set the If-None-Match header.
var headers = typeof window !== 'undefined' ? {} : {
'If-None-Match': (lastEtag) ? lastEtag : null
};
var axiosConfig = {
method: 'get',
timeout: options.requestTimeoutMs,
url: options.getUrl(),
headers: headers
};
axios_1.default(axiosConfig)
.then(function (response) {
var eTag = response.headers.etag;
if (response.status === 200) {
callback(configcat_common_1.FetchResult.success(JSON.stringify(response.data), eTag));
}
else {
options.logger.error("Failed to download feature flags & settings from ConfigCat. " + response.status + " - " + response.statusText);
options.logger.info("Double-check your SDK Key on https://app.configcat.com/sdkkey");
callback(configcat_common_1.FetchResult.error());
}
})
.catch(function (error) {
if (error.response) {
if (error.response.status === 304) {
callback(configcat_common_1.FetchResult.notModified());
HttpConfigFetcher.prototype.fetchLogic = function (options, lastEtag) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var headers, axiosConfig, response, err_1, statusCode_1, reasonPhrase_1, _a, code, message, statusCode, reasonPhrase, eTag;
return tslib_1.__generator(this, function (_b) {
switch (_b.label) {
case 0:
headers = typeof window !== 'undefined' || !lastEtag
// NOTE: It's intentional that we don't specify the If-None-Match header.
// The browser automatically handles it, adding it manually would cause an unnecessary CORS OPTIONS request.
? {}
: { 'If-None-Match': lastEtag };
axiosConfig = {
method: 'get',
timeout: options.requestTimeoutMs,
url: options.getUrl(),
headers: headers,
responseType: "text",
transformResponse: function (data) { return data; }
};
_b.label = 1;
case 1:
_b.trys.push([1, 3, , 4]);
return [4 /*yield*/, (0, axios_1.default)(axiosConfig)];
case 2:
response = _b.sent();
return [3 /*break*/, 4];
case 3:
err_1 = _b.sent();
(response = err_1.response);
if (response) {
statusCode_1 = response.status, reasonPhrase_1 = response.statusText;
return [2 /*return*/, { statusCode: statusCode_1, reasonPhrase: reasonPhrase_1 }];
}
else if (err_1.request) {
_a = err_1, code = _a.code, message = _a.message;
switch (code) {
case "ERR_CANCELED":
throw new configcat_common_1.FetchError("abort");
case "ECONNABORTED":
// Axios ambiguously use ECONNABORTED instead of ETIMEDOUT, so we need this additional check to detect timeout
// (see https://github.com/axios/axios/issues/1543#issuecomment-558166483)
if (message.indexOf("timeout") >= 0) {
throw new configcat_common_1.FetchError("timeout", options.requestTimeoutMs);
}
break;
}
throw new configcat_common_1.FetchError("failure", err_1);
}
throw err_1;
case 4:
statusCode = response.status, reasonPhrase = response.statusText;
if (response.status === 200) {
eTag = response.headers.etag;
return [2 /*return*/, { statusCode: statusCode, reasonPhrase: reasonPhrase, eTag: eTag, body: response.data }];
}
return [2 /*return*/, { statusCode: statusCode, reasonPhrase: reasonPhrase }];
}
else {
options.logger.error("Failed to download feature flags & settings from ConfigCat. " + error.response.status + " - " + error.response.statusText);
options.logger.info("Double-check your SDK Key on https://app.configcat.com/sdkkey");
callback(configcat_common_1.FetchResult.error());
}
}
else if (error.request) {
options.logger.error('The request to Configcat was made but no response was received');
callback(configcat_common_1.FetchResult.error());
}
else {
options.logger.error("Something happened in setting up the request to ConfigCat: " + error.message);
callback(configcat_common_1.FetchResult.error());
}
});
});

@@ -53,0 +70,0 @@ };

@@ -1,12 +0,29 @@

import * as configcatcommon from "configcat-common";
import { IConfigCatClient, LogLevel } from "configcat-common";
/** Create an instance of ConfigCatClient and setup Auto polling with default options.
* @param {string} sdkKey - SDK Key to access your configuration.
import { FlagOverrides, IAutoPollOptions, IConfigCatClient, IConfigCatLogger, ILazyLoadingOptions, IManualPollOptions, LogLevel, PollingMode } from "configcat-common";
/**
* Returns an instance of ConfigCatClient for the specified SDK Key.
* @remarks This method returns a single, shared instance per each distinct SDK Key.
* That is, a new client object is created only when there is none available for the specified SDK Key.
* Otherwise, the already created instance is returned (in which case the 'pollingMode', 'options' and 'configCatKernel' arguments are ignored).
* So, please keep in mind that when you make multiple calls to this method using the same SDK Key, you may end up with multiple references to the same client object.
* @param sdkKey SDK Key to access configuration
* @param pollingMode The polling mode to use
* @param options Options for the specified polling mode
*/
export declare function getClient<TMode extends PollingMode | undefined>(sdkKey: string, pollingMode?: TMode, options?: OptionsForPollingMode<TMode>): IConfigCatClient;
/**
* Disposes all existing ConfigCatClient instances.
*/
export declare function disposeAllClients(): void;
/**
* Create an instance of ConfigCatClient and setup Auto polling with default options.
* @param {string} sdkkey - SDK Key to access your configuration.
* @param options - Options for Auto polling
* @deprecated This function is obsolete and will be removed from the public API in a future major version. To obtain a ConfigCatClient instance with auto polling for a specific SDK Key, please use the 'getClient(sdkKey, PollingMode.AutoPoll, options, ...)' format.
*/
export declare function createClient(sdkKey: string, options?: IJSAutoPollOptions): IConfigCatClient;
export declare function createClient(sdkkey: string, options?: IJSAutoPollOptions): IConfigCatClient;
/**
* Create an instance of ConfigCatClient and setup Auto polling.
* @param {string} sdkKey - SDK Key to access your configuration.
* @param {string} sdkkey - SDK Key to access your configuration.
* @param options - Options for Auto polling
* @deprecated This function is obsolete and will be removed from the public API in a future major version. To obtain a ConfigCatClient instance with auto polling for a specific SDK Key, please use the 'getClient(sdkKey, PollingMode.AutoPoll, options, ...)' format.
*/

@@ -18,2 +35,3 @@ export declare function createClientWithAutoPoll(sdkKey: string, options?: IJSAutoPollOptions): IConfigCatClient;

* @param options - Options for Manual polling
* @deprecated This function is obsolete and will be removed from the public API in a future major version. To obtain a ConfigCatClient instance with manual polling for a specific SDK Key, please use the 'getClient(sdkKey, PollingMode.ManualPoll, options, ...)' format.
*/

@@ -25,39 +43,32 @@ export declare function createClientWithManualPoll(sdkKey: string, options?: IJSManualPollOptions): IConfigCatClient;

* @param options - Options for Lazy loading
* @deprecated This function is obsolete and will be removed from the public API in a future major version. To obtain a ConfigCatClient instance with lazy loading for a specific SDK Key, please use the 'getClient(sdkKey, PollingMode.LazyLoad, options, ...)' format.
*/
export declare function createClientWithLazyLoad(sdkKey: string, options?: IJSLazyLoadingOptions): IConfigCatClient;
export declare function createConsoleLogger(logLevel: LogLevel): configcatcommon.IConfigCatLogger;
export declare function createConsoleLogger(logLevel: LogLevel): IConfigCatLogger;
export declare function createFlagOverridesFromMap(map: {
[name: string]: any;
}, behaviour: number): configcatcommon.FlagOverrides;
export interface IJSAutoPollOptions extends configcatcommon.IAutoPollOptions {
}, behaviour: number): FlagOverrides;
export interface IJSAutoPollOptions extends IAutoPollOptions {
}
export interface IJSLazyLoadingOptions extends configcatcommon.ILazyLoadingOptions {
export interface IJSLazyLoadingOptions extends ILazyLoadingOptions {
}
export interface IJSManualPollOptions extends configcatcommon.IManualPollOptions {
export interface IJSManualPollOptions extends IManualPollOptions {
}
export declare const DataGovernance: {
/** Select this if your feature flags are published to all global CDN nodes. */
Global: configcatcommon.DataGovernance;
/** Select this if your feature flags are published to CDN nodes only in the EU. */
EuOnly: configcatcommon.DataGovernance;
};
export declare const OverrideBehaviour: {
/**
* When evaluating values, the SDK will not use feature flags and settings from the ConfigCat CDN, but it will use
* all feature flags and settings that are loaded from local-override sources.
*/
LocalOnly: configcatcommon.OverrideBehaviour;
/**
* When evaluating values, the SDK will use all feature flags and settings that are downloaded from the ConfigCat CDN,
* plus all feature flags and settings that are loaded from local-override sources. If a feature flag or a setting is
* defined both in the fetched and the local-override source then the local-override version will take precedence.
*/
LocalOverRemote: configcatcommon.OverrideBehaviour;
/**
* When evaluating values, the SDK will use all feature flags and settings that are downloaded from the ConfigCat CDN,
* plus all feature flags and settings that are loaded from local-override sources. If a feature flag or a setting is
* defined both in the fetched and the local-override source then the fetched version will take precedence.
*/
RemoteOverLocal: configcatcommon.OverrideBehaviour;
};
export type OptionsForPollingMode<TMode extends PollingMode | undefined> = TMode extends PollingMode.AutoPoll ? IJSAutoPollOptions : TMode extends PollingMode.ManualPoll ? IJSManualPollOptions : TMode extends PollingMode.LazyLoad ? IJSLazyLoadingOptions : TMode extends undefined ? IJSAutoPollOptions : never;
export { PollingMode } from "configcat-common";
export type { IOptions } from "configcat-common";
export type { IAutoPollOptions, IManualPollOptions, ILazyLoadingOptions } from "configcat-common";
export { DataGovernance } from "configcat-common";
export type { IConfigCatLogger } from "configcat-common";
export { LogLevel } from "configcat-common";
export type { ICache } from "configcat-common";
export { ProjectConfig, RolloutRule, RolloutPercentageItem, Setting } from "configcat-common";
export type { IConfigCatClient } from "configcat-common";
export { SettingKeyValue } from "configcat-common";
export type { IEvaluationDetails, SettingTypeOf, SettingValue, VariationIdTypeOf, VariationIdValue } from "configcat-common";
export { User } from "configcat-common";
export type { IOverrideDataSource } from "configcat-common";
export { FlagOverrides, MapOverrideDataSource, OverrideBehaviour } from "configcat-common";
export { RefreshResult } from "configcat-common";
export type { IProvidesHooks, HookEvents } from "configcat-common";
//# sourceMappingURL=index.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.OverrideBehaviour = exports.DataGovernance = exports.createFlagOverridesFromMap = exports.createConsoleLogger = exports.createClientWithLazyLoad = exports.createClientWithManualPoll = exports.createClientWithAutoPoll = exports.createClient = void 0;
exports.RefreshResult = exports.OverrideBehaviour = exports.MapOverrideDataSource = exports.FlagOverrides = exports.User = exports.SettingKeyValue = exports.Setting = exports.RolloutPercentageItem = exports.RolloutRule = exports.ProjectConfig = exports.LogLevel = exports.DataGovernance = exports.PollingMode = exports.createFlagOverridesFromMap = exports.createConsoleLogger = exports.createClientWithLazyLoad = exports.createClientWithManualPoll = exports.createClientWithAutoPoll = exports.createClient = exports.disposeAllClients = exports.getClient = void 0;
var configcatcommon = require("configcat-common");
var configcat_common_1 = require("configcat-common");
var ConfigFetcher_1 = require("./ConfigFetcher");
var Cache_1 = require("./Cache");
var Version_1 = require("./Version");
/** Create an instance of ConfigCatClient and setup Auto polling with default options.
* @param {string} sdkKey - SDK Key to access your configuration.
/**
* Returns an instance of ConfigCatClient for the specified SDK Key.
* @remarks This method returns a single, shared instance per each distinct SDK Key.
* That is, a new client object is created only when there is none available for the specified SDK Key.
* Otherwise, the already created instance is returned (in which case the 'pollingMode', 'options' and 'configCatKernel' arguments are ignored).
* So, please keep in mind that when you make multiple calls to this method using the same SDK Key, you may end up with multiple references to the same client object.
* @param sdkKey SDK Key to access configuration
* @param pollingMode The polling mode to use
* @param options Options for the specified polling mode
*/
function getClient(sdkKey, pollingMode, options) {
return configcatcommon.getClient(sdkKey, pollingMode !== null && pollingMode !== void 0 ? pollingMode : configcat_common_1.PollingMode.AutoPoll, options, {
configFetcher: new ConfigFetcher_1.HttpConfigFetcher(),
cache: new configcat_common_1.InMemoryCache(),
sdkType: "ConfigCat-JS-SSR",
sdkVersion: Version_1.default
});
}
exports.getClient = getClient;
/**
* Disposes all existing ConfigCatClient instances.
*/
function disposeAllClients() {
configcatcommon.disposeAllClients();
}
exports.disposeAllClients = disposeAllClients;
/**
* Create an instance of ConfigCatClient and setup Auto polling with default options.
* @param {string} sdkkey - SDK Key to access your configuration.
* @param options - Options for Auto polling
* @deprecated This function is obsolete and will be removed from the public API in a future major version. To obtain a ConfigCatClient instance with auto polling for a specific SDK Key, please use the 'getClient(sdkKey, PollingMode.AutoPoll, options, ...)' format.
*/
function createClient(sdkKey, options) {
return createClientWithAutoPoll(sdkKey, options);
function createClient(sdkkey, options) {
return createClientWithAutoPoll(sdkkey, options);
}

@@ -18,4 +47,5 @@ exports.createClient = createClient;

* Create an instance of ConfigCatClient and setup Auto polling.
* @param {string} sdkKey - SDK Key to access your configuration.
* @param {string} sdkkey - SDK Key to access your configuration.
* @param options - Options for Auto polling
* @deprecated This function is obsolete and will be removed from the public API in a future major version. To obtain a ConfigCatClient instance with auto polling for a specific SDK Key, please use the 'getClient(sdkKey, PollingMode.AutoPoll, options, ...)' format.
*/

@@ -35,2 +65,3 @@ function createClientWithAutoPoll(sdkKey, options) {

* @param options - Options for Manual polling
* @deprecated This function is obsolete and will be removed from the public API in a future major version. To obtain a ConfigCatClient instance with manual polling for a specific SDK Key, please use the 'getClient(sdkKey, PollingMode.ManualPoll, options, ...)' format.
*/

@@ -50,2 +81,3 @@ function createClientWithManualPoll(sdkKey, options) {

* @param options - Options for Lazy loading
* @deprecated This function is obsolete and will be removed from the public API in a future major version. To obtain a ConfigCatClient instance with lazy loading for a specific SDK Key, please use the 'getClient(sdkKey, PollingMode.LazyLoad, options, ...)' format.
*/

@@ -66,29 +98,27 @@ function createClientWithLazyLoad(sdkKey, options) {

function createFlagOverridesFromMap(map, behaviour) {
return new configcatcommon.FlagOverrides(new configcatcommon.MapOverrideDataSource(map), behaviour);
return new configcat_common_1.FlagOverrides(new configcat_common_1.MapOverrideDataSource(map), behaviour);
}
exports.createFlagOverridesFromMap = createFlagOverridesFromMap;
exports.DataGovernance = {
/** Select this if your feature flags are published to all global CDN nodes. */
Global: configcatcommon.DataGovernance.Global,
/** Select this if your feature flags are published to CDN nodes only in the EU. */
EuOnly: configcatcommon.DataGovernance.EuOnly
};
exports.OverrideBehaviour = {
/**
* When evaluating values, the SDK will not use feature flags and settings from the ConfigCat CDN, but it will use
* all feature flags and settings that are loaded from local-override sources.
*/
LocalOnly: configcatcommon.OverrideBehaviour.LocalOnly,
/**
* When evaluating values, the SDK will use all feature flags and settings that are downloaded from the ConfigCat CDN,
* plus all feature flags and settings that are loaded from local-override sources. If a feature flag or a setting is
* defined both in the fetched and the local-override source then the local-override version will take precedence.
*/
LocalOverRemote: configcatcommon.OverrideBehaviour.LocalOverRemote,
/**
* When evaluating values, the SDK will use all feature flags and settings that are downloaded from the ConfigCat CDN,
* plus all feature flags and settings that are loaded from local-override sources. If a feature flag or a setting is
* defined both in the fetched and the local-override source then the fetched version will take precedence.
*/
RemoteOverLocal: configcatcommon.OverrideBehaviour.RemoteOverLocal,
};
/* Public types re-export from common-js */
// These exports should be kept in sync with the exports listed in the section "Public types for end users" of common-js/src/index.ts!
var configcat_common_2 = require("configcat-common");
Object.defineProperty(exports, "PollingMode", { enumerable: true, get: function () { return configcat_common_2.PollingMode; } });
var configcat_common_3 = require("configcat-common");
Object.defineProperty(exports, "DataGovernance", { enumerable: true, get: function () { return configcat_common_3.DataGovernance; } });
var configcat_common_4 = require("configcat-common");
Object.defineProperty(exports, "LogLevel", { enumerable: true, get: function () { return configcat_common_4.LogLevel; } });
var configcat_common_5 = require("configcat-common");
Object.defineProperty(exports, "ProjectConfig", { enumerable: true, get: function () { return configcat_common_5.ProjectConfig; } });
Object.defineProperty(exports, "RolloutRule", { enumerable: true, get: function () { return configcat_common_5.RolloutRule; } });
Object.defineProperty(exports, "RolloutPercentageItem", { enumerable: true, get: function () { return configcat_common_5.RolloutPercentageItem; } });
Object.defineProperty(exports, "Setting", { enumerable: true, get: function () { return configcat_common_5.Setting; } });
var configcat_common_6 = require("configcat-common");
Object.defineProperty(exports, "SettingKeyValue", { enumerable: true, get: function () { return configcat_common_6.SettingKeyValue; } });
var configcat_common_7 = require("configcat-common");
Object.defineProperty(exports, "User", { enumerable: true, get: function () { return configcat_common_7.User; } });
var configcat_common_8 = require("configcat-common");
Object.defineProperty(exports, "FlagOverrides", { enumerable: true, get: function () { return configcat_common_8.FlagOverrides; } });
Object.defineProperty(exports, "MapOverrideDataSource", { enumerable: true, get: function () { return configcat_common_8.MapOverrideDataSource; } });
Object.defineProperty(exports, "OverrideBehaviour", { enumerable: true, get: function () { return configcat_common_8.OverrideBehaviour; } });
var configcat_common_9 = require("configcat-common");
Object.defineProperty(exports, "RefreshResult", { enumerable: true, get: function () { return configcat_common_9.RefreshResult; } });
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = "5.6.1";
exports.default = "6.0.0";
{
"name": "configcat-js-ssr",
"version": "5.6.1",
"version": "6.0.0",
"description": "ConfigCat Feature Flags for Server Side Rendered apps like NuxtJS. Official ConfigCat SDK for Server Side Rendered to easily access feature flags.",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"module": "lib/esm/index.js",
"scripts": {

@@ -12,3 +13,3 @@ "test": "karma start karma-chrome-coverage.conf.js",

"test-chromium": "karma start karma-chromium.conf.js",
"build": "tsc && gulp tsc",
"build": "tsc -p tsconfig.build.cjs.json && tsc -p tsconfig.build.esm.json && gulp tsc",
"buildPure": "webpack && gulp webpack",

@@ -47,9 +48,12 @@ "prepare": "npm run build"

"axios": "^0.27.2",
"configcat-common": "^6.0.1"
"configcat-common": "^7.0.1",
"tslib": "^2.4.1"
},
"devDependencies": {
"@types/chai": "^4.3.3",
"@types/mocha": "^9.1.1",
"@types/node": "^18.6.5",
"chai": "^4.3.6",
"@ephesoft/webpack.istanbul.loader": "^2.2.0",
"@types/chai": "4.3.4",
"@types/mocha": "^10.0.1",
"@types/node": "^18.11.18",
"axios-mock-adapter": "^1.21.2",
"chai": "^4.3.7",
"core-js": "^3.24.1",

@@ -66,10 +70,16 @@ "gulp": "^4.0.2",

"karma-mocha": "^2.0.1",
"karma-typescript": "^5.5.3",
"mocha": "^8.1.0",
"karma-sourcemap-loader": "^0.3.8",
"karma-webpack": "^5.0.0",
"mocha": "^10.2.0",
"ts-loader": "^9.3.1",
"typescript": "^3.9.10",
"typescript": "^4.9.4",
"webpack": "^5.74.0",
"webpack-auto-inject-version": "^1.2.2",
"webpack-cli": "^4.10.0"
},
"overrides": {
"chokidar": "3.5.3",
"glob-parent": "5.1.2",
"loader-utils": "1.4.2"
}
}

@@ -34,3 +34,3 @@ # ConfigCat SDK for JavaScript Server Side Rendered applications

```js
var configCatClient = configcat.createClient("#YOUR-SDK-KEY#");
const configCatClient = configcat.getClient("#YOUR-SDK-KEY#");
```

@@ -40,22 +40,22 @@ > We strongly recommend using the *ConfigCat Client* as a Singleton object in your application.

### 4. Get your setting value:
The Promise (async/await) way:
The async/await way:
```js
configCatClient.getValueAsync("isMyAwesomeFeatureEnabled", false)
.then((value) => {
if(value) {
do_the_new_thing();
} else {
do_the_old_thing();
}
});
const value = await configCatClient.getValueAsync('isMyAwesomeFeatureEnabled', false);
if (value) {
do_the_new_thing();
} else {
do_the_old_thing();
}
```
or the Callback way:
or the Promise way:
```js
configCatClient.getValue("isMyAwesomeFeatureEnabled", false, (value) => {
if(value) {
do_the_new_thing();
configCatClient.getValueAsync('isMyAwesomeFeatureEnabled', false)
.then((value) => {
if (value) {
do_the_new_thing();
} else {
do_the_old_thing();
do_the_old_thing();
}
});
});
```

@@ -68,11 +68,10 @@

```js
const userObject = { identifier : "#USER-IDENTIFIER#" };
configCatClient.getValueAsync("isMyAwesomeFeatureEnabled", false, userObject)
.then((value) => {
if(value) {
do_the_new_thing();
} else {
do_the_old_thing();
}
});
const userObject = new configcat.User("#USER-IDENTIFIER#");
const value = await configCatClient.getValueAsync('isMyAwesomeFeatureEnabled', false, userObject);
if (value) {
do_the_new_thing();
} else {
do_the_old_thing();
}
```

@@ -79,0 +78,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 not supported yet

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