@pendo/web-sdk 2.312.1 → 2.313.0

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 CHANGED
@@ -7,7 +7,7 @@ This package is for Pendo customers who want to host the web SDK on their own in
7
7
  Install the package:
8
8
 
9
9
  ```bash
10
- npm install @pendo/agent
10
+ npm install @pendo/web-sdk
11
11
  ```
12
12
 
13
13
  ## Usage
@@ -15,7 +15,7 @@ npm install @pendo/agent
15
15
  Import the package into your application code and create the web SDK using your own settings:
16
16
 
17
17
  ```javascript
18
- import { initialize, TextCapture } from '@pendo/agent';
18
+ import { initialize, TextCapture } from '@pendo/web-sdk';
19
19
  import pendoConfig from '../pendo.config.json';
20
20
 
21
21
  const pendo = await initialize({
@@ -38,7 +38,7 @@ const pendo = await initialize({
38
38
  });
39
39
  ```
40
40
 
41
- The object returned by calling `initialize` is the same as a snippet install of the web SDK and has access to all public functions found in the public function [documentation pages](https://agent.pendo.io/public/agent).
41
+ The object returned by calling `initialize` is the same as a snippet install of the web SDK and has access to all public functions found in the public function [documentation pages](https://web-sdk.pendo.io/public/core).
42
42
 
43
43
  ### Parameters
44
44
 
@@ -109,7 +109,7 @@ We have created an [example extension](https://github.com/pendo-io/chrome-mv3-ex
109
109
 
110
110
  ## CLI
111
111
 
112
- The Pendo package includes a CLI tool to be able to simplify a few actions providing greater control of the web SDK in your application. Once you have installed `@pendo/agent` in your application, you will have access to the `pendo` script from your terminal (you can also use a tool like `npx` to make use of the `pendo` script without installing the package if desired by using `npx pendo`). The usage of this script can be found below or by typing `pendo` or `pendo help` into your terminal where the package is installed:
112
+ The Pendo package includes a CLI tool to be able to simplify a few actions providing greater control of the web SDK in your application. Once you have installed `@pendo/web-sdk` in your application, you will have access to the `pendo` script from your terminal (you can also use a tool like `npx` to make use of the `pendo` script without installing the package if desired by using `npx pendo`). The usage of this script can be found below or by typing `pendo` or `pendo help` into your terminal where the package is installed:
113
113
 
114
114
  > **Note**: If the config, copy, or designer commands are being used by your application, you might want to use those as part of your regular build process to ensure that you always maintain up to date versions of your config and of the static assets. For example, you could add a script to your package.json like below that you then call as part of your build:
115
115
 
@@ -122,7 +122,7 @@ The Pendo package includes a CLI tool to be able to simplify a few actions provi
122
122
  ```bash
123
123
  Usage: pendo <command>
124
124
 
125
- CLI for @pendo/agent to assist in integrating the web SDK into your application.
125
+ CLI for @pendo/web-sdk to assist in integrating the web SDK into your application.
126
126
 
127
127
  Commands:
128
128
  pendo config download a new web SDK configuration file for your application
@@ -132,7 +132,7 @@ Commands:
132
132
  pendo version show the current version of the web SDK
133
133
 
134
134
  Documentation for the Pendo Web SDK can be found at:
135
- https://agent.pendo.io
135
+ https://web-sdk.pendo.io
136
136
  ```
137
137
 
138
138
  ### Download Config
@@ -161,7 +161,7 @@ Copy static web SDK files into a local folder for self hosting. Includes guide s
161
161
 
162
162
  Options:
163
163
  --dest required, the destination folder to copy the static files to, usually the "public" folder of your application
164
- --src optional, the location of the @pendo/agent dist folder, defaults to "./node_modules/@pendo/agent/dist"
164
+ --src optional, the location of the @pendo/web-sdk dist folder, defaults to "./node_modules/@pendo/web-sdk/dist"
165
165
 
166
166
  Examples:
167
167
  Copy from the default location to your public folder
package/bin/cli.js CHANGED
@@ -76,8 +76,8 @@ function copy() {
76
76
  }
77
77
 
78
78
  if (!options.src || typeof options.src !== 'string') {
79
- console.debug('No "src" provided, using default of "node_modules/@pendo/agent/dist"');
80
- options.src = './node_modules/@pendo/agent/dist';
79
+ console.debug('No "src" provided, using default of "node_modules/@pendo/web-sdk/dist"');
80
+ options.src = './node_modules/@pendo/web-sdk/dist';
81
81
  }
82
82
 
83
83
  function copyFiles(srcDir, destDir, files) {
@@ -100,7 +100,7 @@ Copy static Pendo Agent files into a local folder for self hosting. Includes gui
100
100
 
101
101
  Options:
102
102
  --dest required, the destination folder to copy the static files to, usually the "public" folder of your application
103
- --src optional, the location of the @pendo/agent dist folder, defaults to "./node_modules/@pendo/agent/dist"
103
+ --src optional, the location of the @pendo/web-sdk dist folder, defaults to "./node_modules/@pendo/web-sdk/dist"
104
104
 
105
105
  Examples:
106
106
  Copy from the default location to your public folder
@@ -202,18 +202,18 @@ function help() {
202
202
  if (!subCommand) {
203
203
  console.log(`Usage: pendo <command>
204
204
 
205
- CLI for @pendo/agent to assist in integrating the Pendo Agent into your application.
205
+ CLI for @pendo/web-sdk to assist in integrating the Pendo Web SDK into your application.
206
206
 
207
207
  Commands:
208
- pendo config download a new Pendo Agent configuration file for your application
209
- pendo copy copy static assets for the Pendo Agent to a static folder
208
+ pendo config download a new Pendo Web SDK configuration file for your application
209
+ pendo copy copy static assets for the Pendo Web SDK to a static folder
210
210
  pendo designer download new copies of the plugin files needed for the Visual Design Studio
211
211
  pendo help provide help for how to use the Pendo CLI
212
212
  pendo help <command> search for help on a specific <command>
213
- pendo version show the current version of the Pendo Agent
213
+ pendo version show the current version of the Pendo Web SDK
214
214
 
215
- Documentation for the Pendo Agent can be found at:
216
- https://agent.pendo.io`);
215
+ Documentation for the Pendo Web SDK can be found at:
216
+ https://web-sdk.pendo.io`);
217
217
  } else if (helpers[subCommand]) {
218
218
  helpers[subCommand]();
219
219
  } else {
package/dist/dom.esm.js CHANGED
@@ -6210,9 +6210,10 @@ var ConfigReader = (function () {
6210
6210
  function initializeOptions() {
6211
6211
  // Core
6212
6212
  /**
6213
- * Formerly `additionalApiKeys`. When included, all analytics events will be sent to each of the public app IDs in the list (guide events are
6213
+ * When included, all analytics events will be sent to each of the public app IDs in the list (guide events are
6214
6214
  * only sent to the primary public app ID). This will only function if there are no `additionalPublicAppIds` set on
6215
6215
  * the configuration included in the downloaded web SDK.
6216
+ * Alias: `additionalApiKeys`
6216
6217
  *
6217
6218
  * @access public
6218
6219
  * @category Config/Core
@@ -6220,8 +6221,7 @@ var ConfigReader = (function () {
6220
6221
  * @default []
6221
6222
  * @type {string[]}
6222
6223
  */
6223
- addOption('additionalPublicAppIds', [PENDO_CONFIG_SRC, SNIPPET_SRC]);
6224
- addOption('additionalApiKeys', [PENDO_CONFIG_SRC, SNIPPET_SRC]);
6224
+ addOption('additionalPublicAppIds', [PENDO_CONFIG_SRC, SNIPPET_SRC], undefined, undefined, ['additionalApiKeys']);
6225
6225
  addOption('allowedOriginServers');
6226
6226
  addOption('allowedOriginServerHashes');
6227
6227
  addOption('allowMixedApplicationFrames', [SNIPPET_SRC, PENDO_CONFIG_SRC], true);
@@ -6238,8 +6238,9 @@ var ConfigReader = (function () {
6238
6238
  */
6239
6239
  addOption('annotateUrl', [SNIPPET_SRC]);
6240
6240
  /**
6241
- * Formerly `apiKey`. A primary public app ID to send data to from the web SDK. This will only function if there is no `publicAppId` set
6241
+ * A primary public app ID to send data to from the web SDK. This will only function if there is no `publicAppId` set
6242
6242
  * on the configuration included in the downloaded web SDK.
6243
+ * Alias: `apiKey`
6243
6244
  *
6244
6245
  * @access public
6245
6246
  * @category Config/Core
@@ -6247,8 +6248,7 @@ var ConfigReader = (function () {
6247
6248
  * @default undefined
6248
6249
  * @type {string}
6249
6250
  */
6250
- addOption('publicAppId', [PENDO_CONFIG_SRC, SNIPPET_SRC]);
6251
- addOption('apiKey', [PENDO_CONFIG_SRC, SNIPPET_SRC]);
6251
+ addOption('publicAppId', [PENDO_CONFIG_SRC, SNIPPET_SRC], undefined, undefined, ['apiKey']);
6252
6252
  addOption('assetHost', [SNIPPET_SRC, PENDO_CONFIG_SRC]);
6253
6253
  /**
6254
6254
  * If set to `true`, the web SDK will try to install and initialize in all same-origin frames on the page.
@@ -6261,7 +6261,7 @@ var ConfigReader = (function () {
6261
6261
  * @type {boolean}
6262
6262
  */
6263
6263
  addOption('autoFrameInstall', [SNIPPET_SRC, PENDO_CONFIG_SRC], false);
6264
- addOption('blockAgentMetadata', [PENDO_CONFIG_SRC], false);
6264
+ addOption('blockWebSDKMetadata', [PENDO_CONFIG_SRC], false, undefined, ['blockAgentMetadata']);
6265
6265
  /**
6266
6266
  * An alternate url to load guide content from. This will be used to replace the standard google storage
6267
6267
  * url for your subscription. Usually used for
@@ -6336,6 +6336,37 @@ var ConfigReader = (function () {
6336
6336
  */
6337
6337
  addOption('disablePersistence', [SNIPPET_SRC, PENDO_CONFIG_SRC]);
6338
6338
  addOption('enableSignedMetadata', [PENDO_CONFIG_SRC], false);
6339
+ /**
6340
+ * Having identity persisted by default makes it so that a transition from using identified visitor ids
6341
+ * to using anonymous visitor ids is challenging. Anyone that used your application with an identified
6342
+ * visitor id would have that value persisted to storage and whenever the web SDK is initialized for them,
6343
+ * that value would be read from storage treating them as the same identified visitor. When set `true`,
6344
+ * this config option will only use persisted identity values if they are an anonymous id. It is meant to
6345
+ * be used to smoothly make this transition to using anonymous ids while still retaining the benefit of
6346
+ * consistent anonymous ids for visitors. This option will be ignored if you provide an identified
6347
+ * visitorId to the initialize call.
6348
+ *
6349
+ * @access public
6350
+ * @category Config/Core
6351
+ * @name forceAnonymous
6352
+ * @default false
6353
+ * @type {boolean}
6354
+ */
6355
+ addOption('forceAnonymous', [SNIPPET_SRC, PENDO_CONFIG_SRC], false);
6356
+ /**
6357
+ * If set to `true`, the web SDK will prioritize this frame to use as the leader frame that will coordinate
6358
+ * the display of guides and the resource center. The leader frame is usually the "top" frame if the SDK is initialized
6359
+ * there and this option is meant to be used when that condition is not met or the leader should be some other
6360
+ * specific frame. Sitewide guides and the resource center will always attempt to be shown in the leader frame
6361
+ * first.
6362
+ *
6363
+ * @access public
6364
+ * @category Config/Core
6365
+ * @name forceLeader
6366
+ * @default false
6367
+ * @type {boolean}
6368
+ */
6369
+ addOption('forcedLeader', [SNIPPET_SRC, PENDO_CONFIG_SRC], false);
6339
6370
  /**
6340
6371
  * By default, the identity of a visitor in various iframes on a page are independent from each other.
6341
6372
  * Setting this to `true` will instead have the web SDK make sure all frames use the exact same visitor and
@@ -6360,23 +6391,6 @@ var ConfigReader = (function () {
6360
6391
  * @type {boolean}
6361
6392
  */
6362
6393
  addOption('frameIdentityTopDownOnly', [SNIPPET_SRC, PENDO_CONFIG_SRC], true);
6363
- /**
6364
- * Having identity persisted by default makes it so that a transition from using identified visitor ids
6365
- * to using anonymous visitor ids is challenging. Anyone that used your application with an identified
6366
- * visitor id would have that value persisted to storage and whenever the web SDK is initialized for them,
6367
- * that value would be read from storage treating them as the same identified visitor. When set `true`,
6368
- * this config option will only use persisted identity values if they are an anonymous id. It is meant to
6369
- * be used to smoothly make this transition to using anonymous ids while still retaining the benefit of
6370
- * consistent anonymous ids for visitors. This option will be ignored if you provide an identified
6371
- * visitorId to the initialize call.
6372
- *
6373
- * @access public
6374
- * @category Config/Core
6375
- * @name forceAnonymous
6376
- * @default false
6377
- * @type {boolean}
6378
- */
6379
- addOption('forceAnonymous', [SNIPPET_SRC, PENDO_CONFIG_SRC], false);
6380
6394
  addOption('identityStorageLifetime', [SNIPPET_SRC, PENDO_CONFIG_SRC]);
6381
6395
  addOption('identityStorageSuffix', [SNIPPET_SRC, PENDO_CONFIG_SRC]);
6382
6396
  /**
@@ -6477,7 +6491,7 @@ var ConfigReader = (function () {
6477
6491
  * @type {boolean}
6478
6492
  */
6479
6493
  addOption('preventUnloadListener', [SNIPPET_SRC, PENDO_CONFIG_SRC], false);
6480
- addOption('promotedAgentMetadataConfigurations', [PENDO_CONFIG_SRC]);
6494
+ addOption('promotedWebSDKMetadataConfigurations', [PENDO_CONFIG_SRC], undefined, undefined, ['promotedAgentMetadataConfigurations']);
6481
6495
  /**
6482
6496
  * An array of strings or a function that returns an array of strings. The web SDK will then strip any query
6483
6497
  * string parameters from the url that are not found in the provided array. **Deprecated:** new usages to
@@ -6507,14 +6521,15 @@ var ConfigReader = (function () {
6507
6521
  /**
6508
6522
  * Meant to be used with `autoFrameInstall`. If set, the web SDK will use this as the url to download itself
6509
6523
  * from in child frames. Read more about [frame support](/advanced/auto-frame-install).
6524
+ * Alias: `selfHostedAgentUrl`
6510
6525
  *
6511
6526
  * @access public
6512
6527
  * @category Config/Core
6513
- * @name selfHostedAgentUrl
6528
+ * @name selfHostedWebSDKUrl
6514
6529
  * @default undefined
6515
6530
  * @type {string}
6516
6531
  */
6517
- addOption('selfHostedAgentUrl', [SNIPPET_SRC, PENDO_CONFIG_SRC]);
6532
+ addOption('selfHostedWebSDKUrl', [SNIPPET_SRC, PENDO_CONFIG_SRC], undefined, undefined, ['selfHostedAgentUrl']);
6518
6533
  /**
6519
6534
  * If this option is set to true, event data will only be transmitted using requests of type POST instead
6520
6535
  * of first trying to use GET requests. This can result in fewer requests being sent each time that event data
@@ -6616,7 +6631,6 @@ var ConfigReader = (function () {
6616
6631
  addOption('excludeNonGuideAnalytics', [SNIPPET_SRC, PENDO_CONFIG_SRC], false);
6617
6632
  addOption('htmlAttributeBlacklist');
6618
6633
  addOption('htmlAttributes');
6619
- addOption('interceptElementRemoval', [SNIPPET_SRC, PENDO_CONFIG_SRC], false); // old, use syntheticClicks.elementRemoval instead
6620
6634
  /**
6621
6635
  * By default, the web SDK will attempt to intercept calls to `preventDefault` on `touchend` events in order to
6622
6636
  * ensure that Pendo still tracks the click event. There are cases where your application might prevent these
@@ -6648,6 +6662,7 @@ var ConfigReader = (function () {
6648
6662
  * events. In these cases, Pendo will not be able to capture the `click` event properly for events or guide
6649
6663
  * behavior. Setting this to `true` will have the web SDK intercept these types of element removal to ensure
6650
6664
  * more consistent Pendo behavior (this option has been moved from `interceptElementRemoval`).
6665
+ * Alias: `interceptElementRemoval`
6651
6666
  *
6652
6667
  * @access public
6653
6668
  * @category Config/Analytics
@@ -6655,7 +6670,7 @@ var ConfigReader = (function () {
6655
6670
  * @default false
6656
6671
  * @type {boolean}
6657
6672
  */
6658
- addOption('syntheticClicks.elementRemoval', [SNIPPET_SRC, PENDO_CONFIG_SRC], false);
6673
+ addOption('syntheticClicks.elementRemoval', [SNIPPET_SRC, PENDO_CONFIG_SRC], false, undefined, ['interceptElementRemoval']);
6659
6674
  /**
6660
6675
  * A `click` is classified by the browser as the same element receiving the `mousedown` and `mouseup` events.
6661
6676
  * When `true` this option will allow Pendo to treat cases where a visitor clicks down the mouse, moves the
@@ -6704,7 +6719,6 @@ var ConfigReader = (function () {
6704
6719
  * @type {Number}
6705
6720
  */
6706
6721
  addOption('cacheGuidesTimeout', [PENDO_CONFIG_SRC], 600000);
6707
- addOption('delayGuides', [SNIPPET_SRC]); // old, use guides.delay instead
6708
6722
  /**
6709
6723
  * If `true`, this will prevent the web SDK from attempting to launch the Visual Design Studio.
6710
6724
  *
@@ -6740,7 +6754,6 @@ var ConfigReader = (function () {
6740
6754
  * @type {boolean}
6741
6755
  */
6742
6756
  addOption('disableGuidePseudoStyles', [SNIPPET_SRC, PENDO_CONFIG_SRC], false);
6743
- addOption('disableGuides', [SNIPPET_SRC]); // old, use guides.disabled instead
6744
6757
  /**
6745
6758
  * Content of badge and target element activated guides will be prefetched on load to improve guide display
6746
6759
  * time unless set to `true`.
@@ -6785,7 +6798,7 @@ var ConfigReader = (function () {
6785
6798
  * @type {number}
6786
6799
  */
6787
6800
  addOption('guideSeenTimeoutLength', [PENDO_CONFIG_SRC, SNIPPET_SRC], 10000);
6788
- addOption('guideTimeout', [SNIPPET_SRC]); // old, use guides.timeout instead
6801
+ // addOption('guideTimeout', [SNIPPET_SRC]); // old, use guides.timeout instead
6789
6802
  /**
6790
6803
  * If `true`, guides will be verified against their saved content hash before display to ensure validity of
6791
6804
  * guide content.
@@ -6810,7 +6823,8 @@ var ConfigReader = (function () {
6810
6823
  addOption('guides.attachPoint', [SNIPPET_SRC]);
6811
6824
  /**
6812
6825
  * Guides will be loaded, but not displayed. Call `pendo.startGuides()` to display guides when you choose
6813
- * to do so (this options has been moved from `delayGuides`).
6826
+ * to do so.
6827
+ * Alias: `delayGuides`
6814
6828
  *
6815
6829
  * @access public
6816
6830
  * @category Config/Guides
@@ -6818,9 +6832,10 @@ var ConfigReader = (function () {
6818
6832
  * @default false
6819
6833
  * @type {boolean}
6820
6834
  */
6821
- addOption('guides.delay', [SNIPPET_SRC]);
6835
+ addOption('guides.delay', [SNIPPET_SRC], undefined, undefined, ['delayGuides']);
6822
6836
  /**
6823
6837
  * Completely disables guides (this option has been moved from `disableGuides`).
6838
+ * Alias: `disableGuides`
6824
6839
  *
6825
6840
  * @access public
6826
6841
  * @category Config/Guides
@@ -6828,7 +6843,7 @@ var ConfigReader = (function () {
6828
6843
  * @default false
6829
6844
  * @type {boolean}
6830
6845
  */
6831
- addOption('guides.disabled', [SNIPPET_SRC]);
6846
+ addOption('guides.disabled', [SNIPPET_SRC], undefined, undefined, ['disableGuides']);
6832
6847
  /**
6833
6848
  * If 'true', guides with slow selectors will be removed from guide display processing.
6834
6849
  * This will improve application performance, but slow guides will not be shown to users.
@@ -6854,6 +6869,7 @@ var ConfigReader = (function () {
6854
6869
  /**
6855
6870
  * How long to wait for guides to load in milliseconds (this option has been moved from `guideTimeout`).
6856
6871
  * By default guides will not timeout.
6872
+ * Alias: `guideTimeout`
6857
6873
  *
6858
6874
  * @access public
6859
6875
  * @category Config/Guides
@@ -6861,7 +6877,7 @@ var ConfigReader = (function () {
6861
6877
  * @default undefined
6862
6878
  * @type {number}
6863
6879
  */
6864
- addOption('guides.timeout', [SNIPPET_SRC]);
6880
+ addOption('guides.timeout', [SNIPPET_SRC], undefined, undefined, ['guideTimeout']);
6865
6881
  /**
6866
6882
  * The tooltip arrow size (in pixels). This only affects classic guides.
6867
6883
  *
@@ -6952,10 +6968,10 @@ var ConfigReader = (function () {
6952
6968
  // Adopt
6953
6969
  addOption('adoptHost');
6954
6970
  addOption('adoptAnalyticsForwarding');
6955
- addOption('agentDebuggerPluginLoader');
6971
+ addOption('webSDKDebuggerPluginLoader', [PENDO_CONFIG_SRC], undefined, undefined, ['agentDebuggerPluginLoader']);
6956
6972
  addOption('allowPartnerAnalyticsForwarding', [SNIPPET_SRC], false);
6957
6973
  addOption('adoptPrioritizeAdoptGuides', [PENDO_CONFIG_SRC], false);
6958
- addOption('designerAgentPluginsLoader', [PENDO_CONFIG_SRC, SNIPPET_SRC]);
6974
+ addOption('designerWebSDKPluginsLoader', [PENDO_CONFIG_SRC, SNIPPET_SRC], undefined, undefined, ['designerAgentPluginsLoader']);
6959
6975
  addOption('guideContentLoader', [PENDO_CONFIG_SRC]);
6960
6976
  addOption('trainingPartner');
6961
6977
  addOption('oemAccountId', [SNIPPET_SRC]);
@@ -6996,6 +7012,16 @@ var ConfigReader = (function () {
6996
7012
  return;
6997
7013
  var source = sourceGetter();
6998
7014
  var v = _.get(source.lookup, getConfigKey(option));
7015
+ // need to also check option aliases if the option.name key is not found in the source
7016
+ if (!doesExist(v)) {
7017
+ var aliasWithValue = _.find(option.aliases || [], function (alias) {
7018
+ var val = _.get(source.lookup, alias);
7019
+ if (doesExist(val))
7020
+ return val;
7021
+ });
7022
+ if (aliasWithValue)
7023
+ v = _.get(source.lookup, aliasWithValue);
7024
+ }
6999
7025
  return doesExist(v) ? v : undefined;
7000
7026
  }
7001
7027
  function getValueFromSource(option, src) {
@@ -7012,10 +7038,6 @@ var ConfigReader = (function () {
7012
7038
  var option = findOption(optionName);
7013
7039
  defaultValue = defaultValue || _.get(option, 'defaultValue', null);
7014
7040
  var defaultReturn = new ConfigValue(optionName, defaultValue, DEFAULT_SRC);
7015
- // if (source) {
7016
- // var val = getValueFromSource(option, source);
7017
- // return val;
7018
- // }
7019
7041
  var validOptions = mapSourcesToValues(option, sources);
7020
7042
  // defaultValue must exist in order to use non-ordered sources,
7021
7043
  // otherwise you can't know what value to value over another.
@@ -7441,7 +7463,7 @@ function applyMatrix2dRect(matrix2d, rect) {
7441
7463
  return transformedRect;
7442
7464
  }
7443
7465
 
7444
- var VERSION = '2.312.1_';
7466
+ var VERSION = '2.313.0_';
7445
7467
 
7446
7468
  var decodeURIComponent = _.isFunction(window.decodeURIComponent) ? window.decodeURIComponent : _.identity;
7447
7469