@fullstory/browser 2.0.0-beta.4 → 2.0.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/README.md +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.esm.js +4 -1
- package/dist/index.js +4 -1
- package/package.json +2 -2
- package/src/index.test.ts +23 -0
- package/src/index.ts +7 -1
package/README.md
CHANGED
|
@@ -80,6 +80,7 @@ The only required option is `orgId`, all others are optional.
|
|
|
80
80
|
* `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`.
|
|
81
81
|
* `startCaptureManually` - Set to `true` if you want to start capture manually using `FS('start')`. FullStory will load but wait for a call to `FS('start')` to begin capturing. See [Manually Delay Data Capture](https://developer.fullstory.com/browser/v2/auto-capture/capture-data/#manually-delay-data-capture) for more information. Defaults to `false`.
|
|
82
82
|
* `assetMapId` - Use this to set the current asset map id. See [Asset Uploading for Web](https://help.fullstory.com/hc/en-us/articles/4404129191575-Asset-Uploading-for-Web) for more information.
|
|
83
|
+
* `appHost` - Use this to set the app host for displaying session urls. If using a version of [FullStory Relay](https://help.fullstory.com/hc/en-us/articles/360046112593-How-to-send-captured-traffic-to-your-First-Party-Domain-using-FullStory-Relay), you may need to set `appHost` "app.fullstory.com" or "app.eu1.fullstory.com" depending on your region.
|
|
83
84
|
|
|
84
85
|
### Ready Callback
|
|
85
86
|
|
package/dist/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ import { FSApi } from '@fullstory/snippet';
|
|
|
14
14
|
*/
|
|
15
15
|
export interface SnippetOptions {
|
|
16
16
|
orgId: string;
|
|
17
|
+
appHost?: string;
|
|
17
18
|
assetMapId?: string;
|
|
18
19
|
cookieDomain?: string;
|
|
19
20
|
debug?: boolean;
|
|
@@ -37,6 +38,7 @@ type ReadyCallback = (data: {
|
|
|
37
38
|
}) => void;
|
|
38
39
|
declare global {
|
|
39
40
|
interface Window {
|
|
41
|
+
_fs_app_host?: string;
|
|
40
42
|
_fs_asset_map_id?: string;
|
|
41
43
|
_fs_capture_on_startup?: boolean;
|
|
42
44
|
_fs_cookie_domain?: string;
|
package/dist/index.esm.js
CHANGED
|
@@ -50,6 +50,9 @@ var _init = function (inputOptions, readyCallback) {
|
|
|
50
50
|
if (options.recordCrossDomainIFrames) {
|
|
51
51
|
window._fs_run_in_iframe = true;
|
|
52
52
|
}
|
|
53
|
+
if (options.appHost) {
|
|
54
|
+
window._fs_app_host = options.appHost;
|
|
55
|
+
}
|
|
53
56
|
if (options.assetMapId) {
|
|
54
57
|
window._fs_asset_map_id = options.assetMapId;
|
|
55
58
|
}
|
|
@@ -86,7 +89,7 @@ var _init = function (inputOptions, readyCallback) {
|
|
|
86
89
|
fs('trackEvent', {
|
|
87
90
|
name: 'FullStory Dev Mode',
|
|
88
91
|
properties: {
|
|
89
|
-
|
|
92
|
+
message: message,
|
|
90
93
|
}
|
|
91
94
|
});
|
|
92
95
|
fs('shutdown');
|
package/dist/index.js
CHANGED
|
@@ -52,6 +52,9 @@ var _init = function (inputOptions, readyCallback) {
|
|
|
52
52
|
if (options.recordCrossDomainIFrames) {
|
|
53
53
|
window._fs_run_in_iframe = true;
|
|
54
54
|
}
|
|
55
|
+
if (options.appHost) {
|
|
56
|
+
window._fs_app_host = options.appHost;
|
|
57
|
+
}
|
|
55
58
|
if (options.assetMapId) {
|
|
56
59
|
window._fs_asset_map_id = options.assetMapId;
|
|
57
60
|
}
|
|
@@ -88,7 +91,7 @@ var _init = function (inputOptions, readyCallback) {
|
|
|
88
91
|
fs('trackEvent', {
|
|
89
92
|
name: 'FullStory Dev Mode',
|
|
90
93
|
properties: {
|
|
91
|
-
|
|
94
|
+
message: message,
|
|
92
95
|
}
|
|
93
96
|
});
|
|
94
97
|
fs('shutdown');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fullstory/browser",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.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",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"sdk"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@fullstory/snippet": "2.0.
|
|
29
|
+
"@fullstory/snippet": "2.0.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@babel/core": "^7.8.7",
|
package/src/index.test.ts
CHANGED
|
@@ -151,6 +151,16 @@ describe('typescript safety', () => {
|
|
|
151
151
|
// @ts-expect-error (for testing purposes)
|
|
152
152
|
FS('observe', { type: '🦂', callback: () => console.log('STARTED') });
|
|
153
153
|
|
|
154
|
+
// Disconnector can be `void` type
|
|
155
|
+
const disconnector = FS('observe', { type: 'start', callback: () => console.log('STARTED') });
|
|
156
|
+
|
|
157
|
+
// README(scottnorvell): statements where we _don't_ null check the disconnector
|
|
158
|
+
// work in the editor but not on CI so I got rid of them 🤷♂️
|
|
159
|
+
if (disconnector) {
|
|
160
|
+
// passes
|
|
161
|
+
disconnector.disconnect();
|
|
162
|
+
}
|
|
163
|
+
|
|
154
164
|
// LEGACY:
|
|
155
165
|
// Passes TypeScript check
|
|
156
166
|
FS.setVars('user', { email: 'e@mail.com' });
|
|
@@ -169,4 +179,17 @@ describe('typescript safety', () => {
|
|
|
169
179
|
// Assertion for posterity's sake...
|
|
170
180
|
expect(true).to.equal(true);
|
|
171
181
|
});
|
|
182
|
+
|
|
183
|
+
// NOTE: don't run this test, it will hang since fs.js isn't really running. It's only for typescript safety checks.
|
|
184
|
+
xit('provides type assistance for the async api', async () => {
|
|
185
|
+
init({ orgId: testOrg });
|
|
186
|
+
|
|
187
|
+
const disconnector = await FS('observeAsync', { type: 'start', callback: () => console.log('STARTED') });
|
|
188
|
+
|
|
189
|
+
disconnector.disconnect();
|
|
190
|
+
|
|
191
|
+
const url = await FS('getSessionAsync');
|
|
192
|
+
|
|
193
|
+
console.log(url.trim());
|
|
194
|
+
});
|
|
172
195
|
});
|
package/src/index.ts
CHANGED
|
@@ -15,6 +15,7 @@ import { initFS, FSApi } from '@fullstory/snippet';
|
|
|
15
15
|
*/
|
|
16
16
|
export interface SnippetOptions {
|
|
17
17
|
orgId: string;
|
|
18
|
+
appHost?: string;
|
|
18
19
|
assetMapId?: string;
|
|
19
20
|
cookieDomain?: string;
|
|
20
21
|
debug?: boolean;
|
|
@@ -37,6 +38,7 @@ type ReadyCallback = (data: { sessionUrl: string, settings: Readonly<object> })
|
|
|
37
38
|
|
|
38
39
|
declare global {
|
|
39
40
|
interface Window {
|
|
41
|
+
_fs_app_host?: string;
|
|
40
42
|
_fs_asset_map_id?: string;
|
|
41
43
|
_fs_capture_on_startup?: boolean;
|
|
42
44
|
_fs_cookie_domain?: string;
|
|
@@ -83,6 +85,10 @@ const _init = (inputOptions: SnippetOptions, readyCallback?: ReadyCallback) => {
|
|
|
83
85
|
window._fs_run_in_iframe = true;
|
|
84
86
|
}
|
|
85
87
|
|
|
88
|
+
if (options.appHost) {
|
|
89
|
+
window._fs_app_host = options.appHost;
|
|
90
|
+
}
|
|
91
|
+
|
|
86
92
|
if (options.assetMapId) {
|
|
87
93
|
window._fs_asset_map_id = options.assetMapId;
|
|
88
94
|
}
|
|
@@ -127,7 +133,7 @@ const _init = (inputOptions: SnippetOptions, readyCallback?: ReadyCallback) => {
|
|
|
127
133
|
fs('trackEvent', {
|
|
128
134
|
name: 'FullStory Dev Mode',
|
|
129
135
|
properties: {
|
|
130
|
-
|
|
136
|
+
message,
|
|
131
137
|
}
|
|
132
138
|
});
|
|
133
139
|
fs('shutdown');
|