@fullstory/browser 1.4.6 → 1.4.10

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.4.10
4
+
5
+ - Adding docs to the types file (index.d.ts)
6
+
7
+ ## 1.4.8
8
+
9
+ - Updating README to better describe the behavior of the `recordCrossDomainIFrames` option
10
+
11
+ ## 1.4.7
12
+ - Updating README to include vue 3
13
+ - `npm audit fix` to clean up npm audit warnings
14
+
3
15
  ## 1.4.6
4
16
 
5
17
  - Updating snippet.js to include the latest snippet version
package/README.md CHANGED
@@ -29,7 +29,7 @@ The only required option is `orgId`, all others are optional.
29
29
  * `orgId` - Sets your FullStory Org Id. Find out how to get your Org Id [here](https://help.fullstory.com/hc/en-us/articles/360047075853).
30
30
  * `debug` - When set to `true`, enables FullStory debug messages; defaults to `false`.
31
31
  * `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-).
32
- * `recordCrossDomainIFrames` - When set to `true`, FullStory is added to cross-domain IFrames and records content; defaults to `false`. 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.
32
+ * `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.
33
33
  * `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.
34
34
  * `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`.
35
35
 
@@ -86,6 +86,20 @@ new Vue({
86
86
  }).$mount('#app');
87
87
  ```
88
88
 
89
+ #### Vue 3
90
+
91
+ ```javascript
92
+ import { createApp } from 'vue'
93
+ import App from './App.vue'
94
+ import * as FullStory from '@fullstory/browser';
95
+
96
+ FullStory.init({ orgId: '<your org id here>' });
97
+
98
+ const app = createApp(App);
99
+ app.config.globalProperties.$FullStory = FullStory;
100
+ app.mount('#app');
101
+ ```
102
+
89
103
  ## Using the SDK
90
104
 
91
105
  Once FullStory is initialized, you can make calls to the FullStory SDK.
@@ -108,4 +122,4 @@ FullStory.event('Subscribed', {
108
122
  ```JavaScript
109
123
  const startOfPlayback = FullStory.getCurrentSessionURL();
110
124
  const playbackAtThisMomentInTime = FullStory.getCurrentSessionURL(true);
111
- ```
125
+ ```
package/dist/index.d.ts CHANGED
@@ -1,3 +1,15 @@
1
+ /**
2
+ * FullStory Client SDK snippet options.
3
+ *
4
+ * - orgId: Reference for your [Org Id](https://help.fullstory.com/hc/en-us/articles/360047075853) listed in FullStory.
5
+ * - namespace: Global object name that contains the FullStory browser API methods and properties. Defaults to `FS`.
6
+ * - debug: Debug mode with extra browser console logging.
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
+ * - 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
+ * - 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
+ * - 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
+ * - 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`.
12
+ */
1
13
  interface SnippetOptions {
2
14
  orgId: string;
3
15
  namespace?: string;
@@ -5,7 +17,7 @@ interface SnippetOptions {
5
17
  host?: string;
6
18
  script?: string;
7
19
  recordCrossDomainIFrames?: boolean;
8
- recordOnlyThisIFrame?: boolean; // see README for details
20
+ recordOnlyThisIFrame?: boolean;
9
21
  devMode?: boolean;
10
22
  }
11
23
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fullstory/browser",
3
- "version": "1.4.6",
3
+ "version": "1.4.10",
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",
@@ -27,28 +27,27 @@
27
27
  ],
28
28
  "devDependencies": {
29
29
  "@babel/core": "^7.8.7",
30
+ "@babel/eslint-parser": "^7.16.5",
30
31
  "@babel/preset-env": "^7.10.4",
31
32
  "@babel/register": "^7.8.6",
32
- "babel-eslint": "^10.1.0",
33
+ "@rollup/plugin-babel": "^5.3.0",
33
34
  "chai": "^4.1.2",
34
- "eslint": "^5.16.0",
35
- "eslint-config-airbnb": "^17.1.0",
35
+ "eslint": "^8.6.0",
36
+ "eslint-config-airbnb": "^19.0.4",
36
37
  "eslint-plugin-import": "^2.20.1",
37
- "eslint-plugin-jsx-a11y": "^6.0.2",
38
- "eslint-plugin-react": "^7.19.0",
39
- "karma": "^5.0.4",
38
+ "eslint-plugin-jsx-a11y": "^6.5.1",
39
+ "eslint-plugin-react": "^7.28.0",
40
+ "karma": "^6.1.1",
40
41
  "karma-chai": "^0.1.0",
41
42
  "karma-chrome-launcher": "^3.1.0",
42
43
  "karma-mocha": "^2.0.1",
43
44
  "karma-spec-reporter": "0.0.32",
44
- "karma-webpack": "^4.0.2",
45
- "mocha": "^7.1.2",
45
+ "karma-webpack": "^5.0.0",
46
+ "mocha": "^9.0.0",
46
47
  "rimraf": "^2.7.1",
47
48
  "rollup": "^1.32.1",
48
- "rollup-plugin-babel": "^4.4.0",
49
49
  "rollup-plugin-copy": "^3.3.0",
50
50
  "typescript": "^3.8.3",
51
- "webpack": "^4.42.0"
52
- },
53
- "dependencies": {}
51
+ "webpack": "^5.38.1"
52
+ }
54
53
  }
package/src/index.d.ts CHANGED
@@ -1,3 +1,15 @@
1
+ /**
2
+ * FullStory Client SDK snippet options.
3
+ *
4
+ * - orgId: Reference for your [Org Id](https://help.fullstory.com/hc/en-us/articles/360047075853) listed in FullStory.
5
+ * - namespace: Global object name that contains the FullStory browser API methods and properties. Defaults to `FS`.
6
+ * - debug: Debug mode with extra browser console logging.
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
+ * - 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
+ * - 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
+ * - 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
+ * - 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`.
12
+ */
1
13
  interface SnippetOptions {
2
14
  orgId: string;
3
15
  namespace?: string;
@@ -5,7 +17,7 @@ interface SnippetOptions {
5
17
  host?: string;
6
18
  script?: string;
7
19
  recordCrossDomainIFrames?: boolean;
8
- recordOnlyThisIFrame?: boolean; // see README for details
20
+ recordOnlyThisIFrame?: boolean;
9
21
  devMode?: boolean;
10
22
  }
11
23
 
package/src/index.js CHANGED
@@ -11,10 +11,10 @@ const ensureSnippetLoaded = () => {
11
11
 
12
12
  const hasFullStoryWithFunction = (...testNames) => {
13
13
  ensureSnippetLoaded();
14
- return testNames.every(current => fs()[current]);
14
+ return testNames.every((current) => fs()[current]);
15
15
  };
16
16
 
17
- const guard = name => (...args) => {
17
+ const guard = (name) => (...args) => {
18
18
  if (window._fs_dev_mode) {
19
19
  const message = `FullStory is in dev mode and is not recording: ${name} method not executed`;
20
20
  console.warn(message); // eslint-disable-line no-console
@@ -45,7 +45,7 @@ const _init = (options) => {
45
45
  return;
46
46
  }
47
47
 
48
- // inject FullStory into cross domain iFrames and record them
48
+ // see README for details on the recordCrossDomainIFrames option
49
49
  if (options.recordCrossDomainIFrames) {
50
50
  window._fs_run_in_iframe = true;
51
51
  }