@splitsoftware/splitio-browserjs 0.10.2-rc.0 → 0.10.2-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGES.txt CHANGED
@@ -1,5 +1,6 @@
1
- 0.10.2 (October 20, 2023)
2
- - Added Split Suite module for browser. The Split Suite is an extension of the SDK that sets up the Browser RUM Agent automatically. It can be imported via `import { SplitSuite } from '@splitsoftware/splitio-browserjs/suite';` or `const { SplitSuite } = require('@splitsoftware/splitio-browserjs/suite');`. See https://help.split.io/hc/en-us/articles/360030898431-Browser-RUM-agent#sdk-integration for more information.
1
+ 0.10.2 (October XX, 2023)
2
+ - Added `defaultTreatment` property to the `SplitView` object returned by the `split` and `splits` methods of the SDK manager (Related to issue https://github.com/splitio/javascript-commons/issues/225).
3
+ - Updated @splitsoftware/splitio-commons package to version 1.10.0 that includes vulnerability fixes, and adds the `defaultTreatment` property to the `SplitView` object.
3
4
 
4
5
  0.10.1 (September 22, 2023)
5
6
  - Updated @splitsoftware/splitio-commons package to version 1.9.1. This update removes the handler for 'unload' DOM events, that can prevent browsers from being able to put pages in the back/forward cache for faster back and forward loads (Related to issue https://github.com/splitio/javascript-client/issues/759).
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.defaults = void 0;
4
4
  var index_1 = require("@splitsoftware/splitio-commons/cjs/logger/index");
5
5
  var constants_1 = require("@splitsoftware/splitio-commons/cjs/utils/constants");
6
- var packageVersion = '0.10.2-rc.0';
6
+ var packageVersion = '0.10.2-rc.1';
7
7
  /**
8
8
  * In browser, the default debug level, can be set via the `localStorage.splitio_debug` item.
9
9
  * Acceptable values are: 'DEBUG', 'INFO', 'WARN', 'ERROR', 'NONE'.
@@ -1,6 +1,6 @@
1
1
  import { LogLevels, isLogLevelString } from '@splitsoftware/splitio-commons/esm/logger/index';
2
2
  import { CONSENT_GRANTED } from '@splitsoftware/splitio-commons/esm/utils/constants';
3
- var packageVersion = '0.10.2-rc.0';
3
+ var packageVersion = '0.10.2-rc.1';
4
4
  /**
5
5
  * In browser, the default debug level, can be set via the `localStorage.splitio_debug` item.
6
6
  * Acceptable values are: 'DEBUG', 'INFO', 'WARN', 'ERROR', 'NONE'.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@splitsoftware/splitio-browserjs",
3
- "version": "0.10.2-rc.0",
3
+ "version": "0.10.2-rc.1",
4
4
  "description": "Split SDK for JavaScript on Browser",
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",
@@ -15,8 +15,7 @@
15
15
  "src",
16
16
  "types",
17
17
  "full",
18
- "scripts/ga-to-split-autorequire.js",
19
- "suite"
18
+ "scripts/ga-to-split-autorequire.js"
20
19
  ],
21
20
  "scripts": {
22
21
  "check": "npm run check:lint && npm run check:types && npm run check:version",
@@ -31,7 +30,7 @@
31
30
  "build:ga-to-split-autorequire": "terser ./node_modules/@splitsoftware/splitio-commons/src/integrations/ga/autoRequire.js --mangle --output ./scripts/ga-to-split-autorequire.js",
32
31
  "test": "npm run test:unit && npm run test:e2e",
33
32
  "test:unit": "jest",
34
- "test:e2e": "npm run test:e2e-logger && npm run test:e2e-offline && npm run test:e2e-online && npm run test:e2e-destroy && npm run test:e2e-errorCatching && npm run test:e2e-push && npm run test:e2e-gaIntegration && npm run test:e2e-consumer && npm run test:e2e-suite",
33
+ "test:e2e": "npm run test:e2e-logger && npm run test:e2e-offline && npm run test:e2e-online && npm run test:e2e-destroy && npm run test:e2e-errorCatching && npm run test:e2e-push && npm run test:e2e-consumer",
35
34
  "test:e2e-logger": "karma start karma/e2e.logger.karma.conf.js",
36
35
  "test:e2e-offline": "karma start karma/e2e.offline.karma.conf.js",
37
36
  "test:e2e-online": "karma start karma/e2e.online.karma.conf.js",
@@ -40,7 +39,6 @@
40
39
  "test:e2e-push": "karma start karma/e2e.push.karma.conf.js",
41
40
  "test:e2e-gaIntegration": "karma start karma/e2e.gaIntegration.karma.conf.js",
42
41
  "test:e2e-consumer": "karma start karma/e2e.consumer.karma.conf.js",
43
- "test:e2e-suite": "karma start karma/e2e.suite.karma.conf.js",
44
42
  "pretest-ts-decls": "npm run build:esm && npm run build:cjs && npm link",
45
43
  "test-ts-decls": "./scripts/ts-tests.sh",
46
44
  "posttest-ts-decls": "npm rm --location=global @splitsoftware/splitio-browserjs && npm install",
@@ -66,8 +64,7 @@
66
64
  "bugs": "https://github.com/splitio/javascript-browser-client/issues",
67
65
  "homepage": "https://github.com/splitio/javascript-browser-client#readme",
68
66
  "dependencies": {
69
- "@splitsoftware/browser-rum-agent": "0.3.2-rc.1",
70
- "@splitsoftware/splitio-commons": "1.9.2-rc.2",
67
+ "@splitsoftware/splitio-commons": "1.10.0",
71
68
  "@types/google.analytics": "0.0.40",
72
69
  "unfetch": "^4.2.0"
73
70
  },
@@ -2,7 +2,7 @@ import { LogLevels, isLogLevelString } from '@splitsoftware/splitio-commons/src/
2
2
  import { ConsentStatus, LogLevel } from '@splitsoftware/splitio-commons/src/types';
3
3
  import { CONSENT_GRANTED } from '@splitsoftware/splitio-commons/src/utils/constants';
4
4
 
5
- const packageVersion = '0.10.2-rc.0';
5
+ const packageVersion = '0.10.2-rc.1';
6
6
 
7
7
  /**
8
8
  * In browser, the default debug level, can be set via the `localStorage.splitio_debug` item.
@@ -3,7 +3,6 @@
3
3
  // Definitions by: Nico Zelaya <https://github.com/NicoZelaya/>
4
4
 
5
5
  /// <reference types="google.analytics" />
6
- import { SplitRumAgentConfig } from '@splitsoftware/browser-rum-agent';
7
6
 
8
7
  export as namespace SplitIO;
9
8
  export = SplitIO;
@@ -499,7 +498,12 @@ declare namespace SplitIO {
499
498
  */
500
499
  configs: {
501
500
  [treatmentName: string]: string
502
- }
501
+ },
502
+ /**
503
+ * The default treatment of the feature flag.
504
+ * @property {string} defaultTreatment
505
+ */
506
+ defaultTreatment: string,
503
507
  };
