var token = <TOKEN>;
var clientId = '1';
var start = new Promise(
function (resolve, reject) {
if (window.Sigma) {
var sigma = new Sigma();
var userData = {
userId: clientId
};
sigma.init({ token: token, userData: userData });
var exp = sigma.getExperiment('exp');
resolve(exp);
}else {
var reason = new Error("s haven't initialized");
reject(reason);
}
}
);
var abStart = function () {
start
.then(function (res) {
var resultExp = res.getFeatureValue('test');
console.log(resultExp);
})
.catch(function (error) {
console.log(error.message);
});
};
abStart();