@fullstory/browser 2.0.3 → 2.0.5

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2017 FullStory, Inc
3
+ Copyright (c) 2024 Fullstory, Inc
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
- # FullStory Browser SDK
1
+ # Fullstory Browser SDK
2
2
 
3
3
  [![CircleCI](https://circleci.com/gh/fullstorydev/fullstory-browser-sdk.svg?style=svg)](https://circleci.com/gh/fullstorydev/fullstory-browser-sdk) [![npm (scoped)](https://img.shields.io/npm/v/@fullstory/browser)](https://www.npmjs.com/package/@fullstory/browser)
4
4
 
5
- FullStory's browser SDK lets you manage FullStory recording on your site as well as retrieve deep links to session replays and send your own custom events. More information about the FullStory API can be found at https://developer.fullstory.com.
5
+ Fullstory's browser SDK lets you manage Fullstory data capture on your site as well as retrieve deep links to session replays and send your own custom events. More information about the Fullstory API can be found at https://developer.fullstory.com.
6
6
 
7
7
  > **NOTE:** this is the documentation for version 2. For version 1 documentation, please see [@fullstory/browser@1.7.1](https://www.npmjs.com/package/@fullstory/browser/v/1.7.1).
8
8
 
@@ -63,28 +63,28 @@ FullStory('trackEvent', {
63
63
 
64
64
  ## Initialize the SDK
65
65
 
66
- Call the `init()` function with options as soon as you can in your website startup process. Calling init after successful initialization will trigger console warnings - if you need to programmatically check if FullStory has been initialized at some point in your code, you can call `isInitialized()`.
66
+ Call the `init()` function with options as soon as you can in your website startup process. Calling init after successful initialization will trigger console warnings - if you need to programmatically check if `FullStory` has been initialized at some point in your code, you can call `isInitialized()`.
67
67
 
68
68
  ### Configuration Options
69
69
 
70
70
  The only required option is `orgId`, all others are optional.
71
71
 
72
- * `orgId` - Sets your FullStory Org Id. Find out how to get your Org Id [here](https://help.fullstory.com/hc/en-us/articles/360047075853).
73
- * `debug` - When set to `true`, enables FullStory debug messages; defaults to `false`.
72
+ * `orgId` - Sets your Fullstory Org Id. Find out how to get your Org Id [here](https://help.fullstory.com/hc/en-us/articles/360047075853).
73
+ * `debug` - When set to `true`, enables Fullstory debug messages; defaults to `false`.
74
74
  * `host` - The recording server host domain. Can be set to direct recorded events to a proxy that you host. Defaults to `fullstory.com`.
75
- * `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`.
76
- * `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-).
77
- * `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-).
78
- * `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.
79
- * `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.
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
- * `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`.
75
+ * `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`.
76
+ * `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-).
77
+ * `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-).
78
+ * `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.
79
+ * `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.
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
+ * `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
+ * `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.
84
84
 
85
85
  ### Ready Callback
86
86
 
87
- The `init` function also accepts an optional `readyCallback` argument. If you provide a function, it will be invoked when the FullStory session has started. Your callback will be called with one parameter: an object containing information about the session. Currently the only property is `sessionUrl`, which is a string containing the URL to the session.
87
+ The `init` function also accepts an optional `readyCallback` argument. If you provide a function, it will be invoked when the Fullstory session has started. Your callback will be called with one parameter: an object containing information about the session. Currently the only property is `sessionUrl`, which is a string containing the URL to the session.
88
88
 
89
89
  ```javascript
90
90
  import { init } from '@fullstory/browser';
@@ -209,7 +209,7 @@ FullStory('setProperties', {
209
209
  },
210
210
  });
211
211
  ```
212
- For more information on sending custom user properties, view the FullStory help article on [Capturing custom user properties](https://help.fullstory.com/hc/en-us/articles/360020623294).
212
+ For more information on sending custom user properties, view the Fullstory help article on [Capturing custom user properties](https://help.fullstory.com/hc/en-us/articles/360020623294).
213
213
 
214
214
  ### Sending custom page properties
215
215
  ```JavaScript
@@ -227,4 +227,4 @@ FullStory('setProperties', {
227
227
  }
228
228
  });
229
229
  ```
230
- For more information on setting page properties, view the FullStory help article on [Sending custom page data to FullStory](https://help.fullstory.com/hc/en-us/articles/1500004101581-FS-setVars-API-Sending-custom-page-data-to-FullStory).
230
+ For more information on setting page properties, view the Fullstory help article on [Sending custom page data to Fullstory](https://help.fullstory.com/hc/en-us/articles/1500004101581-FS-setVars-API-Sending-custom-page-data-to-Fullstory).
package/dist/index.esm.js CHANGED
@@ -123,7 +123,7 @@ var guard = function (name) { return function () {
123
123
  args[_i] = arguments[_i];
124
124
  }
125
125
  if (window._fs_dev_mode) {
126
- var message = "FullStory is in dev mode and is not recording: ".concat(name, " method not executed");
126
+ var message = "FullStory is in dev mode and is not capturing: ".concat(name, " method not executed");
127
127
  console.warn(message);
128
128
  return message;
129
129
  }
@@ -138,7 +138,7 @@ var buildFullStoryShim = function () {
138
138
  var FS = function (operation, options, source) {
139
139
  var fs = ensureSnippetLoaded();
140
140
  if (window._fs_dev_mode) {
141
- var message = 'FullStory is in dev mode and is not recording: method not executed';
141
+ var message = "FullStory is in dev mode and is not capturing: ".concat(operation, " not executed");
142
142
  console.warn(message);
143
143
  return undefined;
144
144
  }
package/dist/index.js CHANGED
@@ -125,7 +125,7 @@ var guard = function (name) { return function () {
125
125
  args[_i] = arguments[_i];
126
126
  }
127
127
  if (window._fs_dev_mode) {
128
- var message = "FullStory is in dev mode and is not recording: ".concat(name, " method not executed");
128
+ var message = "FullStory is in dev mode and is not capturing: ".concat(name, " method not executed");
129
129
  console.warn(message);
130
130
  return message;
131
131
  }
@@ -140,7 +140,7 @@ var buildFullStoryShim = function () {
140
140
  var FS = function (operation, options, source) {
141
141
  var fs = ensureSnippetLoaded();
142
142
  if (window._fs_dev_mode) {
143
- var message = 'FullStory is in dev mode and is not recording: method not executed';
143
+ var message = "FullStory is in dev mode and is not capturing: ".concat(operation, " not executed");
144
144
  console.warn(message);
145
145
  return undefined;
146
146
  }
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@fullstory/browser",
3
- "version": "2.0.3",
4
- "description": "The official FullStory browser SDK",
3
+ "version": "2.0.5",
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",
7
- "author": "FullStory",
7
+ "author": "Fullstory",
8
8
  "license": "MIT",
9
9
  "main": "./dist/index.js",
10
10
  "module": "./dist/index.esm.js",
package/src/index.test.ts CHANGED
@@ -54,7 +54,7 @@ describe('init', () => {
54
54
  expect(window._fs_is_outer_script).to.equal(true);
55
55
  });
56
56
 
57
- it('should add _fs_dev_mode value to window when initialzed with devMode', () => {
57
+ it('should add _fs_dev_mode value to window when initialized with devMode', () => {
58
58
  init({
59
59
  orgId: testOrg,
60
60
  devMode: true,
@@ -108,7 +108,7 @@ describe('devMode', () => {
108
108
 
109
109
  FS('log', { msg: 'hello world' });
110
110
 
111
- expect(consoleWarnedMessage).to.match(/FullStory is in dev mode/);
111
+ expect(consoleWarnedMessage).to.equal('FullStory is in dev mode and is not capturing: log not executed');
112
112
  });
113
113
  });
114
114
 
package/src/index.ts CHANGED
@@ -163,7 +163,7 @@ const hasFullStoryWithFunction = (...testNames) => {
163
163
 
164
164
  const guard = (name) => (...args) => {
165
165
  if (window._fs_dev_mode) {
166
- const message = `FullStory is in dev mode and is not recording: ${name} method not executed`;
166
+ const message = `FullStory is in dev mode and is not capturing: ${name} method not executed`;
167
167
  console.warn(message);
168
168
  return message;
169
169
  }
@@ -181,7 +181,7 @@ const buildFullStoryShim = (): FSApi => {
181
181
  const fs = ensureSnippetLoaded();
182
182
 
183
183
  if (window._fs_dev_mode) {
184
- const message = 'FullStory is in dev mode and is not recording: method not executed';
184
+ const message = `FullStory is in dev mode and is not capturing: ${operation} not executed`;
185
185
  console.warn(message);
186
186
  return undefined;
187
187
  }