@fullstory/browser 1.6.2 → 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 +10 -1
- package/README.md +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.esm.js +7 -104
- package/dist/index.js +7 -104
- package/package.json +6 -3
- package/src/index.d.ts +2 -0
- package/src/index.js +7 -2
- package/src/snippet.js +0 -40
package/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.7.1
|
|
4
|
+
|
|
5
|
+
- Changed FullStory Snippet to import from @fullstory/snippet
|
|
6
|
+
- Npm audit updates
|
|
7
|
+
|
|
8
|
+
## 1.7.0
|
|
9
|
+
|
|
10
|
+
- Add a `cookieDomain` option to the `init` function to support setting `_fs_cookie_domain`.
|
|
11
|
+
|
|
3
12
|
## 1.6.2
|
|
4
13
|
|
|
5
|
-
- Load `fs-debug.js` capture script when `debug = true` option is used to match updated debug logging practices.
|
|
14
|
+
- Load `fs-debug.js` capture script when `debug = true` option is used to match [updated debug logging practices](https://help.fullstory.com/hc/en-us/articles/360020829233-What-is-fs-debug-).
|
|
6
15
|
|
|
7
16
|
## 1.6.1
|
|
8
17
|
|
package/README.md
CHANGED
|
@@ -31,6 +31,7 @@ The only required option is `orgId`, all others are optional.
|
|
|
31
31
|
* `host` - The recording server host domain. Can be set to direct recorded events to a proxy that you host. Defaults to `fullstory.com`.
|
|
32
32
|
* `script` - FullStory script host domain. FullStory hosts the `fs.js` recording script on a CDN, but you can choose to host a copy yourself. Defaults to `edge.fullstory.com`.
|
|
33
33
|
* `namespace` - Sets the global identifier for FullStory when conflicts with `FS` arise; see [help](https://help.fullstory.com/hc/en-us/articles/360020624694-What-if-the-identifier-FS-is-used-by-another-script-on-my-site-).
|
|
34
|
+
* `cookieDomain` - Overrides the cookie domain. By default, cookies will be valid for all subdomains of your site; if you want to limit the cookies to a specific subdomain, you can set the domain value explicitly. More information can be found [here](https://help.fullstory.com/hc/en-us/articles/360020622874-Can-the-FullStory-cookie-be-associated-with-a-specific-subdomain-).
|
|
34
35
|
* `recordCrossDomainIFrames` - Defaults to `false`. FullStory can record cross-domain iFrames if: 1. The FullStory Browser SDK is running in the cross-domain iFrame and 2. `recordCrossDomainIFrames` is set to `true` in the cross-domain iFrame and 3. The FullStory Browser SDK is running in the parent page of the cross-domain iFrame. Click [here](https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy) for a detailed explanation of what "cross-domain" means. Before using, you should understand the security implications, and configure your [Content Security Policy](https://www.html5rocks.com/en/tutorials/security/content-security-policy/) (CSP) HTTP headers accordingly - specifically the frame-ancestors directive. Failure to configure your CSP headers while using this setting can bypass IFrames security protections that are included in modern browsers. More information about cross-domain iFrame recording can be found on our [Knowledge Base](https://help.fullstory.com/hc/en-us/articles/360020622514-Can-FullStory-capture-content-that-is-presented-in-iframes-#2-the-outer-page-is-running-fullstory-and-you-have-iframes-runni). Note: the `recordCrossDomainIFrames` parameter is the same as the `window['_fs_run_in_iframe']` referenced in the KB article.
|
|
35
36
|
* `recordOnlyThisIFrame` - When set to `true`, this tells FullStory that the IFrame is the "root" of the recording and should be its own session; defaults to `false`. Use this when your app is embedded in an IFrame on a site not running FullStory or when the site *is* running FullStory, but you want your content sent to a different FullStory org.
|
|
36
37
|
* `devMode` - Set to `true` if you want to deactivate FullStory in your development environment. When set to `true`, FullStory will shutdown recording and all subsequent SDK method calls will be no-ops. At the time `init` is called with `devMode: true`, a single `event` call will be sent to FullStory to indicate that the SDK is in `devMode`; this is to help trouble-shoot the case that the SDK was accidentally set to `devMode: true` in a production environment. Additionally, any calls to SDK methods will `console.warn` that FullStory is in `devMode`. Defaults to `false`.
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* - debug: Debug mode with extra browser console logging.
|
|
7
7
|
* - host: The recording server host domain. Can be set to direct recorded events to a proxy that you host. Defaults to `fullstory.com`.
|
|
8
8
|
* - script: FullStory script host domain. FullStory hosts the `fs.js` recording script on a CDN, but you can choose to host a copy yourself. Defaults to `edge.fullstory.com`.
|
|
9
|
+
* - cookieDomain: Overrides the cookie domain. By default, cookies will be valid for all subdomains of your site; if you want to limit the cookies to a specific subdomain, you can set the domain value explicitly. More information can be found [here](https://help.fullstory.com/hc/en-us/articles/360020622874-Can-the-FullStory-cookie-be-associated-with-a-specific-subdomain-).
|
|
9
10
|
* - recordCrossDomainIFrames: FullStory can record cross-domain iFrames. Defaults to `false`. Certain limitations apply and can be found [here](https://help.fullstory.com/hc/en-us/articles/360020622514-Can-FullStory-capture-content-that-is-presented-in-iframes-#h_01F1G333PYKPGZ4B42WDBV3YKV).
|
|
10
11
|
* - recordOnlyThisIFrame: FullStory can record the iFrame as its own unique session. Defaults to `false`. Additional conditions apply and can be found [here](https://help.fullstory.com/hc/en-us/articles/360020622514-Can-FullStory-capture-content-that-is-presented-in-iframes-#h_01F1G33B40Q2TPQA8MA7SF8Y5P).
|
|
11
12
|
* - devMode: In dev mode FullStory won't record sessions. Any calls to SDK methods will `console.warn` that FullStory is in `devMode`. Defaults to `false`.
|
|
@@ -16,6 +17,7 @@ interface SnippetOptions {
|
|
|
16
17
|
debug?: boolean;
|
|
17
18
|
host?: string;
|
|
18
19
|
script?: string;
|
|
20
|
+
cookieDomain?: string;
|
|
19
21
|
recordCrossDomainIFrames?: boolean;
|
|
20
22
|
recordOnlyThisIFrame?: boolean;
|
|
21
23
|
devMode?: boolean;
|
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
|
};
|
|
@@ -212,6 +111,10 @@ var _init = function _init(inputOptions, readyCallback) {
|
|
|
212
111
|
window._fs_is_outer_script = true;
|
|
213
112
|
}
|
|
214
113
|
|
|
114
|
+
if (options.cookieDomain) {
|
|
115
|
+
window._fs_cookie_domain = options.cookieDomain;
|
|
116
|
+
}
|
|
117
|
+
|
|
215
118
|
if (options.debug === true) {
|
|
216
119
|
if (!options.script) {
|
|
217
120
|
options.script = 'edge.fullstory.com/s/fs-debug.js';
|
|
@@ -220,7 +123,7 @@ var _init = function _init(inputOptions, readyCallback) {
|
|
|
220
123
|
}
|
|
221
124
|
}
|
|
222
125
|
|
|
223
|
-
|
|
126
|
+
initFS(options);
|
|
224
127
|
|
|
225
128
|
if (readyCallback) {
|
|
226
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
|
};
|
|
@@ -216,6 +115,10 @@ var _init = function _init(inputOptions, readyCallback) {
|
|
|
216
115
|
window._fs_is_outer_script = true;
|
|
217
116
|
}
|
|
218
117
|
|
|
118
|
+
if (options.cookieDomain) {
|
|
119
|
+
window._fs_cookie_domain = options.cookieDomain;
|
|
120
|
+
}
|
|
121
|
+
|
|
219
122
|
if (options.debug === true) {
|
|
220
123
|
if (!options.script) {
|
|
221
124
|
options.script = 'edge.fullstory.com/s/fs-debug.js';
|
|
@@ -224,7 +127,7 @@ var _init = function _init(inputOptions, readyCallback) {
|
|
|
224
127
|
}
|
|
225
128
|
}
|
|
226
129
|
|
|
227
|
-
snippet(options);
|
|
130
|
+
snippet.initFS(options);
|
|
228
131
|
|
|
229
132
|
if (readyCallback) {
|
|
230
133
|
fs()('observe', {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fullstory/browser",
|
|
3
|
-
"version": "1.
|
|
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.d.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* - debug: Debug mode with extra browser console logging.
|
|
7
7
|
* - host: The recording server host domain. Can be set to direct recorded events to a proxy that you host. Defaults to `fullstory.com`.
|
|
8
8
|
* - script: FullStory script host domain. FullStory hosts the `fs.js` recording script on a CDN, but you can choose to host a copy yourself. Defaults to `edge.fullstory.com`.
|
|
9
|
+
* - cookieDomain: Overrides the cookie domain. By default, cookies will be valid for all subdomains of your site; if you want to limit the cookies to a specific subdomain, you can set the domain value explicitly. More information can be found [here](https://help.fullstory.com/hc/en-us/articles/360020622874-Can-the-FullStory-cookie-be-associated-with-a-specific-subdomain-).
|
|
9
10
|
* - recordCrossDomainIFrames: FullStory can record cross-domain iFrames. Defaults to `false`. Certain limitations apply and can be found [here](https://help.fullstory.com/hc/en-us/articles/360020622514-Can-FullStory-capture-content-that-is-presented-in-iframes-#h_01F1G333PYKPGZ4B42WDBV3YKV).
|
|
10
11
|
* - recordOnlyThisIFrame: FullStory can record the iFrame as its own unique session. Defaults to `false`. Additional conditions apply and can be found [here](https://help.fullstory.com/hc/en-us/articles/360020622514-Can-FullStory-capture-content-that-is-presented-in-iframes-#h_01F1G33B40Q2TPQA8MA7SF8Y5P).
|
|
11
12
|
* - devMode: In dev mode FullStory won't record sessions. Any calls to SDK methods will `console.warn` that FullStory is in `devMode`. Defaults to `false`.
|
|
@@ -16,6 +17,7 @@ interface SnippetOptions {
|
|
|
16
17
|
debug?: boolean;
|
|
17
18
|
host?: string;
|
|
18
19
|
script?: string;
|
|
20
|
+
cookieDomain?: string;
|
|
19
21
|
recordCrossDomainIFrames?: boolean;
|
|
20
22
|
recordOnlyThisIFrame?: boolean;
|
|
21
23
|
devMode?: boolean;
|
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
|
|
|
@@ -57,6 +57,11 @@ const _init = (inputOptions, readyCallback) => {
|
|
|
57
57
|
window._fs_is_outer_script = true;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
// Set cookie domain if it was specified.
|
|
61
|
+
if (options.cookieDomain) {
|
|
62
|
+
window._fs_cookie_domain = options.cookieDomain;
|
|
63
|
+
}
|
|
64
|
+
|
|
60
65
|
if (options.debug === true) {
|
|
61
66
|
if (!options.script) {
|
|
62
67
|
options.script = 'edge.fullstory.com/s/fs-debug.js';
|
|
@@ -65,7 +70,7 @@ const _init = (inputOptions, readyCallback) => {
|
|
|
65
70
|
}
|
|
66
71
|
}
|
|
67
72
|
|
|
68
|
-
|
|
73
|
+
initFS(options);
|
|
69
74
|
|
|
70
75
|
if (readyCallback) {
|
|
71
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;
|