@optimizely/optimizely-sdk
Advanced tools
Changelog
[4.0.0-rc.1] - April 17, 2020
"module"
property of package.json
points to dist/optimizely.browser.es.min.js
(#445)Changelog
[4.0.0-alpha.1] - March 4, 2020
Removed Promise
polyfill from browser entry point (417).
Changed functionality of JSON schema validation in all entry points (442).
skipJSONValidation
flag was used by the user to specify whether the JSON object should be validated.skipJSONValidation
has been removed entirely from all entry points. Instead, a user will need to import jsonSchemaValidator
from @optimizely/optimizely-sdk/dist/optimizely.json_schema_validator.min.js
and pass it to createInstance
to perform validation as shown below:const optimizelySDK = require('@optimizely/optimizely-sdk');
const jsonSchemaValidator = require('@optimizely/optimizely-sdk/dist/optimizely.json_schema_validator.min');
// Require JSON schema validation for the datafile
var optimizelyClientInstance = optimizely.createInstance({
datafile: datafile,
jsonSchemaValidator: jsonSchemaValidator,
});
Changelog
[3.4.0] - January 21th, 2020
getOptimizelyConfig()
to get a snapshot of project configuration static data.OptimizelyConfig
instance which includes a datafile revision number, all experiments, and feature flags mapped by their key values.getOptimizelyConfig
- OptimizelyConfig
object will be cached and reused for the lifetime of the datafile.'launched'
experiment status
'running'
or 'launched'
would return non-null
variations from activate
and getVariation
, and generate impression events from activate
'running'
experiments will return non-null
variations and generate impressionsChangelog
[3.4.0-beta] - December 18th, 2019
getOptimizelyConfig()
to get a snapshot copy of project configuration static data.OptimizelyConfig
instance which includes a datafile revision number, all experiments, and feature flags mapped by their key values.Changelog
[3.3.1] - October 25th, 2019
console.error
.Changelog
[3.3.0] - September 25th, 2019
activate
, track
, and isFeatureEnabled
will be held in a queue until the configured batch size is reached, or the configured flush interval has elapsed. Then, they will be combined into a request and sent to the event dispatcher.eventBatchSize
and eventFlushInterval
number properties in the object you pass to createInstance
.eventBatchSize
defaults to 10
. eventFlushInterval
defaults to 30000
in Node and 1000
in browsers.localStorage
mitigation against lost events in the browser
localStorage
, and when a response is received, they are removed from localStorage
.localStorage
, they will be sent, and removed from localStorage
when a response is received.close
method to return a Promise
representing the process of closing the instance. When close
is called, any events waiting to be sent as part of a batched event request will be immediately batched and sent to the event dispatcher.
close
returns a Promise
that fulfills after the event dispatcher calls the response callback for each request. Otherwise, close
returns an immediately-fulfilled Promise
.Promise
returned from close
is fulfilled with a result object containing success
(boolean) and reason
(string, only when success is false
) properties. In the result object, success
is true
if all events in the queue at the time close was called were combined into requests, sent to the event dispatcher, and the event dispatcher called the callbacks for each request. success
is false if an unexpected error was encountered during the close process.getFeatureVariable
method (#298) as a more idiomatic approach to getting values of feature variables.
getFeatureVariable
methods will still be available for use.