Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
identify(options = {}) {
const compactedOptions = compact(options);
const { distinctId } = compactedOptions;
const props = without(compactedOptions, ['distinctId', 'alias']);
if (canUseDOM && distinctId) {
window.heap.identify(distinctId);
window.heap.addUserProperties(props);
}
},
trackEvent(options = {}) {
const compactedOptions = compact(options);
const { eventName } = compactedOptions;
if (!eventName) { return; }
if (window._gs) {
window._gs('event', eventName, without(compactedOptions, 'eventName') || {});
}
},
identify(options = {}) {
const { appId } = get(this, 'config');
const compactedOptions = compact(options);
const { distinctId } = compactedOptions;
const props = without(compactedOptions, 'distinctId');
props.app_id = appId;
if (distinctId) {
props.user_id = distinctId;
}
const method = this.booted ? 'update' : 'boot';
if (canUseDOM) {
window.Intercom(method, props);
this.booted = true;
}
},