@arc-publishing/sdk-identity
Version:
JS Identity SDK for working with Identity API
31 lines • 1.64 kB
JavaScript
import { __assign } from "tslib";
import Identity from './identity';
import { logPrefix } from './constants';
import { isLegacyGoogleSetting } from './socialSignOnTypes';
export default function options(options) {
var _a, _b, _c, _d, _e, _f;
if (options) {
Identity.apiOrigin =
(options.apiOrigin && options.apiOrigin.replace(/\/$/, '')) || Identity.apiOrigin;
Identity.baseDomain = options.baseDomain || Identity._baseDomain;
if (options.google) {
if (isLegacyGoogleSetting(options.google)) {
Identity._google = __assign(__assign({}, Identity._google), options.google);
}
else {
Identity._google = (_a = options.google) !== null && _a !== void 0 ? _a : Identity._google;
}
}
Identity.profileStorageOpt = {
storageExp: ((_b = options.profileStorageOpt) === null || _b === void 0 ? void 0 : _b.storageExp) || ((_c = Identity._profileStorageOpt) === null || _c === void 0 ? void 0 : _c.storageExp),
ignoreProfile: ((_d = options.profileStorageOpt) === null || _d === void 0 ? void 0 : _d.ignoreProfile) !== undefined
? (_e = options.profileStorageOpt) === null || _e === void 0 ? void 0 : _e.ignoreProfile
: (_f = Identity._profileStorageOpt) === null || _f === void 0 ? void 0 : _f.ignoreProfile
};
Identity.ampReaderId = options.ampReaderId || Identity.ampReaderId;
}
else {
console.warn("".concat(logPrefix, " No options specified when calling Identity.options"));
}
}
//# sourceMappingURL=options.js.map