@trustsig/react 1.1.11 → 1.2.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/dist/index.cjs CHANGED
@@ -46,9 +46,12 @@ var TrustSigProvider = ({
46
46
  siteKey,
47
47
  endpoint,
48
48
  wasmUrl,
49
+ scriptUrl,
49
50
  interceptRequests,
50
51
  debug,
51
52
  nonce,
53
+ env,
54
+ customData,
52
55
  children
53
56
  }) => {
54
57
  const [isLoaded, setIsLoaded] = (0, import_react.useState)(false);
@@ -58,11 +61,14 @@ var TrustSigProvider = ({
58
61
  siteKey,
59
62
  endpoint,
60
63
  wasmUrl,
64
+ scriptUrl,
61
65
  interceptRequests,
62
66
  debug,
63
- nonce
67
+ nonce,
68
+ env,
69
+ customData
64
70
  }),
65
- [siteKey, endpoint, wasmUrl, interceptRequests, debug, nonce]
71
+ [siteKey, endpoint, wasmUrl, scriptUrl, interceptRequests, debug, nonce, env, JSON.stringify(customData)]
66
72
  );
67
73
  (0, import_react.useEffect)(() => {
68
74
  let mounted = true;
@@ -83,7 +89,8 @@ var TrustSigProvider = ({
83
89
  () => ({
84
90
  isLoaded,
85
91
  error,
86
- getResponse: () => client.getResponse()
92
+ getResponse: () => client.getResponse(),
93
+ setCustomData: (data) => client.setCustomData(data)
87
94
  }),
88
95
  [isLoaded, error, client]
89
96
  );
package/dist/index.d.cts CHANGED
@@ -1,17 +1,22 @@
1
1
  import React from 'react';
2
+ import { TrustSigEnv } from '@trustsig/types';
2
3
 
3
4
  interface TrustSigContextValue {
4
5
  isLoaded: boolean;
5
6
  error: Error | null;
6
7
  getResponse: () => Promise<string | null>;
8
+ setCustomData: (data: Record<string, any>) => void;
7
9
  }
8
10
  interface TrustSigProviderProps {
9
11
  siteKey: string;
10
12
  endpoint?: string;
11
13
  wasmUrl?: string;
14
+ scriptUrl?: string;
12
15
  interceptRequests?: boolean;
13
16
  debug?: boolean;
14
17
  nonce?: string;
18
+ env?: TrustSigEnv;
19
+ customData?: Record<string, any>;
15
20
  children: React.ReactNode;
16
21
  }
17
22
  declare const TrustSigProvider: React.FC<TrustSigProviderProps>;
package/dist/index.d.ts CHANGED
@@ -1,17 +1,22 @@
1
1
  import React from 'react';
2
+ import { TrustSigEnv } from '@trustsig/types';
2
3
 
3
4
  interface TrustSigContextValue {
4
5
  isLoaded: boolean;
5
6
  error: Error | null;
6
7
  getResponse: () => Promise<string | null>;
8
+ setCustomData: (data: Record<string, any>) => void;
7
9
  }
8
10
  interface TrustSigProviderProps {
9
11
  siteKey: string;
10
12
  endpoint?: string;
11
13
  wasmUrl?: string;
14
+ scriptUrl?: string;
12
15
  interceptRequests?: boolean;
13
16
  debug?: boolean;
14
17
  nonce?: string;
18
+ env?: TrustSigEnv;
19
+ customData?: Record<string, any>;
15
20
  children: React.ReactNode;
16
21
  }
17
22
  declare const TrustSigProvider: React.FC<TrustSigProviderProps>;
package/dist/index.js CHANGED
@@ -9,9 +9,12 @@ var TrustSigProvider = ({
9
9
  siteKey,
10
10
  endpoint,
11
11
  wasmUrl,
12
+ scriptUrl,
12
13
  interceptRequests,
13
14
  debug,
14
15
  nonce,
16
+ env,
17
+ customData,
15
18
  children
16
19
  }) => {
17
20
  const [isLoaded, setIsLoaded] = useState(false);
@@ -21,11 +24,14 @@ var TrustSigProvider = ({
21
24
  siteKey,
22
25
  endpoint,
23
26
  wasmUrl,
27
+ scriptUrl,
24
28
  interceptRequests,
25
29
  debug,
26
- nonce
30
+ nonce,
31
+ env,
32
+ customData
27
33
  }),
28
- [siteKey, endpoint, wasmUrl, interceptRequests, debug, nonce]
34
+ [siteKey, endpoint, wasmUrl, scriptUrl, interceptRequests, debug, nonce, env, JSON.stringify(customData)]
29
35
  );
30
36
  useEffect(() => {
31
37
  let mounted = true;
@@ -46,7 +52,8 @@ var TrustSigProvider = ({
46
52
  () => ({
47
53
  isLoaded,
48
54
  error,
49
- getResponse: () => client.getResponse()
55
+ getResponse: () => client.getResponse(),
56
+ setCustomData: (data) => client.setCustomData(data)
50
57
  }),
51
58
  [isLoaded, error, client]
52
59
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trustsig/react",
3
- "version": "1.1.11",
3
+ "version": "1.2.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",