Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@fullstory/snippet

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fullstory/snippet - npm Package Compare versions

Comparing version 1.3.1 to 2.0.0-beta.0

5

dist/index.d.ts

@@ -18,4 +18,7 @@ declare global {

declare const initFS: ({ orgId, namespace, debug, host, script }: InitFSArgs) => void;
declare const initFSV1: ({ orgId, namespace, debug, host, script }: InitFSArgs) => void;
declare const SnippetSrc: any;
declare const SnippetSrcV1: any;
declare const generateSnippetText: ({ orgId, namespace, debug, host, script }: InitFSArgs) => string;
export { SnippetSrc, initFS, generateSnippetText };
declare const generateSnippetTextV1: ({ orgId, namespace, debug, host, script }: InitFSArgs) => string;
export { SnippetSrc, SnippetSrcV1, initFS, initFSV1, generateSnippetText, generateSnippetTextV1, };

165

dist/index.esm.js
// @ts-nocheck
var executeSnippetV1 = function executeSnippetV1() {
var SnippetSrcV2 = "!function(m,n,e,t,l,o,g,y){var s,f,a=function(h){\nreturn!(h in m)||(m.console&&m.console.log&&m.console.log('FullStory namespace conflict. Please set window[\"_fs_namespace\"].'),!1)}(e)\n;function j(b){var h,d=[];function k(){h&&(d.forEach((function(b){var d;try{d=b[h[0]]&&b[h[0]](h[1])}catch(h){return void(b[3]&&b[3](h))}\nd&&d.then?d.then(b[2],b[3]):b[2]&&b[2](d)})),d.length=0)}function r(b){return function(d){h||(h=[b,d],k())}}return b(r(0),r(1)),{\nthen:function(b,h){return j((function(r,i){d.push([b,h,r,i]),k()}))}}}a&&(g=m[e]=function(){var b=function(b,d,k){function r(r,i){h(b,d,k,r,i)}\nvar i=/Async$/;return i.test(b)?(b=b.replace(i,\"\"),\"function\"==typeof Promise?new Promise(r):j(r)):h(b,d,k)};function h(h,d,k,r,i){\nreturn b._api?b._api(h,d,k,r,i):(b.q&&b.q.push([h,d,k,r,i]),null)}return b.q=[],b}(),y=function(b){function h(h){\n\"function\"==typeof h[4]&&h[4](new Error(b))}var d=g.q;if(d){for(var k=0;k<d.length;k++)h(d[k]);d.length=0,d.push=h}},function(){\n(o=n.createElement(t)).async=!0,o.crossOrigin=\"anonymous\",o.src=\"https://\"+l,o.onerror=function(){y(\"Error loading \"+l)}\n;var b=n.getElementsByTagName(t)[0];b.parentNode.insertBefore(o,b)}(),function(){function b(){}function h(b,h,d){g(\"setProperties\",{type:b,\nproperties:h},d)}function d(b,d){h(\"user\",b,d)}function k(b,h,k){d({uid:b},k),h&&d(h,k)}g.identify=k,g.setUserVars=d,g.identifyAccount=b,\ng.clearUserCookie=b,g.setVars=h,g.event=function(b,h,d){g(\"trackEvent\",{name:b,properties:h},d)},g.anonymize=function(){k(!1)},\ng.shutdown=function(){g(\"shutdown\")},g.restart=function(){g(\"restart\")},g.log=function(b,h){g(\"log\",{level:b,msg:h})},g.consent=function(b){\ng(\"setIdentity\",{consent:!arguments.length||b})}}(),s=\"fetch\",f=\"XMLHttpRequest\",g._w={},g._w[f]=m[f],g._w[s]=m[s],m[s]&&(m[s]=function(){\nreturn g._w[s].apply(this,arguments)}),g._v=\"2.0.0\")}(window,document,window._fs_namespace,\"script\",window._fs_script);";
var executeSnippet = function executeSnippet() {
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
_ref$wnd = _ref.wnd,
wnd = _ref$wnd === void 0 ? window : _ref$wnd;
!function (m, n, e, t, l, o, g, y) {
var s,
f,
a = function (h) {
return !(h in m) || (m.console && m.console.log && m.console.log('FullStory namespace conflict. Please set window["_fs_namespace"].'), !1);
}(e);
function j(b) {
var h,
d = [];
function k() {
h && (d.forEach(function (b) {
var d;
try {
d = b[h[0]] && b[h[0]](h[1]);
} catch (h) {
return void (b[3] && b[3](h));
}
d && d.then ? d.then(b[2], b[3]) : b[2] && b[2](d);
}), d.length = 0);
}
function r(b) {
return function (d) {
h || (h = [b, d], k());
};
}
return b(r(0), r(1)), {
then: function then(b, h) {
return j(function (r, c) {
d.push([b, h, r, c]), k();
});
}
};
}
a && (g = m[e] = function () {
var b = function b(_b2, d, k) {
function r(r, c) {
h(_b2, d, k, r, c);
}
var c = /Async$/;
return c.test(_b2) ? (_b2 = _b2.replace(c, ""), "function" == typeof Promise ? new Promise(r) : j(r)) : h(_b2, d, k);
};
function h(h, d, k, r, c) {
return b._api ? b._api(h, d, k, r, c) : (b.q && b.q.push([h, d, k, r, c]), null);
}
return b.q = [], b;
}(), y = function y(b) {
function h(h) {
"function" == typeof h[4] && h[4](new Error(b));
}
var d = g.q;
if (d) {
for (var k = 0; k < d.length; k++) {
h(d[k]);
}
d.length = 0, d.push = h;
}
}, function () {
(o = n.createElement(t)).async = !0, o.crossOrigin = "anonymous", o.src = "https://" + l, o.onerror = function () {
y("Error loading " + l);
};
var b = n.getElementsByTagName(t)[0];
b.parentNode.insertBefore(o, b);
}(), function () {
function b() {}
function h(b, h, d) {
g("setProperties", {
type: b,
properties: h
}, d);
}
function d(b, d) {
h("user", b, d);
}
function k(b, h, k) {
d({
uid: b
}, k), h && d(h, k);
}
g.identify = k, g.setUserVars = d, g.identifyAccount = b, g.clearUserCookie = b, g.setVars = h, g.event = function (b, h, d) {
g("trackEvent", {
name: b,
properties: h
}, d);
}, g.anonymize = function () {
k(!1);
}, g.shutdown = function () {
g("shutdown");
}, g.restart = function () {
g("restart");
}, g.log = function (b, h) {
g("log", {
level: b,
msg: h
});
}, g.consent = function (b) {
g("setIdentity", {
consent: !arguments.length || b
});
};
}(), s = "fetch", f = "XMLHttpRequest", g._w = {}, g._w[f] = m[f], g._w[s] = m[s], m[s] && (m[s] = function () {
return g._w[s].apply(this, arguments);
}), g._v = "2.0.0");
}(wnd, wnd.document, wnd._fs_namespace, "script", wnd._fs_script);
};
var executeSnippetV1 = function executeSnippetV1() {
var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
_ref2$wnd = _ref2.wnd,
wnd = _ref2$wnd === void 0 ? window : _ref2$wnd;
(function (m, n, e, t, l, o, g, y) {

@@ -78,9 +187,9 @@ if (e in m) {

var toV1String = function toV1String() {
var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
_ref2$shouldInsertScr = _ref2.shouldInsertScript,
shouldInsertScript = _ref2$shouldInsertScr === void 0 ? true : _ref2$shouldInsertScr,
_ref2$globalVar = _ref2.globalVar,
globalVar = _ref2$globalVar === void 0 ? 'window' : _ref2$globalVar,
_ref2$apiVersion = _ref2.apiVersion,
apiVersion = _ref2$apiVersion === void 0 ? '1.3.0' : _ref2$apiVersion;
var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
_ref3$shouldInsertScr = _ref3.shouldInsertScript,
shouldInsertScript = _ref3$shouldInsertScr === void 0 ? true : _ref3$shouldInsertScr,
_ref3$globalVar = _ref3.globalVar,
globalVar = _ref3$globalVar === void 0 ? 'window' : _ref3$globalVar,
_ref3$apiVersion = _ref3.apiVersion,
apiVersion = _ref3$apiVersion === void 0 ? '1.3.0' : _ref3$apiVersion;
return "(function(m,n,e,t,l,o,g,y){\n if (e in m) {if(m.console && m.console.log) { m.console.log('FullStory namespace conflict. Please set window[\"_fs_namespace\"].');} return;}\n g=m[e]=function(a,b,s){g.q?g.q.push([a,b,s]):g._api(a,b,s);};g.q=[];".concat(shouldInsertScript ? "\n o=n.createElement(t);o.async=1;o.crossOrigin='anonymous';o.src='https://'+_fs_script;\n y=n.getElementsByTagName(t)[0];y.parentNode.insertBefore(o,y);" : '', "\n g.identify=function(i,v,s){g(l,{uid:i},s);if(v)g(l,v,s)};g.setUserVars=function(v,s){g(l,v,s)};g.event=function(i,v,s){g('event',{n:i,p:v},s)};\n g.anonymize=function(){g.identify(!!0)};\n g.shutdown=function(){g(\"rec\",!1)};g.restart=function(){g(\"rec\",!0)};\n g.log = function(a,b){g(\"log\",[a,b])};\n g.consent=function(a){g(\"consent\",!arguments.length||a)};\n g.identifyAccount=function(i,v){o='account';v=v||{};v.acctId=i;g(o,v)};\n g.clearUserCookie=function(){};\n g.setVars=function(n, p){g('setVars',[n,p]);};\n g._w={};y='XMLHttpRequest';g._w[y]=m[y];y='fetch';g._w[y]=m[y];\n if(m[y])m[y]=function(){return g._w[y].apply(this,arguments)};\n g._v=\"").concat(apiVersion, "\";\n})(").concat(globalVar, ",").concat(getDocumentVar(globalVar), ",").concat(globalVar, "['_fs_namespace'],'script','user');");

@@ -106,5 +215,26 @@ };

window['_fs_namespace'] = namespace;
executeSnippet();
};
var initFSV1 = function initFSV1(_a) {
var orgId = _a.orgId,
_b = _a.namespace,
namespace = _b === void 0 ? 'FS' : _b,
_c = _a.debug,
debug = _c === void 0 ? false : _c,
_d = _a.host,
host = _d === void 0 ? 'fullstory.com' : _d,
_e = _a.script,
script = _e === void 0 ? 'edge.fullstory.com/s/fs.js' : _e;
if (!orgId) {
throw new Error('FullStory orgId is a required parameter');
}
window['_fs_debug'] = debug;
window['_fs_host'] = host;
window['_fs_script'] = script;
window['_fs_org'] = orgId;
window['_fs_namespace'] = namespace;
executeSnippetV1();
};
var SnippetSrc = toV1String();
var SnippetSrc = SnippetSrcV2;
var SnippetSrcV1 = toV1String();
var generateSnippetText = function generateSnippetText(_a) {

@@ -125,2 +255,17 @@ var orgId = _a.orgId,

};
export { SnippetSrc, generateSnippetText, initFS };
var generateSnippetTextV1 = function generateSnippetTextV1(_a) {
var orgId = _a.orgId,
_b = _a.namespace,
namespace = _b === void 0 ? 'FS' : _b,
_c = _a.debug,
debug = _c === void 0 ? false : _c,
_d = _a.host,
host = _d === void 0 ? 'fullstory.com' : _d,
_e = _a.script,
script = _e === void 0 ? 'edge.fullstory.com/s/fs.js' : _e;
if (!orgId) {
throw new Error('FullStory orgId is a required parameter');
}
return "window['_fs_debug'] = ".concat(debug, ";\nwindow['_fs_host'] = '").concat(host, "';\nwindow['_fs_script'] = '").concat(script, "';\nwindow['_fs_org'] = '").concat(orgId, "';\nwindow['_fs_namespace'] = '").concat(namespace, "';\n").concat(SnippetSrcV1, "\n");
};
export { SnippetSrc, SnippetSrcV1, generateSnippetText, generateSnippetTextV1, initFS, initFSV1 };

@@ -8,6 +8,115 @@ 'use strict';

// @ts-nocheck
var executeSnippetV1 = function executeSnippetV1() {
var SnippetSrcV2 = "!function(m,n,e,t,l,o,g,y){var s,f,a=function(h){\nreturn!(h in m)||(m.console&&m.console.log&&m.console.log('FullStory namespace conflict. Please set window[\"_fs_namespace\"].'),!1)}(e)\n;function j(b){var h,d=[];function k(){h&&(d.forEach((function(b){var d;try{d=b[h[0]]&&b[h[0]](h[1])}catch(h){return void(b[3]&&b[3](h))}\nd&&d.then?d.then(b[2],b[3]):b[2]&&b[2](d)})),d.length=0)}function r(b){return function(d){h||(h=[b,d],k())}}return b(r(0),r(1)),{\nthen:function(b,h){return j((function(r,i){d.push([b,h,r,i]),k()}))}}}a&&(g=m[e]=function(){var b=function(b,d,k){function r(r,i){h(b,d,k,r,i)}\nvar i=/Async$/;return i.test(b)?(b=b.replace(i,\"\"),\"function\"==typeof Promise?new Promise(r):j(r)):h(b,d,k)};function h(h,d,k,r,i){\nreturn b._api?b._api(h,d,k,r,i):(b.q&&b.q.push([h,d,k,r,i]),null)}return b.q=[],b}(),y=function(b){function h(h){\n\"function\"==typeof h[4]&&h[4](new Error(b))}var d=g.q;if(d){for(var k=0;k<d.length;k++)h(d[k]);d.length=0,d.push=h}},function(){\n(o=n.createElement(t)).async=!0,o.crossOrigin=\"anonymous\",o.src=\"https://\"+l,o.onerror=function(){y(\"Error loading \"+l)}\n;var b=n.getElementsByTagName(t)[0];b.parentNode.insertBefore(o,b)}(),function(){function b(){}function h(b,h,d){g(\"setProperties\",{type:b,\nproperties:h},d)}function d(b,d){h(\"user\",b,d)}function k(b,h,k){d({uid:b},k),h&&d(h,k)}g.identify=k,g.setUserVars=d,g.identifyAccount=b,\ng.clearUserCookie=b,g.setVars=h,g.event=function(b,h,d){g(\"trackEvent\",{name:b,properties:h},d)},g.anonymize=function(){k(!1)},\ng.shutdown=function(){g(\"shutdown\")},g.restart=function(){g(\"restart\")},g.log=function(b,h){g(\"log\",{level:b,msg:h})},g.consent=function(b){\ng(\"setIdentity\",{consent:!arguments.length||b})}}(),s=\"fetch\",f=\"XMLHttpRequest\",g._w={},g._w[f]=m[f],g._w[s]=m[s],m[s]&&(m[s]=function(){\nreturn g._w[s].apply(this,arguments)}),g._v=\"2.0.0\")}(window,document,window._fs_namespace,\"script\",window._fs_script);";
var executeSnippet = function executeSnippet() {
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
_ref$wnd = _ref.wnd,
wnd = _ref$wnd === void 0 ? window : _ref$wnd;
!function (m, n, e, t, l, o, g, y) {
var s,
f,
a = function (h) {
return !(h in m) || (m.console && m.console.log && m.console.log('FullStory namespace conflict. Please set window["_fs_namespace"].'), !1);
}(e);
function j(b) {
var h,
d = [];
function k() {
h && (d.forEach(function (b) {
var d;
try {
d = b[h[0]] && b[h[0]](h[1]);
} catch (h) {
return void (b[3] && b[3](h));
}
d && d.then ? d.then(b[2], b[3]) : b[2] && b[2](d);
}), d.length = 0);
}
function r(b) {
return function (d) {
h || (h = [b, d], k());
};
}
return b(r(0), r(1)), {
then: function then(b, h) {
return j(function (r, c) {
d.push([b, h, r, c]), k();
});
}
};
}
a && (g = m[e] = function () {
var b = function b(_b2, d, k) {
function r(r, c) {
h(_b2, d, k, r, c);
}
var c = /Async$/;
return c.test(_b2) ? (_b2 = _b2.replace(c, ""), "function" == typeof Promise ? new Promise(r) : j(r)) : h(_b2, d, k);
};
function h(h, d, k, r, c) {
return b._api ? b._api(h, d, k, r, c) : (b.q && b.q.push([h, d, k, r, c]), null);
}
return b.q = [], b;
}(), y = function y(b) {
function h(h) {
"function" == typeof h[4] && h[4](new Error(b));
}
var d = g.q;
if (d) {
for (var k = 0; k < d.length; k++) {
h(d[k]);
}
d.length = 0, d.push = h;
}
}, function () {
(o = n.createElement(t)).async = !0, o.crossOrigin = "anonymous", o.src = "https://" + l, o.onerror = function () {
y("Error loading " + l);
};
var b = n.getElementsByTagName(t)[0];
b.parentNode.insertBefore(o, b);
}(), function () {
function b() {}
function h(b, h, d) {
g("setProperties", {
type: b,
properties: h
}, d);
}
function d(b, d) {
h("user", b, d);
}
function k(b, h, k) {
d({
uid: b
}, k), h && d(h, k);
}
g.identify = k, g.setUserVars = d, g.identifyAccount = b, g.clearUserCookie = b, g.setVars = h, g.event = function (b, h, d) {
g("trackEvent", {
name: b,
properties: h
}, d);
}, g.anonymize = function () {
k(!1);
}, g.shutdown = function () {
g("shutdown");
}, g.restart = function () {
g("restart");
}, g.log = function (b, h) {
g("log", {
level: b,
msg: h
});
}, g.consent = function (b) {
g("setIdentity", {
consent: !arguments.length || b
});
};
}(), s = "fetch", f = "XMLHttpRequest", g._w = {}, g._w[f] = m[f], g._w[s] = m[s], m[s] && (m[s] = function () {
return g._w[s].apply(this, arguments);
}), g._v = "2.0.0");
}(wnd, wnd.document, wnd._fs_namespace, "script", wnd._fs_script);
};
var executeSnippetV1 = function executeSnippetV1() {
var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
_ref2$wnd = _ref2.wnd,
wnd = _ref2$wnd === void 0 ? window : _ref2$wnd;
(function (m, n, e, t, l, o, g, y) {

@@ -85,9 +194,9 @@ if (e in m) {

var toV1String = function toV1String() {
var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
_ref2$shouldInsertScr = _ref2.shouldInsertScript,
shouldInsertScript = _ref2$shouldInsertScr === void 0 ? true : _ref2$shouldInsertScr,
_ref2$globalVar = _ref2.globalVar,
globalVar = _ref2$globalVar === void 0 ? 'window' : _ref2$globalVar,
_ref2$apiVersion = _ref2.apiVersion,
apiVersion = _ref2$apiVersion === void 0 ? '1.3.0' : _ref2$apiVersion;
var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
_ref3$shouldInsertScr = _ref3.shouldInsertScript,
shouldInsertScript = _ref3$shouldInsertScr === void 0 ? true : _ref3$shouldInsertScr,
_ref3$globalVar = _ref3.globalVar,
globalVar = _ref3$globalVar === void 0 ? 'window' : _ref3$globalVar,
_ref3$apiVersion = _ref3.apiVersion,
apiVersion = _ref3$apiVersion === void 0 ? '1.3.0' : _ref3$apiVersion;
return "(function(m,n,e,t,l,o,g,y){\n if (e in m) {if(m.console && m.console.log) { m.console.log('FullStory namespace conflict. Please set window[\"_fs_namespace\"].');} return;}\n g=m[e]=function(a,b,s){g.q?g.q.push([a,b,s]):g._api(a,b,s);};g.q=[];".concat(shouldInsertScript ? "\n o=n.createElement(t);o.async=1;o.crossOrigin='anonymous';o.src='https://'+_fs_script;\n y=n.getElementsByTagName(t)[0];y.parentNode.insertBefore(o,y);" : '', "\n g.identify=function(i,v,s){g(l,{uid:i},s);if(v)g(l,v,s)};g.setUserVars=function(v,s){g(l,v,s)};g.event=function(i,v,s){g('event',{n:i,p:v},s)};\n g.anonymize=function(){g.identify(!!0)};\n g.shutdown=function(){g(\"rec\",!1)};g.restart=function(){g(\"rec\",!0)};\n g.log = function(a,b){g(\"log\",[a,b])};\n g.consent=function(a){g(\"consent\",!arguments.length||a)};\n g.identifyAccount=function(i,v){o='account';v=v||{};v.acctId=i;g(o,v)};\n g.clearUserCookie=function(){};\n g.setVars=function(n, p){g('setVars',[n,p]);};\n g._w={};y='XMLHttpRequest';g._w[y]=m[y];y='fetch';g._w[y]=m[y];\n if(m[y])m[y]=function(){return g._w[y].apply(this,arguments)};\n g._v=\"").concat(apiVersion, "\";\n})(").concat(globalVar, ",").concat(getDocumentVar(globalVar), ",").concat(globalVar, "['_fs_namespace'],'script','user');");

@@ -113,5 +222,26 @@ };

window['_fs_namespace'] = namespace;
executeSnippet();
};
var initFSV1 = function initFSV1(_a) {
var orgId = _a.orgId,
_b = _a.namespace,
namespace = _b === void 0 ? 'FS' : _b,
_c = _a.debug,
debug = _c === void 0 ? false : _c,
_d = _a.host,
host = _d === void 0 ? 'fullstory.com' : _d,
_e = _a.script,
script = _e === void 0 ? 'edge.fullstory.com/s/fs.js' : _e;
if (!orgId) {
throw new Error('FullStory orgId is a required parameter');
}
window['_fs_debug'] = debug;
window['_fs_host'] = host;
window['_fs_script'] = script;
window['_fs_org'] = orgId;
window['_fs_namespace'] = namespace;
executeSnippetV1();
};
var SnippetSrc = toV1String();
var SnippetSrc = SnippetSrcV2;
var SnippetSrcV1 = toV1String();
var generateSnippetText = function generateSnippetText(_a) {

@@ -132,4 +262,22 @@ var orgId = _a.orgId,

};
var generateSnippetTextV1 = function generateSnippetTextV1(_a) {
var orgId = _a.orgId,
_b = _a.namespace,
namespace = _b === void 0 ? 'FS' : _b,
_c = _a.debug,
debug = _c === void 0 ? false : _c,
_d = _a.host,
host = _d === void 0 ? 'fullstory.com' : _d,
_e = _a.script,
script = _e === void 0 ? 'edge.fullstory.com/s/fs.js' : _e;
if (!orgId) {
throw new Error('FullStory orgId is a required parameter');
}
return "window['_fs_debug'] = ".concat(debug, ";\nwindow['_fs_host'] = '").concat(host, "';\nwindow['_fs_script'] = '").concat(script, "';\nwindow['_fs_org'] = '").concat(orgId, "';\nwindow['_fs_namespace'] = '").concat(namespace, "';\n").concat(SnippetSrcV1, "\n");
};
exports.SnippetSrc = SnippetSrc;
exports.SnippetSrcV1 = SnippetSrcV1;
exports.generateSnippetText = generateSnippetText;
exports.initFS = initFS;
exports.generateSnippetTextV1 = generateSnippetTextV1;
exports.initFS = initFS;
exports.initFSV1 = initFSV1;
{
"name": "@fullstory/snippet",
"version": "1.3.1",
"version": "2.0.0-beta.0",
"description": "FullStory snippet source",

@@ -5,0 +5,0 @@ "main": "./dist/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc