@redacto.io/consent-sdk-react 3.5.0 → 4.0.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.
@@ -0,0 +1,21 @@
1
+
2
+ 
3
+ > @redacto.io/consent-sdk-react@3.5.0 build /Users/abhishekashyap/Documents/consent-sdk/packages/consent-sdk-react
4
+ > tsup
5
+
6
+ CLI Building entry: {"index":"src/index.ts"}
7
+ CLI Using tsconfig: tsconfig.json
8
+ CLI tsup v8.5.1
9
+ CLI Using tsup config: /Users/abhishekashyap/Documents/consent-sdk/packages/consent-sdk-react/tsup.config.ts
10
+ CLI Target: es2019
11
+ CLI Cleaning output folder
12
+ ESM Build start
13
+ CJS Build start
14
+ ESM dist/index.mjs 165.70 KB
15
+ ESM ⚡️ Build success in 66ms
16
+ CJS dist/index.js 172.18 KB
17
+ CJS ⚡️ Build success in 68ms
18
+ DTS Build start
19
+ DTS ⚡️ Build success in 819ms
20
+ DTS dist/index.d.mts 2.92 KB
21
+ DTS dist/index.d.ts 2.92 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @redacto.io/consent-sdk-react
2
2
 
3
+ ## 4.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - add child consent flow
8
+
3
9
  ## 3.5.0
4
10
 
5
11
  ### Minor Changes
package/dist/index.d.mts CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as react from 'react';
3
+ import react__default from 'react';
3
4
 
