forked from splitio/javascript-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCHANGES.txt
693 lines (555 loc) · 27 KB
/
CHANGES.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
10.15.1 (Nov 12, 2020)
- Updated the version for ioredis in the package.json to be fixed to 4.18.0 given after 4.19.0 it requires Node 10, in case this SDK is installed without considering our package-lock.json file on an old Node.
- Updated TypeScript declarations to include the `urls` settings object (to connect to Split Synchronizer in proxy mode) for the non-async settings where it would be applicable.
- Bugfixing - Updating some imports of hashing utilities to use safe relative paths and avoid module resolution issues.
- Bugfixing - Updating logic to avoid a corner case issue with the sendHitTask callback handling of the GOOGLE_ANALYTICS_TO_SPLIT integration.
- Bugfixing - Updating the package.json version import to be compatible with latest standards (thanks @andrew-t-james-hm).
10.15.0 (Oct 6, 2020)
- Added impressions dedupe logic to avoid sending duplicated impressions:
- Added `ImpressionsCount` cache to count impressions generated per feature.
- Added `ImpressionObserver` to detect previous generated impression.
- Added new endpoint (`testImpressions/count`) to send all the generated impressions in a time frame.
- Added beacon endpoint for ImpressionsCount.
- Added murmur3 128 bits hashing and splitted logic between browser and node.
- Added `OPTIMIZED` and `DEBUG` modes in order to enabling/disabling how impressions are going to be sent into Split servers,
- `OPTIMIZED`: will send unique impressions in a timeframe in order to reduce how many times impressions are posted to Split.
- `DEBUG`: will send every impression generated to Split.
- Updated JSON bulk properties for Impressions to decrease the payload size.
- Updated `ImpressionsTracker` and `ImpressionTracker` to be only one and be used for both type of evaluations: `getTreatment` and `getTreatments`.
- Bugfixing - added URI encoding of user keys to avoid HTTP errors when fetching MySegments for keys with special characters.
10.14.2 (Sep 18, 2020)
- Updated `node-fetch` dependency to fix a vulnerability.
- Bugfixing - updated the feature detection of Set global constructor to avoid possible reference errors.
10.14.1 (Aug 13, 2020)
- Updated push streaming support for Node to optimize requests to Split services.
- Bugfixing - Replaced the use of `for...in` statements since it iterates over enumerable properties on the prototype chain, which might be polluted by code external to the library.
10.14.0 (Jul 31, 2020)
- Added `sync.splitFilters` property to SDK configuration to pass a list of filters for the splits that will be downloaded. Read more in our docs.
- Added expiration policy to split cache for browsers using localStorage: cache is cleared after 10 days of the last successful update.
- Updated babel configuration to remove core-js dependency and refactored code in favor of size reduction of UMD, ESM and CommonJS builds.
10.13.0 (Jun 25, 2020)
- Updated client.ready() and manager.ready() functions to be consumed on demand and return a promise reflecting the current status of the SDK at the time the method was invoked.
- Updated readiness events on consumer mode: the SDK emits SDK_READY event once the connection to Redis cache is successful.
- Updated streamingEnabled default value from false to true, to use streaming synchronization by default.
- Removed the use of Promise.prototype.finally to avoid issues with some promise polyfills.
10.12.1 (May 18, 2020)
- Updated logging messages for streaming notifications to DEBUG log level.
- Updated asynchronous logic handling to avoid async/await syntax in order to remove regenerator-runtime dependency.
- Removed axios HTTP library in favor of fetch for browsers (with XHR as fallback) and node-fetch for Node JS.
10.12.0 (April 30, 2020)
- Added support for the new Split streaming architecture. When enabled, the SDK will not poll for updates but instead receive notifications every time there's a change in your environments,
allowing to process those much quicker. If disabled (default) or in the event of an issue, the SDK will fallback to the known polling mechanism to provide a seamless experience.
10.11.1 (Mar 19, 2020)
- Updated @babel/runtime-corejs3, @types/node and several dev dependencies.
- Updated the name of the "events" config of GOOGLE_ANALYTICS_TO_SPLIT integration to "hits".
10.11.0 (Mar 13, 2020)
- Added integrations property to configuration which could receive a list of valid integrations.
- Added support of inbound and outbound SDK to SDK integrations for Google Analytics. Read more in our documentation's integrations section.
- Updated logging logic to avoid calling console.error in the client side.
- Updated logging error messages priority to significantly reduce the amount of error level logs that can't be silenced.
- Updated axios to 0.19.2 and few other minor updates on dev dependencies.
- Updated default metricsRefreshRate from 60s to 120s and reduced the log level from ERROR to INFO for telemetry post failures.
- Bugfixing - Emit SDK_UPDATE in localhost only when mock was actually updated.
10.10.0 (Jan 10, 2020)
- Added SDK_READY_FROM_CACHE event, which will be emitted in LocalStorage mode when the SDK finds split cache in the storage of the browser.
- Updated a dependency to fix a vulnerability (serialize-javascript).
- Updated multiple dependencies and dev dependencies (@types/node, axios, core-js, events, sinon, tape and the babel cli, core, preset-env, register and plugin-transform-runtime)
10.9.2 (Nov 20, 2019)
- Bugfixing - When using Redis, return expire result to avoid race condition with redis disconnection due to a client destroy.
- Sonar - Removed extra parameter from function invocation to remove the only bug highlighted by Sonar.
10.9.1 (Nov 7, 2019)
- Bugfixing - Avoid certain keys (containing one of three keywords) on the browser to generate a request to the wrong endpoint.
- Added SonarQube integration.
10.9.0 (Oct 24, 2019)
- Added listener for 'unload' DOM events to push remaining impressions and events when the browser page is closed or reloaded.
- Added setting core.IPAddressesEnabled to disable reporting IP Addresses and Machine name back to Split cloud.
- Updated Redis storage to fetch multiple splits at once for getTreatments/getTreatmentsWithConfig.
- Updated most dependencies to their latest versions. Biggest change is babel (from 6 to 7), Webpack 3 to 4, Karma and ioredis.
10.8.4 (Sep 24, 2019)
- Added module "events" as optional dependency.
- Removed dependency on "util" module.
- Updated transport module to use a local axios instance instead of the global one, to avoid polluting the shared one.
- Updated input validation log when trying to get data of a non-existent split to have level WARN instead of ERROR.
10.8.3 (Sep 16, 2019)
- Updated two default values on startup configuration for Browsers:
- startup.readyTimeout default value went up from 1.5s to 10s.
- startup.retriesOnFailureBeforeReady default value went up from 1.5s to 5s.
- Updated trafficType from manager to 'localhost' when the SDK is running in localhost mode.
- Updated polling logic to stop and restart mySegments data synchronization (on browsers) when not currently used on Splits.
10.8.2 (Jul 26, 2019)
- Added `/src` folder to the npm package distribution for users that needs to transpile the package themselves.
- Bugfixing - Incorrect warnings caused by TrafficType storage counter when a Split is updated for inMemory and LocalStorage mode.
- Updated three dev dependencies to remove vulnerability warnings when running npm audit (lodash, set-value, mixin-deep).
10.8.1 (May 31, 2019)
- Updated axios version to 0.19.0 to remove a DoS vulnerability (not affecting the SDK but worth updating).
10.8.0 (May 23, 2019)
- Added support for optional event properties via our client.track() method. Read more in our docs!
10.7.2 (May 15, 2019)
- Bugfixing - Fixing ES6 import syntax for LabelConstants module.
10.7.1 (May 10, 2019)
- Added Block Until Ready functionality support for consumer clients (Redis mode on Node) to make integration code work the same between modes.
- Added more Input and Usage Validation rules, including an extra label for impressions when the SDK is not ready.
- Updated the SDK Redis adapter to handle pending commands when disconnecting from the Redis server.
- Bugfixing - Clearing up readyTimeout after we don't need it anymore. It also fixes the missleading SDK_READY_TIMED_OUT error log when using Redis.
10.7.0 (Apr 30, 2019)
- Added Block Until Ready functionality to the manager, shared with the main client. Now you can subscribe to SDK events or use the .ready() promise from the manager as well.
- Added Dynamic Configurations support through two new methods that mimick the regular ones, changing the type of what is returned.
- getTreatmentWithConfig: Same as getTreatment, but instead of a string it returns a map with treatment and config as a stringified JSON.
- getTreatmentWithConfig: Same as getTreatments, but instead of a map of string it returns a map of objects with treatment and config as a stringified JSON.
- Added configs to SplitViews returned by the manager module.
- Updated localhost mode. Now besides supporting the old text files with `.split` extension (to be deprecated soon), we support YAML (.yaml/.yml) files where you can
define configurations for your treatments and also whitelisted keys. Read more in our docs!
- Updated manager method to avoid creating more than one instance.
- Updated how we handle timeout per request, setting startup.requestTimeoutBeforeReady to less than 1 applies no timeout per request.
10.6.1 (Mar 15, 2019)
- Updated default value for scheduler.featuresRefreshRate on NodeJS. New default is 5 seconds.
10.6.0 (Feb 12, 2019)
- BREAKING CHANGE: Updated impressions cache for Redis storage to reduce the amount of Redis operations by using a single queue (Must use Synchronizer 2.x or above with this or newer SDK versions).
- Added stricter validations to the input of the SDK api to provide better and faster feedback in case of missuse. We want our users to be able to diagnose issues sooner,
instead of when you can't find the data you're looking for. As part of this, some error logs (just logs) will be visible even with the SDK Logger disabled.
- Updated getTreatments to have it's own latency metric for the whole operation, instead of one per each feature evaluation.
- Updated default values on configuration for NodeJS.
- startup.readyTimeout default value went up from 0s (no timeout limit) to 15s.
- startup.retriesOnFailureBeforeReady default value went up from 0 (no retries) to 1.
- Bugfixing - Preventing "Uncaught in promise (undefined)" error for .ready() promise when no error handlers are attached to it.
- Bugfixing - Always throw JS errors inside callbacks attached to the SDK, so developers don't miss them.
10.5.1 (Dec 20, 2018)
- Bugfixing - Fixing an issue where a Split with Traffic Allocation set to one would return the default treatment for 100% of the traffic (instead of 99%).
10.5.0 (Nov 7, 2018)
- Added custom impression listener feature, so customers can receive all the impressions data on a callback to handle as they place.
Completely optional, the only requirement is that the element being set as impression listener should have a method called `logImpression`
where they'll receive all the data. Read more in our docs!
- Added Redis support for track events. Now if you're running the `split-synchronizer` and the Node SDK on `consumer mode`, your track events
will go to Redis and be sent to Split by the synchronizer.
- Added a wrapper on top of ioredis to better handle operations and reduce unwanted library effects.
- Removed unnecessary keys/scans on Redis.
- Bugfixing - Calling factory.client on the browser with the same key used on configuration created a new unnecessary instance.
- Bugfixing - Fixing multiple instances of the client without specific scheduler configurations cause overflow on timeout values.
10.4.0 (Oct 4, 2018)
- Removed dependency for logging library.
- Removed dependency on lodash.
- Added log level support for SDK logs using our own Logger implementation. Now besides just enable/disable,
you can set the log level as a string (more information on our docs or on Detailed-README.md).
- Added automatic cleanup and data flush for NodeJS on SIGTERM signals.
- Updated default value for startup.requestTimeoutBeforeReady on the Browser from 0.8 seconds to 1.5 seconds to match startup.readyTimeout.
- Updated dependency versions.
- Bugfixing - Capturing uncaught exception on some http and network errors.
- Bugfixing - IE - Producer names logged as undefined.
10.3.3 (Aug 8, 2018)
- Removing logplease dependency hosted on GitHub.
10.3.2 (Jun 19, 2018)
- Updating logging utility check for Node environments.
10.3.1 (Jun 4, 2018)
- Added events npm package as a dependency.
10.3.0 (May 10, 2018)
- Input and output validations.
- Improved how the sdk parse the key.
- Not push impressions if matchingKey is invalid.
- Fixed memory leak on events factory.
- Improved UT for the node sdk.
- TS declarations now accept boolean properties on Attributes.
10.2.0 (April 3, 2018)
- Added greenkeeper configuration within package.json.
- Updated several libraries versions.
- Removed global polyfills.
10.1.1 (March 20, 2018)
- Bugfixing - getTreatment will return 'control' and the impression registered
will have label 'exception' when there is a Redis Exception.
10.1.0 (March 8, 2018)
- Replaced isomorphic-fetch with axios.
10.0.0 (Feb 26, 2018)
- Migrated source code to es modules.
- Localhost mode uses fewer dependencies now.
- Removed flowtype since it was not used anymore.
- Udpated to last node LTS.
- Added package-lock.json.
- Fixed eslint configuration.
9.4.0 (Jan 12, 2018)
- Adding support for client.track method, for tracking custom events.
- Adding trafficType as an optional core setting. If provided on the browser it will be binded to the client as the key.
- TypeScript declarations polishing.
- Updated SDK labels.
- Bugfixing - Shared clients (browser) were ready even if the main client was not.
- Bugfixing - Shared clients (browser) from different SDK instances should be separate.
- Bugfixing - When using API key with wrong permissions, Node was throwing a false ready event (without segments).
- Bugfixing - Localhost mode was trying to flush impressions when client.destroy was invoked.
9.3.7 (Dec 22, 2017)
- Updated SDK labels.
9.3.6 (Oct 12, 2017)
- Fixed an issue that was not rejecting client.ready() on SDK_READY_TIMED_OUT event.
- Fixed an issue where the SDK required a key even on localhost mode.
- Added custom message for 404 errors.
- Updated TypeScript declaration files for exposing startup settings on NodeJS.
9.3.5 (Sep 13, 2017)
- Internal context module added.
- Removed /src folder and some misc files from NPM package.
- Dependencies update & cleanup.
9.3.4 (Aug 23, 2017)
- Removed FullStory integration
9.3.3 (Aug 15, 2017)
- Improved metrics collection.
9.3.2 (Aug 9, 2017)
- Adding support for Node v0.10.X
9.3.1 (Jul 28, 2017)
- Bugfixing - Fixed a bug on Manager API which was not retrieving the right treatments for a Split on some cases.
9.3.0 (Jul 25, 2017)
- Several new matchers have been released:
- Dependency Matchers
- Boolean Matchers
- Regex Matchers
9.2.2 (Jul 20, 2017)
- Bugfixing - Added support into the SDK to flush impressions before destroy the instance.
9.2.1 (May 19, 2017)
- Bugfixing - Issue with dependency that exposes untranspiled code through cjs require, causes
problems on IE and Node 3.
9.2.0 (May 11, 2017)
- Dropped migration build. Migration packages will no longer receive updates.
- Updated logging functionality. SDK will handle logging with a minimalistic enable/disable approach.
Now you have three ways to enable/disable SDK logging:
1. By setting the localStorage.splitio_debug (browser) or SPLITIO_DEBUG environment var (node)
with 'on', 'enable' or 'enabled'.
2. By passing an extra setting when instantiating the SDK.
```js
var splitio = require('@splitsoftware/splitio');
var settings = {
core: {
authorizationKey: 'YOUR_API_KEY',
key: 'CUSTOMER_KEY' // If on the browser.
},
debug: true // Boolean flag for enabling logs. Default value is false.
};
var sdk = splitio(settings);
```
3. By calling the SDK Logger API (no need for browser refresh):
```js
var splitio = require('@splitsoftware/splitio');
var sdk = splitio({
core: {
authorizationKey: 'YOUR_API_KEY',
key: 'CUSTOMER_KEY' // If on the browser.
}
});
// Logger API.
sdk.Logger.enable();
sdk.Logger.disable();
```
- Added Time Tracker logs. When logs are enabled, we log how much time takes to complete
SDK important tasks, like getting ready, downloading important information or pushing
metrics and impressions to Split.
- Bugfixing - Return correct label when consulted Split is not found.
9.1.1 (May 03, 2017)
- Bugfixing - Fixed invalid behaviour when using native Fetch API and comparing statusText
instead of resp.ok
9.1.0 (April 21, 2017)
- Adding support for STRING matchers.
- client.destroy() will disconnect from Redis instance, if you are using that storage.
- Improved support for multiple SDK instances working at the same time.
- Improved attribute values type coercion.
- No API changes.
9.0.0 (April 17, 2017)
- Adding support for SET matchers.
- Added some type coercion for attribute values, in case we don't receive a value of the expected type.
- No API changes.
8.2.0 (April 12, 2017)
- Adding traffic allocation support.
- Adding support for murmur hashing algorithm.
- Adding getTreatments method to client API. For example:
```js
var treatmentsMap = client.getTreatments('CUSTOMER_KEY', ['Split_1', 'Split_2']);
/*
* treatmentsMap will be an object mapping splits with treatments. For example:
* {
* Split_1: 'on',
* Split_2: 'off
* }
*/
```
- Bugfixing on manager API for localhost.
8.1.3 (April 11, 2017)
- No API changes. Bug fixing release.
8.1.2 (April 6, 2017)
- Bug fixing release to improve startup performance.
8.1.1 (March 31, 2017)
- Small fix on declaration files.
8.1.0 (March 30, 2017)
- No API changes.
- Added typescript support. SplitSDK custom types live on the SplitIO namespace.
For example:
```ts
const myTreatment: SplitIO.Treatment;
const myBrowserSettings: SplitIO.IBrowserSettings;
```
8.0.0 (March 10, 2017)
- New API to improve development experience. We added a migration layer so you
could use the new version of the SDK and make the migration when you have
time.
In the browser we only need:
```html
<script src="//cdn.split.io/sdk/split-7.4.0.min.js"></script>
```
Change by:
```html
<script src="//cdn.split.io/sdk/split-migration-8.0.0.min.js"></script>
```
In NodeJS or CommonJS environments:
```js
var sdk = require('@splitsoftware/splitio');
```
Change with:
```js
var sdk = require('@splitsoftware/splitio/migration');
```
- NodeJS now added support for Redis to keep consistency across multiple SDK
instances.
We have added a new setting parameter to control which storage use, and how
the SDK works internally:
```js
const SplitFactory = require('@splitsoftware/splitio');
const config = {
mode: 'consumer',
core: {
authorizationKey: '<your-api-token>'
},
storage: {
type: 'REDIS',
options: {
url: 'redis://<your-redis-server>:<your-redis-server-port>/0'
},
prefix: 'nodejs' // Optional prefix to prevent any kind of data collision between SDK versions.
}
};
const client = SplitFactory(config);
// Redis in NodeJS is async so we can use async/await syntax
const treatment = await client.getTreatment('my-feature-comming-from-localstorage');
// or just use the returned promise
client.getTreatment('my-feature-comming-from-localstorage').then(treatment => {
// do something with the treatment
});
```
- Added Manager API to query the state of the SDK. Please check the official
documenation for details.
- In Browser land, we can now enable localStorage as backend so we can reload
the SDK quickly without downloading all the data again.
This should improve the ready event significantly when you have a good amount
of Splits in your setup.
```js
const config = {
core: {
authorizationKey: '<your-api-token>',
key: '<user-key>'
},
storage: {
type: 'LOCALSTORAGE'
}
};
const factory = splitio(config);
const client = factory.client();
const treatment = client.getTreatment('my-feature-comming-from-localstorage');
```
- Added support for offline changes release to improve development experience,
specially in NodeJS where we used to have a server running and spin it up each
time we change a treatment is a headache.
```js
const config = {
core: {
authorizationKey: '<your-api-token>',
key: '<user-key>'
},
scheduler: {
offlineRefreshRate: 15 // update internal SDK state each 15 sec
},
features: {
mySplit: 'on'
}
};
const factory = splitio(config);
const client = factory.client();
await client.ready();
client.getTreatment('my_feature') === 'on'; // true
factory.settings.features.my_feature = 'off'; // Apply this cache programatically
client.getTreatment('my_feature') === 'off'; // Some time after you will be able to verify this
```
7.4.0 (January 23, 2017)
- None API changes. Bug fixing release.
7.3.0 (January 19, 2017)
- Small addition to SDK configurations so you can inject bucketing key and labels.
7.1.1 (November 16, 2016)
- None API changes. Bug fixing release.
7.1.0 (November 15, 2016)
- None API changes. Bug fixing release.
7.0.1 (September 16, 2016)
- Huge project refactoring, specially focus on simplicity. We have replaced the
library building system to get more power while we generate the release.
- Improved documentation.
6.0.1 (June 24, 2016)
- Critical bug fixed which prevent ready state of the SDK.
6.0.0 (June 24, 2016)
- In the browser land we allow quick retries before start using the refresh
rates defined for segments and splits, plus the possibility of receive an
event when the SDK is taking to much time to startup.
```html
<script src="//cdn.split.io/sdk/split-6.0.0.min.js"></script>
<script>
var sdk = splitio({
core: {
authorizationKey: '<your-token>',
key: 'myuser@domain.com'
},
startup: {
// timeout an *initial* request after 0.8 seconds (only affects startup)
requestTimeoutBeforeReady: 0.8,
// how many quick retries are allowed before use the schedulers refresh
// rates (only affects startup)
retriesOnFailureBeforeReady: 1,
// maximum amount of seconds we are going to wait for the ready event
readyTimeout: 1.5
}
});
sdk.on(sdk.Event.SDK_READY_TIMED_OUT, function () {
// this callback will be called after 1.5 seconds if and only if the SDK
// is not ready for that time
});
sdk.on(sdk.Event.SDK_READY, function () {
// the SDK is ready for start making evaluations with your data
});
sdk.on(sdk.Event.SDK_UPDATE, function () {
// fired each time the SDK state change
});
</script>
```
5.1.1 (June 13, 2016)
- None API changes. Bug fixing release.
5.1.0 (June 9, 2016)
- Bug fixing release.
5.0.0 (June 6, 2016)
- Added support for multiple instances.
```html
<script src="//cdn.split.io/sdk/split-5.0.0.min.js"></script>
<script>
// instanciation
var dynamic1 = splitio({
core: {
authorizationKey: '<your-token>',
key: 'myuser@domain.com'
}
});
var dynamic2 = splitio({
core: {
authorizationKey: '<your-token>',
key: 'annoy@domain.com'
}
});
// usage
var t1 = dynamic1.getTreatment('split-name');
var t2 = dynamic2.getTreatment('another-split-name');
// stop SDK
dynamic1.destroy();
dynamic2.destroy();
// unreference
dynamic1 = null;
dynamic2 = null;
</script>
```
- SDK instances inherit from EventEmitter.
```html
<script src="//cdn.split.io/sdk/split-5.0.0.min.js"></script>
<script>
var sdk = splitio({
core: {
authorizationKey: '<your-token>',
key: 'myuser@domain.com'
}
});
sdk.on(sdk.Event.SDK_READY, function sdkReadyEvent() {
// This event will be fired once
});
sdk.on(sdk.Event.SDK_UPDATE, function sdkUpdateEvent() {
// This event will be fired each time the SDK downloads an update
});
</script>
```
4.0.0 (April 13, 2016)
- No more url changes required to switch to development mode.
- Before (3.0.0 or earlier)
```html
<script src="https://cdn.split.io/sdk/offline-3.0.0.js"></script>
<script>
var sdk = splitio({
features: {
feature_name_1: 'treatment_value_1',
feature_name_2: 'treatment_value_2',
...
}
});
</script>
```
- After (4+)
```html
<script src="https://cdn.split.io/sdk/split-4.0.0.js"></script>
<script>
var sdk = splitio({
core: {
authorizationKey: 'localhost'
},
features: {
feature_name_1: 'treatment_value_1',
feature_name_2: 'treatment_value_2',
...
}
});
</script>
```
Now you can forget the switch between urls, everything is bundled into the same
package!
3.0.0 (April 10, 2016)
- Added support for attributes.
```js
var sdk = splitio({
core: {
authorizationKey: 'c1l5vkd50gimccout3c03pntbu', // your API key
key: '4a2c4490-ced1-11e5-9b97-d8a25e8b1578' // your customer id
}
});
var treatment = sdk.getTreatment('my_feature', {
age: 24,
likes: ['apple', 'orange'],
dob: new Date('1991-05-22').getTime()
});
```
- Minor bug fixes and code clean up.
2.1.0 (March 29, 2016)
- Added better handling of possible error situations when:
1. If there is none defaultTreatment present, use 'control' treatment.
2. Unexpected matcher structures should produce a 'control' treatment.
2.0.0 (March 21, 2016)
- Breaking Changes
- If you are using custom refresh rates, please change them from milliseconds to
seconds:
```js
var sdk = splitio({
core: {
authorizationKey: 'c1l5vkd50gimccout3c03pntbu', // your API key
key: '4a2c4490-ced1-11e5-9b97-d8a25e8b1578' // your customer id
},
scheduler: {
featuresRefreshRate: 60, // in 2.x 60 sec, in 1.x 60000 milliseconds
segmentsRefreshRate: 60, // in 2.x 60 sec, in 1.x 60000 milliseconds
metricsRefreshRate: 30, // in 2.x 30 sec, in 1.x 30000 milliseconds
impressionsRefreshRate: 30 // in 2.x 30 sec, in 1.x 30000 milliseconds
}
});
```
- New features
- Based on users feedback, the new recommended values for all the refresh rates are:
```js
scheduler: {
featuresRefreshRate: 30, // in 2.x 30 sec, in 1.x 60000 milliseconds (1min)
segmentsRefreshRate: 60, // in 2.x 60 sec, in 1.x 60000 milliseconds (1min)
metricsRefreshRate: 60, // in 2.x 60 sec, in 1.x 300000 milliseconds (5min)
impressionsRefreshRate: 60 // in 2.x 60 sec, in 1.x 300000 milliseconds (5min)
}
```
1.0.1 (March 16, 2016)
- Make it public in npm
1.0.0 (March 15, 2016)
- Initial public release