504
508
  /**
505
509
  * A promise that resolves to a feature flag view.
@@ -1022,29 +1026,6 @@ declare namespace SplitIO {
1022
1026
  pushRetryBackoffBase?: number,
1023
1027
  }
1024
1028
  }
1025
- /**
1026
- * Settings interface for Suite instances created on the browser.
1027
- * @interface IBrowserSuiteSettings
1028
- * @extends IBrowserSettings
1029
- * @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#configuration}
1030
- */
1031
- interface IBrowserSuiteSettings extends IBrowserSettings {
1032
- core: IBrowserBasicSettings['core'] & {
1033
- /**
1034
- * Traffic type of the identity provided to the RUM Agent for event tracking. @see {@link https://help.split.io/hc/en-us/articles/360019916311-Traffic-type}
1035
- * If no provided, 'user' is used as default.
1036
- * This does not affect the behavior of the SDK client: even if provided, you still need to specify the traffic type in `client.track()` calls.
1037
- *
1038
- * @property {string=} trafficType
1039
- */
1040
- trafficType?: string,
1041
- },
1042
- /**
1043
- * Optional configuration object for the RUM agent.
1044
- * @see {@link https://help.split.io/hc/en-us/articles/360030898431-Browser-RUM-agent#configuration}
1045
- */
1046
- rumAgent?: SplitRumAgentConfig
1047
- }
1048
1029
  /**
1049
1030
  * Settings interface with async storage for SDK instances created on the browser.
1050
1031
  * If your storage is synchronous (by defaut we use memory, which is sync) use SplitIO.IBrowserSettings instead.
@@ -1167,41 +1148,6 @@ declare namespace SplitIO {
1167
1148
  */
1168
1149
  manager(): IManager
1169
1150
  }
