@fullstory/browser 1.7.0 → 1.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/dist/index.esm.js +3 -104
- package/dist/index.js +3 -104
- package/package.json +6 -3
- package/src/index.js +2 -2
- package/src/snippet.js +0 -40
package/CHANGELOG.md
CHANGED
package/dist/index.esm.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { initFS } from '@fullstory/snippet';
|
|
2
|
+
|
|
1
3
|
function ownKeys(object, enumerableOnly) {
|
|
2
4
|
var keys = Object.keys(object);
|
|
3
5
|
|
|
@@ -39,109 +41,6 @@ function _defineProperty(obj, key, value) {
|
|
|
39
41
|
return obj;
|
|
40
42
|
}
|
|
41
43
|
|
|
42
|
-
var snippet = function snippet(_ref) {
|
|
43
|
-
var orgId = _ref.orgId,
|
|
44
|
-
_ref$namespace = _ref.namespace,
|
|
45
|
-
namespace = _ref$namespace === void 0 ? 'FS' : _ref$namespace,
|
|
46
|
-
_ref$debug = _ref.debug,
|
|
47
|
-
_ref$host = _ref.host,
|
|
48
|
-
host = _ref$host === void 0 ? 'fullstory.com' : _ref$host,
|
|
49
|
-
_ref$script = _ref.script,
|
|
50
|
-
script = _ref$script === void 0 ? 'edge.fullstory.com/s/fs.js' : _ref$script;
|
|
51
|
-
|
|
52
|
-
if (!orgId) {
|
|
53
|
-
throw new Error('FullStory orgId is a required parameter');
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
window['_fs_host'] = host;
|
|
57
|
-
window['_fs_script'] = script;
|
|
58
|
-
window['_fs_org'] = orgId;
|
|
59
|
-
window['_fs_namespace'] = namespace;
|
|
60
|
-
|
|
61
|
-
(function (m, n, e, t, l, o, g, y) {
|
|
62
|
-
if (e in m) {
|
|
63
|
-
if (m.console && m.console.log) {
|
|
64
|
-
m.console.log('FullStory namespace conflict. Please set window["_fs_namespace"].');
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
g = m[e] = function (a, b, s) {
|
|
71
|
-
g.q ? g.q.push([a, b, s]) : g._api(a, b, s);
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
g.q = [];
|
|
75
|
-
o = n.createElement(t);
|
|
76
|
-
o.async = 1;
|
|
77
|
-
o.crossOrigin = 'anonymous';
|
|
78
|
-
o.src = 'https://' + _fs_script;
|
|
79
|
-
y = n.getElementsByTagName(t)[0];
|
|
80
|
-
y.parentNode.insertBefore(o, y);
|
|
81
|
-
|
|
82
|
-
g.identify = function (i, v, s) {
|
|
83
|
-
g(l, {
|
|
84
|
-
uid: i
|
|
85
|
-
}, s);
|
|
86
|
-
if (v) g(l, v, s);
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
g.setUserVars = function (v, s) {
|
|
90
|
-
g(l, v, s);
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
g.event = function (i, v, s) {
|
|
94
|
-
g('event', {
|
|
95
|
-
n: i,
|
|
96
|
-
p: v
|
|
97
|
-
}, s);
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
g.anonymize = function () {
|
|
101
|
-
g.identify(!!0);
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
g.shutdown = function () {
|
|
105
|
-
g("rec", !1);
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
g.restart = function () {
|
|
109
|
-
g("rec", !0);
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
g.log = function (a, b) {
|
|
113
|
-
g("log", [a, b]);
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
g.consent = function (a) {
|
|
117
|
-
g("consent", !arguments.length || a);
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
g.identifyAccount = function (i, v) {
|
|
121
|
-
o = 'account';
|
|
122
|
-
v = v || {};
|
|
123
|
-
v.acctId = i;
|
|
124
|
-
g(o, v);
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
g.clearUserCookie = function () {};
|
|
128
|
-
|
|
129
|
-
g.setVars = function (n, p) {
|
|
130
|
-
g('setVars', [n, p]);
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
g._w = {};
|
|
134
|
-
y = 'XMLHttpRequest';
|
|
135
|
-
g._w[y] = m[y];
|
|
136
|
-
y = 'fetch';
|
|
137
|
-
g._w[y] = m[y];
|
|
138
|
-
if (m[y]) m[y] = function () {
|
|
139
|
-
return g._w[y].apply(this, arguments);
|
|
140
|
-
};
|
|
141
|
-
g._v = "1.3.0";
|
|
142
|
-
})(window, document, window['_fs_namespace'], 'script', 'user');
|
|
143
|
-
};
|
|
144
|
-
|
|
145
44
|
var fs = function fs() {
|
|
146
45
|
return window[window._fs_namespace];
|
|
147
46
|
};
|
|
@@ -224,7 +123,7 @@ var _init = function _init(inputOptions, readyCallback) {
|
|
|
224
123
|
}
|
|
225
124
|
}
|
|
226
125
|
|
|
227
|
-
|
|
126
|
+
initFS(options);
|
|
228
127
|
|
|
229
128
|
if (readyCallback) {
|
|
230
129
|
fs()('observe', {
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var snippet = require('@fullstory/snippet');
|
|
6
|
+
|
|
5
7
|
function ownKeys(object, enumerableOnly) {
|
|
6
8
|
var keys = Object.keys(object);
|
|
7
9
|
|
|
@@ -43,109 +45,6 @@ function _defineProperty(obj, key, value) {
|
|
|
43
45
|
return obj;
|
|
44
46
|
}
|
|
45
47
|
|
|
46
|
-
var snippet = function snippet(_ref) {
|
|
47
|
-
var orgId = _ref.orgId,
|
|
48
|
-
_ref$namespace = _ref.namespace,
|
|
49
|
-
namespace = _ref$namespace === void 0 ? 'FS' : _ref$namespace,
|
|
50
|
-
_ref$debug = _ref.debug,
|
|
51
|
-
_ref$host = _ref.host,
|
|
52
|
-
host = _ref$host === void 0 ? 'fullstory.com' : _ref$host,
|
|
53
|
-
_ref$script = _ref.script,
|
|
54
|
-
script = _ref$script === void 0 ? 'edge.fullstory.com/s/fs.js' : _ref$script;
|
|
55
|
-
|
|
56
|
-
if (!orgId) {
|
|
57
|
-
throw new Error('FullStory orgId is a required parameter');
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
window['_fs_host'] = host;
|
|
61
|
-
window['_fs_script'] = script;
|
|
62
|
-
window['_fs_org'] = orgId;
|
|
63
|
-
window['_fs_namespace'] = namespace;
|
|
64
|
-
|
|
65
|
-
(function (m, n, e, t, l, o, g, y) {
|
|
66
|
-
if (e in m) {
|
|
67
|
-
if (m.console && m.console.log) {
|
|
68
|
-
m.console.log('FullStory namespace conflict. Please set window["_fs_namespace"].');
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
g = m[e] = function (a, b, s) {
|
|
75
|
-
g.q ? g.q.push([a, b, s]) : g._api(a, b, s);
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
g.q = [];
|
|
79
|
-
o = n.createElement(t);
|
|
80
|
-
o.async = 1;
|
|
81
|
-
o.crossOrigin = 'anonymous';
|
|
82
|
-
o.src = 'https://' + _fs_script;
|
|
83
|
-
y = n.getElementsByTagName(t)[0];
|
|
84
|
-
y.parentNode.insertBefore(o, y);
|
|
85
|
-
|
|
86
|
-
g.identify = function (i, v, s) {
|
|
87
|
-
g(l, {
|
|
88
|
-
uid: i
|
|
89
|
-
}, s);
|
|
90
|
-
if (v) g(l, v, s);
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
g.setUserVars = function (v, s) {
|
|
94
|
-
g(l, v, s);
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
g.event = function (i, v, s) {
|
|
98
|
-
g('event', {
|
|
99
|
-
n: i,
|
|
100
|
-
p: v
|
|
101
|
-
}, s);
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
g.anonymize = function () {
|
|
105
|
-
g.identify(!!0);
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
g.shutdown = function () {
|
|
109
|
-
g("rec", !1);
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
g.restart = function () {
|
|
113
|
-
g("rec", !0);
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
g.log = function (a, b) {
|
|
117
|
-
g("log", [a, b]);
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
g.consent = function (a) {
|
|
121
|
-
g("consent", !arguments.length || a);
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
g.identifyAccount = function (i, v) {
|
|
125
|
-
o = 'account';
|
|
126
|
-
v = v || {};
|
|
127
|
-
v.acctId = i;
|
|
128
|
-
g(o, v);
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
g.clearUserCookie = function () {};
|
|
132
|
-
|
|
133
|
-
g.setVars = function (n, p) {
|
|
134
|
-
g('setVars', [n, p]);
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
g._w = {};
|
|
138
|
-
y = 'XMLHttpRequest';
|
|
139
|
-
g._w[y] = m[y];
|
|
140
|
-
y = 'fetch';
|
|
141
|
-
g._w[y] = m[y];
|
|
142
|
-
if (m[y]) m[y] = function () {
|
|
143
|
-
return g._w[y].apply(this, arguments);
|
|
144
|
-
};
|
|
145
|
-
g._v = "1.3.0";
|
|
146
|
-
})(window, document, window['_fs_namespace'], 'script', 'user');
|
|
147
|
-
};
|
|
148
|
-
|
|
149
48
|
var fs = function fs() {
|
|
150
49
|
return window[window._fs_namespace];
|
|
151
50
|
};
|
|
@@ -228,7 +127,7 @@ var _init = function _init(inputOptions, readyCallback) {
|
|
|
228
127
|
}
|
|
229
128
|
}
|
|
230
129
|
|
|
231
|
-
snippet(options);
|
|
130
|
+
snippet.initFS(options);
|
|
232
131
|
|
|
233
132
|
if (readyCallback) {
|
|
234
133
|
fs()('observe', {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fullstory/browser",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.1",
|
|
4
4
|
"description": "The official FullStory browser SDK",
|
|
5
5
|
"repository": "git://github.com/fullstorydev/fullstory-browser-sdk.git",
|
|
6
6
|
"homepage": "https://github.com/fullstorydev/fullstory-browser-sdk",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"clean": "rimraf dist",
|
|
14
14
|
"test": "npm run lint && npm run test:karma",
|
|
15
15
|
"test:karma": "karma start --single-run --browsers ChromeHeadless karma.conf.js",
|
|
16
|
-
"lint": "eslint src test
|
|
16
|
+
"lint": "eslint src test",
|
|
17
17
|
"build": "tsc src/index.d.ts && rollup -c"
|
|
18
18
|
},
|
|
19
19
|
"files": [
|
|
@@ -25,6 +25,9 @@
|
|
|
25
25
|
"browser",
|
|
26
26
|
"sdk"
|
|
27
27
|
],
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@fullstory/snippet": "1.3.1"
|
|
30
|
+
},
|
|
28
31
|
"devDependencies": {
|
|
29
32
|
"@babel/core": "^7.8.7",
|
|
30
33
|
"@babel/eslint-parser": "^7.16.5",
|
|
@@ -48,6 +51,6 @@
|
|
|
48
51
|
"rollup": "^1.32.1",
|
|
49
52
|
"rollup-plugin-copy": "^3.3.0",
|
|
50
53
|
"typescript": "^3.8.3",
|
|
51
|
-
"webpack": "^5.
|
|
54
|
+
"webpack": "^5.76.1"
|
|
52
55
|
}
|
|
53
56
|
}
|
package/src/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { initFS } from '@fullstory/snippet';
|
|
2
2
|
|
|
3
3
|
const fs = () => window[window._fs_namespace];
|
|
4
4
|
|
|
@@ -70,7 +70,7 @@ const _init = (inputOptions, readyCallback) => {
|
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
initFS(options);
|
|
74
74
|
|
|
75
75
|
if (readyCallback) {
|
|
76
76
|
fs()('observe', { type: 'start', callback: readyCallback });
|
package/src/snippet.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
// this code is auto-generated. DO NOT EDIT.
|
|
2
|
-
/* eslint-disable */
|
|
3
|
-
const snippet = (
|
|
4
|
-
{
|
|
5
|
-
orgId,
|
|
6
|
-
namespace = 'FS',
|
|
7
|
-
debug = false,
|
|
8
|
-
host = 'fullstory.com',
|
|
9
|
-
script = 'edge.fullstory.com/s/fs.js'
|
|
10
|
-
}
|
|
11
|
-
) => {
|
|
12
|
-
if (!orgId) {
|
|
13
|
-
throw new Error('FullStory orgId is a required parameter');
|
|
14
|
-
}
|
|
15
|
-
/* begin FullStory snippet */
|
|
16
|
-
window['_fs_host'] = host;
|
|
17
|
-
window['_fs_script'] = script;
|
|
18
|
-
window['_fs_org'] = orgId;
|
|
19
|
-
window['_fs_namespace'] = namespace;
|
|
20
|
-
(function(m,n,e,t,l,o,g,y){
|
|
21
|
-
if (e in m) {if(m.console && m.console.log) { m.console.log('FullStory namespace conflict. Please set window["_fs_namespace"].');} return;}
|
|
22
|
-
g=m[e]=function(a,b,s){g.q?g.q.push([a,b,s]):g._api(a,b,s);};g.q=[];
|
|
23
|
-
o=n.createElement(t);o.async=1;o.crossOrigin='anonymous';o.src='https://'+_fs_script;
|
|
24
|
-
y=n.getElementsByTagName(t)[0];y.parentNode.insertBefore(o,y);
|
|
25
|
-
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)};
|
|
26
|
-
g.anonymize=function(){g.identify(!!0)};
|
|
27
|
-
g.shutdown=function(){g("rec",!1)};g.restart=function(){g("rec",!0)};
|
|
28
|
-
g.log = function(a,b){g("log",[a,b])};
|
|
29
|
-
g.consent=function(a){g("consent",!arguments.length||a)};
|
|
30
|
-
g.identifyAccount=function(i,v){o='account';v=v||{};v.acctId=i;g(o,v)};
|
|
31
|
-
g.clearUserCookie=function(){};
|
|
32
|
-
g.setVars=function(n, p){g('setVars',[n,p]);};
|
|
33
|
-
g._w={};y='XMLHttpRequest';g._w[y]=m[y];y='fetch';g._w[y]=m[y];
|
|
34
|
-
if(m[y])m[y]=function(){return g._w[y].apply(this,arguments)};
|
|
35
|
-
g._v="1.3.0";
|
|
36
|
-
})(window,document,window['_fs_namespace'],'script','user');
|
|
37
|
-
/* end FullStory snippet */
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export default snippet;
|