configcat-js-ssr
Advanced tools
Comparing version 2.0.2 to 3.0.0
@@ -5,8 +5,7 @@ import { ICache } from "configcat-common"; | ||
cache: { | ||
[sdkKey: string]: ProjectConfig; | ||
[key: string]: ProjectConfig; | ||
}; | ||
Set(sdkKey: string, config: ProjectConfig): void; | ||
Get(sdkKey: string): ProjectConfig; | ||
private getLocalStorageKey; | ||
set(key: string, config: ProjectConfig): void; | ||
get(key: string): ProjectConfig; | ||
} | ||
//# sourceMappingURL=Cache.d.ts.map |
@@ -7,6 +7,6 @@ "use strict"; | ||
} | ||
LocalStorageCache.prototype.Set = function (sdkKey, config) { | ||
this.cache[sdkKey] = config; | ||
LocalStorageCache.prototype.set = function (key, config) { | ||
this.cache[key] = config; | ||
try { | ||
localStorage.setItem(this.getLocalStorageKey(sdkKey), btoa(JSON.stringify(config))); | ||
localStorage.setItem(key, btoa(JSON.stringify(config))); | ||
} | ||
@@ -17,4 +17,4 @@ catch (ex) { | ||
}; | ||
LocalStorageCache.prototype.Get = function (sdkKey) { | ||
var config = this.cache[sdkKey]; | ||
LocalStorageCache.prototype.get = function (key) { | ||
var config = this.cache[key]; | ||
if (config) { | ||
@@ -24,7 +24,7 @@ return config; | ||
try { | ||
var configString = localStorage.getItem(this.getLocalStorageKey(sdkKey)); | ||
var configString = localStorage.getItem(key); | ||
if (configString) { | ||
var config_1 = JSON.parse(atob(configString)); | ||
if (config_1) { | ||
this.cache[sdkKey] = config_1; | ||
this.cache[key] = config_1; | ||
return config_1; | ||
@@ -39,7 +39,4 @@ } | ||
}; | ||
LocalStorageCache.prototype.getLocalStorageKey = function (sdkKey) { | ||
return "ConfigCat_v4" + sdkKey; | ||
}; | ||
return LocalStorageCache; | ||
}()); | ||
exports.LocalStorageCache = LocalStorageCache; |
import * as configcatcommon from "configcat-common"; | ||
import { IConfigCatClient } from "configcat-common/lib/ConfigCatClient"; | ||
import { LogLevel } from "configcat-common/lib/index"; | ||
/** Create an instance of ConfigCatClient and setup Auto polling with default options.*/ | ||
export declare function createClient(sdkKey: string): IConfigCatClient; | ||
/** 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 | ||
*/ | ||
export declare function createClient(sdkKey: string, options?: IJSAutoPollOptions): IConfigCatClient; | ||
/** | ||
@@ -31,2 +34,3 @@ * Create an instance of ConfigCatClient and setup Auto polling. | ||
} | ||
export declare type DataGovernance = configcatcommon.DataGovernance; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -6,5 +6,8 @@ "use strict"; | ||
var Cache_1 = require("./Cache"); | ||
/** Create an instance of ConfigCatClient and setup Auto polling with default options.*/ | ||
function createClient(sdkKey) { | ||
return this.createClientWithAutoPoll(sdkKey); | ||
/** 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 | ||
*/ | ||
function createClient(sdkKey, options) { | ||
return this.createClientWithAutoPoll(sdkKey, options); | ||
} | ||
@@ -11,0 +14,0 @@ exports.createClient = createClient; |
{ | ||
"name": "configcat-js-ssr", | ||
"version": "2.0.2", | ||
"version": "3.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.", | ||
@@ -43,3 +43,3 @@ "main": "lib/index.js", | ||
"axios": "^0.19.2", | ||
"configcat-common": "^2.5.1" | ||
"configcat-common": "^4.0.0" | ||
}, | ||
@@ -57,5 +57,5 @@ "devDependencies": { | ||
"karma-coverage": "^2.0.2", | ||
"karma-mocha": "^1.3.0", | ||
"karma-mocha": "^2.0.1", | ||
"karma-typescript": "^5.0.2", | ||
"mocha": "^5.2.0", | ||
"mocha": "^8.1.0", | ||
"ts-loader": "^6.2.2", | ||
@@ -62,0 +62,0 @@ "typescript": "^3.8.3", |
@@ -10,6 +10,6 @@ # ConfigCat SDK for JavaScript Server Side Rendered applications | ||
[![Build Status](https://travis-ci.com/configcat/js-sdk.svg?branch=master)](https://travis-ci.com/configcat/js-sdk) | ||
[![codecov](https://codecov.io/gh/configcat/js-sdk/branch/master/graph/badge.svg)](https://codecov.io/gh/configcat/js-sdk) | ||
[![Known Vulnerabilities](https://snyk.io/test/github/configcat/js-sdk/badge.svg?targetFile=package.json)](https://snyk.io/test/github/configcat/js-sdk?targetFile=package.json) | ||
![License](https://img.shields.io/github/license/configcat/js-sdk.svg) | ||
[![Build Status](https://travis-ci.com/configcat/js-ssr-sdk.svg?branch=master)](https://travis-ci.com/configcat/js-ssr-sdk) | ||
[![codecov](https://codecov.io/gh/configcat/js-ssr-sdk/branch/master/graph/badge.svg)](https://codecov.io/gh/configcat/js-ssr-sdk) | ||
[![Known Vulnerabilities](https://snyk.io/test/github/configcat/js-ssr-sdk/badge.svg?targetFile=package.json)](https://snyk.io/test/github/configcat/js-ssr-sdk?targetFile=package.json) | ||
![License](https://img.shields.io/github/license/configcat/js-ssr-sdk.svg) | ||
[![](https://data.jsdelivr.com/v1/package/npm/configcat-js-ssr/badge)](https://www.jsdelivr.com/package/npm/configcat-js-ssr) | ||
@@ -16,0 +16,0 @@ [![NPM](https://nodei.co/npm/configcat-js-ssr.png)](https://nodei.co/npm/configcat-js-ssr/) |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
187
90079
+ Addedconfigcat-common@4.6.2(transitive)
- Removedconfigcat-common@2.5.1(transitive)
Updatedconfigcat-common@^4.0.0