4
5
  type Settings$1 = {
5
6
  button: {
@@ -26,6 +27,20 @@ type Settings$1 = {
26
27
  borderColor?: string;
27
28
  font?: string;
28
29
  };
30
+ /**
31
+ * Error codes from guardian verification
32
+ */
33
+ type GuardianVerificationErrorCode = "SESSION_EXPIRED" | "GUARDIAN_UNDER_18" | "TOKEN_FAILED" | "DIGILOCKER_AUTH_FAILED" | "NO_AUTH_CODE";
34
+ type ConsentFlowState = "age-check" | "guardian-details" | "digilocker-pending" | "consent-form" | "submitting" | "success" | "error";
35
+ /**
36
+ * Props for DigiLockerCallback component
37
+ */
38
+ type DigiLockerCallbackProps = {
39
+ accessToken: string;
40
+ baseUrl?: string;
41
+ onSuccess?: (verificationReference: string) => void;
42
+ onError?: (error: Error, errorCode?: GuardianVerificationErrorCode) => void;
43
+ };
29
44
 
30
45
  type Props$1 = Readonly<{
31
46
  noticeId: string;
@@ -40,6 +55,8 @@ type Props$1 = Readonly<{
40
55
  onError?: (error: Error) => void;
41
56
  applicationId?: string;
42
57
  validateAgainst?: "all" | "required";
58
+ digilockerMode?: "popup" | "redirect";
59
+ digilockerCallbackUrl?: string;
43
60
  includeFullyConsentedData?: boolean;
44
61
  reviewModeButtonText?: string;
45
62
  }>;
@@ -51,7 +68,7 @@ type Props$1 = Readonly<{
51
68
  * to view and manage their consent preferences. Supports both initial consent
52
69
  * collection and reconsent flows.
53
70
  */
54
- declare const RedactoNoticeConsent: ({ noticeId, accessToken, refreshToken, baseUrl, language, blockUI, onAccept, onDecline, onError, settings, applicationId, validateAgainst, includeFullyConsentedData, reviewModeButtonText, }: Props$1) => react_jsx_runtime.JSX.Element;
71
+ declare const RedactoNoticeConsent: ({ noticeId, accessToken, refreshToken, baseUrl, language, blockUI, onAccept, onDecline, onError, settings, applicationId, validateAgainst, digilockerMode, digilockerCallbackUrl, includeFullyConsentedData, reviewModeButtonText, }: Props$1) => react_jsx_runtime.JSX.Element;
55
72
 
56
73
  type Settings = {
57
74
  button: {
@@ -99,4 +116,34 @@ declare const RedactoConsentInline: react.MemoExoticComponent<{
99
116
  displayName: string;
100
117
  }>;
101
118
 
102
- export { RedactoNoticeConsent, RedactoConsentInline as RedactoNoticeConsentInline };
119
+ /**
120
+ * DigiLockerCallback Component
121
+ *
122
+ * Standalone component for handling DigiLocker redirect callbacks.
123
+ * Clients should add this to their routing (e.g., /digilocker-callback page).
124
+ *
125
+ * Usage in Next.js:
126
+ * ```tsx
127
+ * // pages/digilocker-callback.tsx
128
+ * import { DigiLockerCallback } from '@redacto.io/consent-sdk-react';
129
+ *
130
+ * export default function DigiLockerCallbackPage() {
131
+ * return <DigiLockerCallback accessToken={"<token>"} />;
132
+ * }
133
+ * ```
134
+ *
135
+ * Usage in React Router:
136
+ * ```tsx
137
+ * <Route path="/digilocker-callback" element={<DigiLockerCallback accessToken={"<token>"} />} />
138
+ * ```
139
+ *
140
+ * URL Parameters expected from redirect:
141
+ * - session_token: The verification session token
142
+ * - status: "verified" | "failed" | "expired"
143
+ * - verification_reference: (if verified) Reference for consent submission
144
+ * - error_code: (if failed) Error code like GUARDIAN_UNDER_18, SESSION_EXPIRED, etc.
145
+ */
146
+
147
+ declare const DigiLockerCallback: react__default.FC<DigiLockerCallbackProps>;
148
+
149
+ export { type ConsentFlowState, DigiLockerCallback, type DigiLockerCallbackProps, type GuardianVerificationErrorCode, RedactoNoticeConsent, RedactoConsentInline as RedactoNoticeConsentInline };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as react from 'react';
3
+ import react__default from 'react';
3
4
 
4
5
  type Settings$1 = {
5
6
  button: {
@@ -26,6 +27,20 @@ type Settings$1 = {
26
27
  borderColor?: string;
27
28
  font?: string;
28
29
  };
30
+ /**
31
+ * Error codes from guardian verification
32
+ */
33
+ type GuardianVerificationErrorCode = "SESSION_EXPIRED" | "GUARDIAN_UNDER_18" | "TOKEN_FAILED" | "DIGILOCKER_AUTH_FAILED" | "NO_AUTH_CODE";
34
+ type ConsentFlowState = "age-check" | "guardian-details" | "digilocker-pending" | "consent-form" | "submitting" | "success" | "error";
35
+ /**
36
+ * Props for DigiLockerCallback component
37
+ */
38
+ type DigiLockerCallbackProps = {
39
+ accessToken: string;
40
+ baseUrl?: string;
41
+ onSuccess?: (verificationReference: string) => void;
42
+ onError?: (error: Error, errorCode?: GuardianVerificationErrorCode) => void;
43
+ };
29
44
 
30
45
  type Props$1 = Readonly<{
31
46
  noticeId: string;
@@ -40,6 +55,8 @@ type Props$1 = Readonly<{
40
55
  onError?: (error: Error) => void;
41
56
  applicationId?: string;
42
57
  validateAgainst?: "all" | "required";
58
+ digilockerMode?: "popup" | "redirect";
59
+ digilockerCallbackUrl?: string;
43
60
  includeFullyConsentedData?: boolean;
44
61
  reviewModeButtonText?: string;
45
62
  }>;
@@ -51,7 +68,7 @@ type Props$1 = Readonly<{
51
68
  * to view and manage their consent preferences. Supports both initial consent
52
69
  * collection and reconsent flows.
53
70
  */
54
- declare const RedactoNoticeConsent: ({ noticeId, accessToken, refreshToken, baseUrl, language, blockUI, onAccept, onDecline, onError, settings, applicationId, validateAgainst, includeFullyConsentedData, reviewModeButtonText, }: Props$1) => react_jsx_runtime.JSX.Element;
71
+ declare const RedactoNoticeConsent: ({ noticeId, accessToken, refreshToken, baseUrl, language, blockUI, onAccept, onDecline, onError, settings, applicationId, validateAgainst, digilockerMode, digilockerCallbackUrl, includeFullyConsentedData, reviewModeButtonText, }: Props$1) => react_jsx_runtime.JSX.Element;
55
72
 
56
73
  type Settings = {
57
74
  button: {
@@ -99,4 +116,34 @@ declare const RedactoConsentInline: react.MemoExoticComponent<{
99
116
  displayName: string;
100
117
  }>;
101
118
 
102
- export { RedactoNoticeConsent, RedactoConsentInline as RedactoNoticeConsentInline };
119
+ /**
120
+ * DigiLockerCallback Component
121
+ *
122
+ * Standalone component for handling DigiLocker redirect callbacks.
123
+ * Clients should add this to their routing (e.g., /digilocker-callback page).
124
+ *
125
+ * Usage in Next.js:
126
+ * ```tsx
127
+ * // pages/digilocker-callback.tsx
128
+ * import { DigiLockerCallback } from '@redacto.io/consent-sdk-react';
129
+ *
130
+ * export default function DigiLockerCallbackPage() {
131
+ * return <DigiLockerCallback accessToken={"<token>"} />;
132
+ * }
133
+ * ```
134
+ *
135
+ * Usage in React Router:
136
+ * ```tsx
137
+ * <Route path="/digilocker-callback" element={<DigiLockerCallback accessToken={"<token>"} />} />
138
+ * ```
139
+ *
140
+ * URL Parameters expected from redirect:
141
+ * - session_token: The verification session token
142
+ * - status: "verified" | "failed" | "expired"
143
+ * - verification_reference: (if verified) Reference for consent submission
144
+ * - error_code: (if failed) Error code like GUARDIAN_UNDER_18, SESSION_EXPIRED, etc.
145
+ */
146
+
147
+ declare const DigiLockerCallback: react__default.FC<DigiLockerCallbackProps>;
148
+
149
+ export { type ConsentFlowState, DigiLockerCallback, type DigiLockerCallbackProps, type GuardianVerificationErrorCode, RedactoNoticeConsent, RedactoConsentInline as RedactoNoticeConsentInline };