smartlook-client
Advanced tools
Comparing version 7.0.1 to 7.0.2
@@ -5,2 +5,3 @@ declare const _default: { | ||
version?: "nextgen" | "legacy" | undefined; | ||
cookies?: boolean | undefined; | ||
} | undefined) => boolean; | ||
@@ -7,0 +8,0 @@ identify: (userId: string | number, props: { |
@@ -14,5 +14,5 @@ "use strict"; | ||
}; | ||
var _a = params !== null && params !== void 0 ? params : {}, _b = _a.region, region = _b === void 0 ? 'eu' : _b, _c = _a.version, version = _c === void 0 ? 'nextgen' : _c; | ||
var _a = params !== null && params !== void 0 ? params : {}, _b = _a.region, region = _b === void 0 ? 'eu' : _b, _c = _a.version, version = _c === void 0 ? 'nextgen' : _c, _d = _a.cookies, cookies = _d === void 0 ? true : _d; | ||
w.smartlook.api = []; | ||
w.smartlook('init', key, { region: region }); | ||
w.smartlook('init', key, { region: region, cookies: cookies }); | ||
var head = window.document.getElementsByTagName('head')[0]; | ||
@@ -19,0 +19,0 @@ var script = window.document.createElement('script'); |
@@ -9,5 +9,6 @@ type SmartlookWindow = Window & { smartlook?: any } | ||
* @param key Project key from project settings | ||
* @param params Not required parameters, default region is 'eu' and default version is 'nextgen' | ||
* @param params Not required parameters, default region is 'eu', default version is 'nextgen' | ||
* and storing metadata in cookies is enabled by default | ||
*/ | ||
init: function (key: string, params?: { region?: 'eu' | 'us'; version?: 'nextgen' | 'legacy' }): boolean { | ||
init: function (key: string, params?: { region?: 'eu' | 'us'; version?: 'nextgen' | 'legacy', cookies?: boolean }): boolean { | ||
const w = window as SmartlookWindow | ||
@@ -22,6 +23,6 @@ if (w.smartlook) { | ||
const { region = 'eu', version = 'nextgen' } = params ?? {} | ||
const { region = 'eu', version = 'nextgen', cookies = true } = params ?? {} | ||
w.smartlook.api = [] | ||
w.smartlook('init', key, { region }) | ||
w.smartlook('init', key, { region, cookies }) | ||
@@ -28,0 +29,0 @@ const head = window.document.getElementsByTagName('head')[0] |
{ | ||
"name": "smartlook-client", | ||
"version": "7.0.1", | ||
"version": "7.0.2", | ||
"description": "Official Smartlook client for easy frontend integration.", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
@@ -25,3 +25,3 @@ # Smartlook-client | ||
init(string key) | ||
init(string key, params?: { region?: 'eu' | 'us', version?: 'legacy' | 'nextgen' }) | ||
init(string key, params?: { region?: 'eu' | 'us', version?: 'legacy' | 'nextgen', cookies?: boolean }) | ||
``` | ||
@@ -28,0 +28,0 @@ |
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
20372
406