1170
- /**
1171
- * This represents the interface for the Suite instance, that is an extension of the ISDK interface.
1172
- * @interface ISuiteSDK
1173
- * @extends ISDK
1174
- */
1175
- interface ISuiteSDK extends ISDK {
1176
- /**
1177
- * Returns the default client instance of the SDK and adds its identity (i.e., user key and traffic type pair) to the RUM agent for event tracking.
1178
- *
1179
- * NOTE: if no traffic type is provided in the SDK config, 'user' will be used as default for the RUM Agent.
1180
- *
1181
- * @function client
1182
- * @returns {IClient} The client instance.
1183
- */
1184
- client(): IClient,
1185
- /**
1186
- * Returns a shared client of the SDK and adds its identity (i.e., user key and traffic type pair) to the RUM agent for event tracking.
1187
- *
1188
- * NOTE: if no traffic type is provided as second argument, 'user' will be used as default for the RUM Agent.
1189
- *
1190
- * @function client
1191
- * @param {SplitKey} key The key for the new client instance.
1192
- * @param {string=} trafficType The traffic type of the provided key, used to pass an identity to the RUM agent. If not provided, 'user' will be used as default.
1193
- * @returns {IClient} The client instance.
1194
- */
1195
- client(key: SplitKey, trafficType?: string): IClient
1196
- /**
1197
- * Destroys all client instances and remove identities from the RUM agent to stop tracking events for them.
1198
- * This method will flush any pending impressions and events, and stop the synchronization of feature flag definitions with the backend.
1199
- *
1200
- * @function destroy
1201
- * @returns {Promise<void>} A promise that resolves once the client is destroyed.
1202
- */
1203
- destroy(): Promise<void>
1204
- }
1205
1151
  /**
1206
1152
  * This represents the interface for the SDK instance with asynchronous storage and client-side API,
1207
1153
  * i.e., where client instances have a bound user key.
@@ -1,70 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SplitSuite = void 0;
4
- var objectAssign_1 = require("@splitsoftware/splitio-commons/cjs/utils/lang/objectAssign");
5
- var sets_1 = require("@splitsoftware/splitio-commons/cjs/utils/lang/sets");
6
- var constants_1 = require("@splitsoftware/splitio-commons/cjs/utils/constants");
7
- var browser_rum_agent_1 = require("@splitsoftware/browser-rum-agent");
8
- var splitFactory_1 = require("../full/splitFactory");
9
- var DEFAULT_TRAFFIC_TYPE = 'user';
10
- /**
11
- * SplitFactory for client-side with RUM Agent.
12
- *
13
- * @param config configuration object used to instantiate the Suite
14
- * @param __updateModules optional function that lets redefine internal SDK modules. Use with
15
- * caution since, unlike `config`, this param is not validated neither considered part of the public API.
16
- * @throws Will throw an error if the provided config is invalid.
17
- */
18
- function SplitSuite(config, __updateModules) {
19
- var sdk = (0, splitFactory_1.SplitFactory)(config, __updateModules);
20
- var settings = sdk.settings;
21
- // Do not setup RUM Agent if not in standalone mode
22
- if (settings.mode !== constants_1.STANDALONE_MODE)
23
- return sdk;
24
- // Setup RUM Agent
25
- var agentConfig = browser_rum_agent_1.SplitRumAgent.__getConfig();
26
- if (agentConfig.a) {
27
- settings.log.warn('RUM Agent already setup. The new Suite instance will reset the RUM Agent configuration.');
28
- }
29
- agentConfig.log = settings.log;
30
- browser_rum_agent_1.SplitRumAgent.removeIdentities(); // reset identities for new Suite
31
- browser_rum_agent_1.SplitRumAgent.setup(settings.core.authorizationKey, (0, objectAssign_1.objectAssign)({
32
- url: settings.urls.events,
33
- userConsent: settings.userConsent
34
- }, settings.rumAgent));
35
- var clients = new sets_1._Set();
36
- // Override UserConsent.setStatus to update RUM Agent consent
37
- var originalSetStatus = sdk.UserConsent.setStatus;
38
- sdk.UserConsent.setStatus = function (newStatus) {
39
- browser_rum_agent_1.SplitRumAgent.setUserConsent(newStatus);
40
- return originalSetStatus.apply(this, arguments);
41
- };
42
- // Create Suite instance extending SDK
43
- return (0, objectAssign_1.objectAssign)({}, sdk, {
44
- client: function () {
45
- var client = sdk.client.apply(sdk, arguments);
46
- if (!clients.has(client)) {
47
- clients.add(client);
48
- browser_rum_agent_1.SplitRumAgent.addIdentity({
49
- key: client.key,
50
- // For main client, use trafficType from settings. For shared clients, use second argument. If not provided, use default.
51
- trafficType: (arguments[0] ? arguments[1] : settings.core.trafficType) || DEFAULT_TRAFFIC_TYPE
52
- });
53
- // override client.destroy to remove identity from RUM Agent
54
- var originalDestroy_1 = client.destroy;
55
- client.destroy = function () {
56
- browser_rum_agent_1.SplitRumAgent.removeIdentity({
57
- key: client.key,
58
- trafficType: client.trafficType || DEFAULT_TRAFFIC_TYPE
59
- });
60
- return originalDestroy_1.apply(client, arguments);
61
- };
62
- }
63
- return client;
64
- },
65
- destroy: function () {
66
- return Promise.all((0, sets_1.setToArray)(clients).map(function (client) { return client.destroy(); }));
67
- }
68
- });
69
- }
70
- exports.SplitSuite = SplitSuite;
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DebugLogger = exports.InfoLogger = exports.WarnLogger = exports.ErrorLogger = exports.InLocalStorage = exports.SplitSuite = void 0;
4
- var browserSuite_1 = require("./browserSuite");
5
- Object.defineProperty(exports, "SplitSuite", { enumerable: true, get: function () { return browserSuite_1.SplitSuite; } });
6
- var index_1 = require("@splitsoftware/splitio-commons/cjs/storages/inLocalStorage/index");
7
- Object.defineProperty(exports, "InLocalStorage", { enumerable: true, get: function () { return index_1.InLocalStorage; } });
8
- var ErrorLogger_1 = require("@splitsoftware/splitio-commons/cjs/logger/browser/ErrorLogger");
9
- Object.defineProperty(exports, "ErrorLogger", { enumerable: true, get: function () { return ErrorLogger_1.ErrorLogger; } });
10
- var WarnLogger_1 = require("@splitsoftware/splitio-commons/cjs/logger/browser/WarnLogger");
11
- Object.defineProperty(exports, "WarnLogger", { enumerable: true, get: function () { return WarnLogger_1.WarnLogger; } });
12
- var InfoLogger_1 = require("@splitsoftware/splitio-commons/cjs/logger/browser/InfoLogger");
13
- Object.defineProperty(exports, "InfoLogger", { enumerable: true, get: function () { return InfoLogger_1.InfoLogger; } });
14
- var DebugLogger_1 = require("@splitsoftware/splitio-commons/cjs/logger/browser/DebugLogger");
15
- Object.defineProperty(exports, "DebugLogger", { enumerable: true, get: function () { return DebugLogger_1.DebugLogger; } });
@@ -1,66 +0,0 @@
1
- import { objectAssign } from '@splitsoftware/splitio-commons/esm/utils/lang/objectAssign';
2
- import { _Set, setToArray } from '@splitsoftware/splitio-commons/esm/utils/lang/sets';
3
- import { STANDALONE_MODE } from '@splitsoftware/splitio-commons/esm/utils/constants';
4
- import { SplitRumAgent } from '@splitsoftware/browser-rum-agent';
5
- import { SplitFactory } from '../full/splitFactory';
6
- var DEFAULT_TRAFFIC_TYPE = 'user';
7
- /**
8
- * SplitFactory for client-side with RUM Agent.
9
- *
10
- * @param config configuration object used to instantiate the Suite
11
- * @param __updateModules optional function that lets redefine internal SDK modules. Use with
12
- * caution since, unlike `config`, this param is not validated neither considered part of the public API.
13
- * @throws Will throw an error if the provided config is invalid.
14
- */
15
- export function SplitSuite(config, __updateModules) {
16
- var sdk = SplitFactory(config, __updateModules);
17
- var settings = sdk.settings;
18
- // Do not setup RUM Agent if not in standalone mode
19
- if (settings.mode !== STANDALONE_MODE)
20
- return sdk;
21
- // Setup RUM Agent
22
- var agentConfig = SplitRumAgent.__getConfig();
23
- if (agentConfig.a) {
24
- settings.log.warn('RUM Agent already setup. The new Suite instance will reset the RUM Agent configuration.');
25
- }
26
- agentConfig.log = settings.log;
27
- SplitRumAgent.removeIdentities(); // reset identities for new Suite
28
- SplitRumAgent.setup(settings.core.authorizationKey, objectAssign({
29
- url: settings.urls.events,
30
- userConsent: settings.userConsent
31
- }, settings.rumAgent));
32
- var clients = new _Set();
33
- // Override UserConsent.setStatus to update RUM Agent consent
34
- var originalSetStatus = sdk.UserConsent.setStatus;
35
- sdk.UserConsent.setStatus = function (newStatus) {
36
- SplitRumAgent.setUserConsent(newStatus);
37
- return originalSetStatus.apply(this, arguments);
38
- };
39
- // Create Suite instance extending SDK
40
- return objectAssign({}, sdk, {
41
- client: function () {
42
- var client = sdk.client.apply(sdk, arguments);
43
- if (!clients.has(client)) {
44
- clients.add(client);
45
- SplitRumAgent.addIdentity({
46
- key: client.key,
47
- // For main client, use trafficType from settings. For shared clients, use second argument. If not provided, use default.
48
- trafficType: (arguments[0] ? arguments[1] : settings.core.trafficType) || DEFAULT_TRAFFIC_TYPE
49
- });
50
- // override client.destroy to remove identity from RUM Agent
51
- var originalDestroy_1 = client.destroy;
52
- client.destroy = function () {
53
- SplitRumAgent.removeIdentity({
54
- key: client.key,
55
- trafficType: client.trafficType || DEFAULT_TRAFFIC_TYPE
56
- });
57
- return originalDestroy_1.apply(client, arguments);
58
- };
59
- }
60
- return client;
61
- },
62
- destroy: function () {
63
- return Promise.all(setToArray(clients).map(function (client) { return client.destroy(); }));
64
- }
65
- });
66
- }
@@ -1,6 +0,0 @@
1
- export { SplitSuite } from './browserSuite';
2
- export { InLocalStorage } from '@splitsoftware/splitio-commons/esm/storages/inLocalStorage/index';
3
- export { ErrorLogger } from '@splitsoftware/splitio-commons/esm/logger/browser/ErrorLogger';
4
- export { WarnLogger } from '@splitsoftware/splitio-commons/esm/logger/browser/WarnLogger';
5
- export { InfoLogger } from '@splitsoftware/splitio-commons/esm/logger/browser/InfoLogger';
6
- export { DebugLogger } from '@splitsoftware/splitio-commons/esm/logger/browser/DebugLogger';
@@ -1,80 +0,0 @@
1
- import { objectAssign } from '@splitsoftware/splitio-commons/src/utils/lang/objectAssign';
2
- import { _Set, setToArray } from '@splitsoftware/splitio-commons/src/utils/lang/sets';
3
- import { STANDALONE_MODE } from '@splitsoftware/splitio-commons/src/utils/constants';
4
- import { ISdkFactoryParams } from '@splitsoftware/splitio-commons/src/sdkFactory/types';
5
- import { SplitRumAgent } from '@splitsoftware/browser-rum-agent';
6
- import { SplitFactory } from '../full/splitFactory';
7
- import { IBrowserSuiteSettings } from '../../types/splitio';
8
-
9
- const DEFAULT_TRAFFIC_TYPE = 'user';
10
-
11
- /**
12
- * SplitFactory for client-side with RUM Agent.
13
- *
14
- * @param config configuration object used to instantiate the Suite
15
- * @param __updateModules optional function that lets redefine internal SDK modules. Use with
16
- * caution since, unlike `config`, this param is not validated neither considered part of the public API.
17
- * @throws Will throw an error if the provided config is invalid.
18
- */
19
- export function SplitSuite(config: IBrowserSuiteSettings, __updateModules?: (modules: ISdkFactoryParams) => void) {
20
- const sdk = SplitFactory(config, __updateModules) as any;
21
-
22
- const settings = sdk.settings;
23
-
24
- // Do not setup RUM Agent if not in standalone mode
25
- if (settings.mode !== STANDALONE_MODE) return sdk;
26
-
27
- // Setup RUM Agent
28
- const agentConfig = SplitRumAgent.__getConfig();
29
- if (agentConfig.a) {
30
- settings.log.warn('RUM Agent already setup. The new Suite instance will reset the RUM Agent configuration.');
31
- }
32
- agentConfig.log = settings.log;
33
- SplitRumAgent.removeIdentities(); // reset identities for new Suite
34
- SplitRumAgent.setup(settings.core.authorizationKey, objectAssign({
35
- url: settings.urls.events,
36
- userConsent: settings.userConsent
37
- }, settings.rumAgent));
38
-
39
- const clients = new _Set();
40
-
41
- // Override UserConsent.setStatus to update RUM Agent consent
42
- const originalSetStatus = sdk.UserConsent.setStatus;
43
- sdk.UserConsent.setStatus = function (newStatus: boolean) {
44
- SplitRumAgent.setUserConsent(newStatus);
45
- return originalSetStatus.apply(this, arguments);
46
- };
47
-
48
- // Create Suite instance extending SDK
49
- return objectAssign({}, sdk, {
50
- client() {
51
- const client = sdk.client.apply(sdk, arguments);
52
-
53
- if (!clients.has(client)) {
54
- clients.add(client);
55
-
56
- SplitRumAgent.addIdentity({
57
- key: client.key,
58
- // For main client, use trafficType from settings. For shared clients, use second argument. If not provided, use default.
59
- trafficType: (arguments[0] ? arguments[1] : settings.core.trafficType) || DEFAULT_TRAFFIC_TYPE
60
- });
61
-
62
- // override client.destroy to remove identity from RUM Agent
63
- const originalDestroy = client.destroy;
64
- client.destroy = function () {
65
- SplitRumAgent.removeIdentity({
66
- key: client.key,
67
- trafficType: client.trafficType || DEFAULT_TRAFFIC_TYPE
68
- });
69
- return originalDestroy.apply(client, arguments);
70
- };
71
- }
72
-
73
- return client;
74
- },
75
-
76
- destroy() {
77
- return Promise.all(setToArray(clients).map(client => client.destroy()));
78
- }
79
- });
80
- }
@@ -1,6 +0,0 @@
1
- export { SplitSuite } from './browserSuite';
2
- export { InLocalStorage } from '@splitsoftware/splitio-commons/src/storages/inLocalStorage/index';
3
- export { ErrorLogger } from '@splitsoftware/splitio-commons/src/logger/browser/ErrorLogger';
4
- export { WarnLogger } from '@splitsoftware/splitio-commons/src/logger/browser/WarnLogger';
5
- export { InfoLogger } from '@splitsoftware/splitio-commons/src/logger/browser/InfoLogger';
6
- export { DebugLogger } from '@splitsoftware/splitio-commons/src/logger/browser/DebugLogger';
@@ -1,5 +0,0 @@
1
- {
2
- "main": "../cjs/suite/index.js",
3
- "module": "../esm/suite/index.js",
4
- "types": "../types/suite/index.d.ts"
5
- }
@@ -1,50 +0,0 @@
1
- // Declaration file for JavaScript Browser Split Software SDK
2
- // Project: http://www.split.io/
3
-
4
- /// <reference path="../splitio.d.ts" />
5
- export = JsSdk;
6
-
7
- declare module JsSdk {
8
- /**
9
- * Split.io Suite factory function.
10
- *
11
- * The settings parameter should be an object that complies with the SplitIO.IBrowserSuiteSettings.
12
- * For more information read the corresponding article: @see {@link https://help.split.io/hc/en-us/articles/360030898431-Browser-RUM-agent#sdk-integration}
13
- */
14
- export function SplitSuite(settings: SplitIO.IBrowserSuiteSettings): SplitIO.ISuiteSDK;
15
-
16
- /**
17
- * Persistent storage based on the LocalStorage Web API for browsers.
18
- *
19
- * @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#storage}
20
- */
21
- export function InLocalStorage(options?: SplitIO.InLocalStorageOptions): SplitIO.StorageSyncFactory;
22
-
23
- /**
24
- * Creates a logger instance that enables descriptive log messages with DEBUG log level when passed in the factory settings.
25
- *
26
- * @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#logging}
27
- */
28
- export function DebugLogger(): SplitIO.ILogger;
29
-
30
- /**
31
- * Creates a logger instance that enables descriptive log messages with INFO log level when passed in the factory settings.
32
- *
33
- * @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#logging}
34
- */
35
- export function InfoLogger(): SplitIO.ILogger;
36
-
37
- /**
38
- * Creates a logger instance that enables descriptive log messages with WARN log level when passed in the factory settings.
39
- *
40
- * @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#logging}
41
- */
42
- export function WarnLogger(): SplitIO.ILogger;
43
-
44
- /**
45
- * Creates a logger instance that enables descriptive log messages with ERROR log level when passed in the factory settings.
46
- *
47
- * @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#logging}
48
- */
49
- export function ErrorLogger(): SplitIO.ILogger;
50
- }