@forgerock/protect 0.0.0-beta-20251003204059 → 0.0.0-beta-20251124184351

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
@@ -36,6 +36,10 @@ Install both modules and their latest versions:
36
36
  npm install @forgerock/javascript-sdk @forgerock/protect
37
37
  ```
38
38
 
39
+ ```sh
40
+ pnpm install @forgerock/javascript-sdk @forgerock/protect
41
+ ```
42
+
39
43
  #### Initialization (Recommended)
40
44
 
41
45
  The `@forgerock/protect` module has a `protect()` function that accepts configuration options and returns a set of methods for interacting with Protect. The two main responsibilities of the Ping Protect module are the initialization of the profiling and data collection and the completion and preparation of the collected data for the server. You can find these two methods on the API returned by `protect()`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forgerock/protect",
3
- "version": "0.0.0-beta-20251003204059",
3
+ "version": "0.0.0-beta-20251124184351",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/ForgeRock/ping-javascript-sdk.git",
@@ -1,2 +0,0 @@
1
- export * from './lib/protect.js';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AASA,cAAc,kBAAkB,CAAC"}
package/dist/src/index.js DELETED
@@ -1,10 +0,0 @@
1
- /*
2
- *
3
- * Copyright © 2025 Ping Identity Corporation. All right reserved.
4
- *
5
- * This software may be modified and distributed under the terms
6
- * of the MIT license. See the LICENSE file for details.
7
- *
8
- */
9
- export * from './lib/protect.js';
10
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,cAAc,kBAAkB,CAAC"}
@@ -1,19 +0,0 @@
1
- import { Protect, ProtectConfig } from './protect.types.js';
2
- declare global {
3
- interface Window {
4
- _pingOneSignals: {
5
- init: (initParams?: ProtectConfig) => Promise<void>;
6
- getData: () => Promise<string>;
7
- pauseBehavioralData: () => void;
8
- resumeBehavioralData: () => void;
9
- };
10
- }
11
- }
12
- /**
13
- * @async
14
- * @function protect - returns a set of methods to interact with the PingOne Signals SDK
15
- * @param {ProtectConfig} options - the configuration options for the PingOne Signals SDK
16
- * @returns {Promise<Protect>} - a set of methods to interact with the PingOne Signals SDK
17
- */
18
- export declare function protect(options: ProtectConfig): Protect;
19
- //# sourceMappingURL=protect.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"protect.d.ts","sourceRoot":"","sources":["../../../src/lib/protect.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAG5D,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,eAAe,EAAE;YACf,IAAI,EAAE,CAAC,UAAU,CAAC,EAAE,aAAa,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;YACpD,OAAO,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;YAC/B,mBAAmB,EAAE,MAAM,IAAI,CAAC;YAChC,oBAAoB,EAAE,MAAM,IAAI,CAAC;SAClC,CAAC;KACH;CACF;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAkEvD"}
@@ -1,81 +0,0 @@
1
- /*
2
- *
3
- * Copyright © 2025 Ping Identity Corporation. All right reserved.
4
- *
5
- * This software may be modified and distributed under the terms
6
- * of the MIT license. See the LICENSE file for details.
7
- *
8
- */
9
- /**
10
- * @async
11
- * @function protect - returns a set of methods to interact with the PingOne Signals SDK
12
- * @param {ProtectConfig} options - the configuration options for the PingOne Signals SDK
13
- * @returns {Promise<Protect>} - a set of methods to interact with the PingOne Signals SDK
14
- */
15
- export function protect(options) {
16
- let protectApiInitialized = false;
17
- return {
18
- start: async () => {
19
- try {
20
- /*
21
- * Load the Ping Signals SDK
22
- * this automatically pollutes the window
23
- * there are no exports of this module
24
- */
25
- await import('./signals-sdk.js');
26
- protectApiInitialized = true;
27
- }
28
- catch (err) {
29
- console.error('error loading ping signals', err);
30
- return { error: 'Failed to load PingOne Signals SDK' };
31
- }
32
- try {
33
- await window._pingOneSignals.init(options);
34
- if (options.behavioralDataCollection === true) {
35
- window._pingOneSignals.resumeBehavioralData();
36
- }
37
- }
38
- catch (err) {
39
- console.error('error initializing ping protect', err);
40
- return { error: 'Failed to initialize PingOne Signals SDK' };
41
- }
42
- },
43
- getData: async () => {
44
- if (!protectApiInitialized) {
45
- return { error: 'PingOne Signals SDK is not initialized' };
46
- }
47
- try {
48
- return await window._pingOneSignals.getData();
49
- }
50
- catch (err) {
51
- console.error('error getting data from ping protect', err);
52
- return { error: 'Failed to get data from Protect' };
53
- }
54
- },
55
- pauseBehavioralData: () => {
56
- if (!protectApiInitialized) {
57
- return { error: 'PingOne Signals SDK is not initialized' };
58
- }
59
- try {
60
- window._pingOneSignals.pauseBehavioralData();
61
- }
62
- catch (err) {
63
- console.error('error pausing behavioral data in ping protect', err);
64
- return { error: 'Failed to pause behavioral data in Protect' };
65
- }
66
- },
67
- resumeBehavioralData: () => {
68
- if (!protectApiInitialized) {
69
- return { error: 'PingOne Signals SDK is not initialized' };
70
- }
71
- try {
72
- window._pingOneSignals.resumeBehavioralData();
73
- }
74
- catch (err) {
75
- console.error('error resuming behavioral data in ping protect', err);
76
- return { error: 'Failed to resume behavioral data in Protect' };
77
- }
78
- },
79
- };
80
- }
81
- //# sourceMappingURL=protect.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"protect.js","sourceRoot":"","sources":["../../../src/lib/protect.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAgBH;;;;;GAKG;AACH,MAAM,UAAU,OAAO,CAAC,OAAsB;IAC5C,IAAI,qBAAqB,GAAG,KAAK,CAAC;IAElC,OAAO;QACL,KAAK,EAAE,KAAK,IAAuC,EA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,MAAM,CAAC,eAAe,CAAC,mBAAmB,EAAE,CAAC;YAC/C,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,OAAO,CAAC,KAAK,CAAC,+CAA+C,EAAE,GAAG,CAAC,CAAC;gBACpE,OAAO,EAAE,KAAK,EAAE,4CAA4C,EAAE,CAAC;YACjE,CAAC;QACH,CAAC;QACD,oBAAoB,EAAE,GAA6B,EAAE;YACnD,IAAI,CAAC,qBAAqB,EAAE,CAAC;gBAC3B,OAAO,EAAE,KAAK,EAAE,wCAAwC,EAAE,CAAC;YAC7D,CAAC;YAED,IAAI,CAAC;gBACH,MAAM,CAAC,eAAe,CAAC,oBAAoB,EAAE,CAAC;YAChD,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,OAAO,CAAC,KAAK,CAAC,gDAAgD,EAAE,GAAG,CAAC,CAAC;gBACrE,OAAO,EAAE,KAAK,EAAE,6CAA6C,EAAE,CAAC;YAClE,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1,92 +0,0 @@
1
- /**
2
- * @interface ProtectConfig - Interface for the Protect module configuration parameters
3
- * @description - envId is required. All other parameters are optional.
4
- */
5
- export interface ProtectConfig {
6
- /**
7
- * @property {string} envId - the environment id from your PingOne tenant
8
- */
9
- envId: string;
10
- /**
11
- * @property {boolean} [waitForWindowLoad] - true to init the SDK on load event, instead of DOMContentLoaded event. default is true
12
- */
13
- waitForWindowLoad?: boolean;
14
- /**
15
- * @property {string} [hubUrl] - iframe url for cross-storage device ID
16
- */
17
- hubUrl?: string;
18
- /**
19
- * @property {boolean} [disableHub] - when true, the SDK store the deviceId to the localStorage only and won't use an iframe (hub). default is false
20
- */
21
- disableHub?: boolean;
22
- /**
23
- * @property {string[]} [deviceAttributesToIgnore] - metadata blacklist
24
- */
25
- deviceAttributesToIgnore?: string[];
26
- /**
27
- * @property {boolean} [behavioralDataCollection] - true to collect behavioral data. default is true
28
- */
29
- behavioralDataCollection?: boolean;
30
- /**
31
- * @property {boolean} [disableTags] - true to skip tag collection. default is false
32
- */
33
- disableTags?: boolean;
34
- /**
35
- * @property {Record<string, string>} [externalIdentifiers] - optional customer external identifiers that should be reflected on a device entity
36
- */
37
- externalIdentifiers?: Record<string, string>;
38
- /**
39
- * @property {boolean} [universalDeviceIdentification] - set to true if you want the device data in the SDK payload to be provided as a signed JWT
40
- */
41
- universalDeviceIdentification?: boolean;
42
- /**
43
- * @property {boolean} [agentIdentification] - set to true if you are using risk policies that contain the PingID Device Trust predictor. default is false
44
- */
45
- agentIdentification?: boolean;
46
- /**
47
- * @property {number} [agentTimeout] - If agentIdentification is true, use agentTimeout to specify the timeout the trust agent should use if you don't want to use the default timeout setting. Can be between 200 and 10,000 milliseconds. Default is 5000.
48
- */
49
- agentTimeout?: number;
50
- /**
51
- * @property {number} [agentPort] - If agentIdentification is true, use agentPort to specify the port to use when connecting to the trust agent if you don't want to use the default port. Default is 9400.
52
- */
53
- agentPort?: number;
54
- }
55
- /**
56
- * @interface Protect - Interface for methods to interact with the PingOne Signals SDK
57
- */
58
- export interface Protect {
59
- /**
60
- * @async
61
- * @method start - Method to initialize and start the PingOne Signals SDK
62
- * @returns {Promise<void | { error: string }>} - Returns an error if PingOne Signals SDK failed to load
63
- */
64
- start: () => Promise<void | {
65
- error: string;
66
- }>;
67
- /**
68
- * @async
69
- * @method getData - Method to get the device data
70
- * @returns {Promise<string | { error: string }>} - Returns the device data or an error if PingOne Signals SDK failed to load
71
- */
72
- getData: () => Promise<string | {
73
- error: string;
74
- }>;
75
- /**
76
- * @method pauseBehavioralData - Method to pause the behavioral data collection
77
- * @returns {void | { error: string }} - Returns an error if PingOne Signals SDK failed to load
78
- * @description Pause the behavioral data collection only; device profile data will still be collected
79
- */
80
- pauseBehavioralData: () => void | {
81
- error: string;
82
- };
83
- /**
84
- * @method resumeBehavioralData - Method to resume the behavioral data collection
85
- * @returns {void | { error: string }} - Returns an error if PingOne Signals SDK failed to load
86
- * @description Resume the behavioral data collection
87
- */
88
- resumeBehavioralData: () => void | {
89
- error: string;
90
- };
91
- }
92
- //# sourceMappingURL=protect.types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"protect.types.d.ts","sourceRoot":"","sources":["../../../src/lib/protect.types.ts"],"names":[],"mappings":"AASA;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAC;IAEpC;;OAEG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IAEnC;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE7C;;OAEG;IACH,6BAA6B,CAAC,EAAE,OAAO,CAAC;IAExC;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB;;;;OAIG;IACH,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAE/C;;;;OAIG;IACH,OAAO,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAEnD;;;;OAIG;IACH,mBAAmB,EAAE,MAAM,IAAI,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAEpD;;;;OAIG;IACH,oBAAoB,EAAE,MAAM,IAAI,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CACtD"}
@@ -1,10 +0,0 @@
1
- /*
2
- *
3
- * Copyright © 2025 Ping Identity Corporation. All right reserved.
4
- *
5
- * This software may be modified and distributed under the terms
6
- * of the MIT license. See the LICENSE file for details.
7
- *
8
- */
9
- export {};
10
- //# sourceMappingURL=protect.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"protect.types.js","sourceRoot":"","sources":["../../../src/lib/protect.types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=signals-sdk.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"signals-sdk.d.ts","sourceRoot":"","sources":["../../../src/lib/signals-sdk.js"],"names":[],"mappings":""}