@redacto.io/consent-sdk-react 10.0.0-beta.1 → 10.0.0-beta.11

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.
Files changed (84) hide show
  1. package/.turbo/turbo-build.log +11 -11
  2. package/CHANGELOG.md +109 -0
  3. package/README.md +78 -0
  4. package/dist/{chunk-6A665OPR.mjs → chunk-OGL6OC3A.mjs} +4 -0
  5. package/dist/index.d.mts +32 -4
  6. package/dist/index.d.ts +32 -4
  7. package/dist/index.js +340 -230
  8. package/dist/index.mjs +339 -231
  9. package/dist/privacy-center.d.mts +55 -12
  10. package/dist/privacy-center.d.ts +55 -12
  11. package/dist/privacy-center.js +848 -950
  12. package/dist/privacy-center.mjs +698 -802
  13. package/package.json +1 -1
  14. package/src/RedactoNoticeAssisted/RedactoNoticeAssisted.test.tsx +87 -0
  15. package/src/RedactoNoticeAssisted/RedactoNoticeAssisted.tsx +27 -0
  16. package/src/RedactoNoticeAssisted/api/index.ts +7 -1
  17. package/src/RedactoNoticeAssisted/api/types.ts +2 -0
  18. package/src/RedactoNoticeAssisted/i18n.ts +0 -55
  19. package/src/RedactoNoticeAssisted/types.ts +2 -0
  20. package/src/RedactoNoticeConsent/RedactoNoticeConsent.test.tsx +42 -8
  21. package/src/RedactoNoticeConsent/RedactoNoticeConsent.tsx +74 -33
  22. package/src/RedactoNoticeConsent/api/index.ts +88 -175
  23. package/src/RedactoNoticeConsent/api/sandbox.ts +150 -0
  24. package/src/RedactoNoticeConsent/api/types.ts +58 -43
  25. package/src/RedactoNoticeConsent/language-codes.ts +0 -2
  26. package/src/RedactoNoticeConsent/types.ts +28 -2
  27. package/src/RedactoNoticeConsentInline/RedactoNoticeConsentInline.tsx +85 -5
  28. package/src/RedactoNoticeConsentInline/api/index.ts +10 -1
  29. package/src/RedactoNoticeConsentInline/api/notice-read-routing.test.ts +72 -0
  30. package/src/RedactoNoticeConsentInline/api/types.ts +2 -0
  31. package/src/RedactoPrivacyCenter/RedactoPrivacyCenter.tsx +37 -2
  32. package/src/RedactoPrivacyCenter/api/actions.ts +3 -1
  33. package/src/RedactoPrivacyCenter/api/client.ts +122 -25
  34. package/src/RedactoPrivacyCenter/api/fetcher.ts +24 -9
  35. package/src/RedactoPrivacyCenter/components/AppShell/AppShell.tsx +28 -0
  36. package/src/RedactoPrivacyCenter/components/AppShell/UserMenu.tsx +47 -45
  37. package/src/RedactoPrivacyCenter/components/ConsentManager.tsx +2 -1
  38. package/src/RedactoPrivacyCenter/components/Form.tsx +55 -30
  39. package/src/RedactoPrivacyCenter/components/ModifyConsentModal.tsx +1 -1
  40. package/src/RedactoPrivacyCenter/components/SelectUser.tsx +25 -13
  41. package/src/RedactoPrivacyCenter/components/SelectUserGate.tsx +8 -6
  42. package/src/RedactoPrivacyCenter/components/constant.ts +3 -3
  43. package/src/RedactoPrivacyCenter/components/groupHelpers.ts +42 -6
  44. package/src/RedactoPrivacyCenter/context/AuthContext.tsx +131 -39
  45. package/src/RedactoPrivacyCenter/context/types.ts +38 -0
  46. package/src/RedactoPrivacyCenter/lib/api.ts +3 -0
  47. package/src/RedactoPrivacyCenter/lib/constants.ts +12 -6
  48. package/src/RedactoPrivacyCenter/lib/locales.ts +0 -3
  49. package/src/RedactoPrivacyCenter/lib/sandbox.ts +104 -0
  50. package/src/RedactoPrivacyCenter/lib/types.ts +25 -1
  51. package/src/RedactoPrivacyCenter/lib/utils.ts +15 -0
  52. package/src/RedactoPrivacyCenter/locales/as/translation.json +3 -3
  53. package/src/RedactoPrivacyCenter/locales/bn/translation.json +3 -3
  54. package/src/RedactoPrivacyCenter/locales/brx/translation.json +3 -3
  55. package/src/RedactoPrivacyCenter/locales/doi/translation.json +3 -3
  56. package/src/RedactoPrivacyCenter/locales/en/translation.json +4 -3
  57. package/src/RedactoPrivacyCenter/locales/gom/translation.json +3 -3
  58. package/src/RedactoPrivacyCenter/locales/gu/translation.json +3 -3
  59. package/src/RedactoPrivacyCenter/locales/hi/translation.json +3 -3
  60. package/src/RedactoPrivacyCenter/locales/kn/translation.json +3 -3
  61. package/src/RedactoPrivacyCenter/locales/ks/translation.json +3 -3
  62. package/src/RedactoPrivacyCenter/locales/mai/translation.json +3 -3
  63. package/src/RedactoPrivacyCenter/locales/ml/translation.json +3 -3
  64. package/src/RedactoPrivacyCenter/locales/mni-Mtei/translation.json +3 -3
  65. package/src/RedactoPrivacyCenter/locales/mr/translation.json +3 -3
  66. package/src/RedactoPrivacyCenter/locales/ne/translation.json +3 -3
  67. package/src/RedactoPrivacyCenter/locales/or/translation.json +3 -3
  68. package/src/RedactoPrivacyCenter/locales/pa/translation.json +3 -3
  69. package/src/RedactoPrivacyCenter/locales/sa/translation.json +3 -3
  70. package/src/RedactoPrivacyCenter/locales/sat/translation.json +3 -3
  71. package/src/RedactoPrivacyCenter/locales/sd/translation.json +3 -3
  72. package/src/RedactoPrivacyCenter/locales/ta/translation.json +3 -3
  73. package/src/RedactoPrivacyCenter/locales/te/translation.json +3 -3
  74. package/src/RedactoPrivacyCenter/locales/ur/translation.json +3 -3
  75. package/src/RedactoPrivacyCenter/styles/injectStyles.ts +7 -2
  76. package/src/RedactoPrivacyCenter/styles/pcStyles.ts +17 -0
  77. package/src/RedactoPrivacyCenter/ui/PCAvatar.test.tsx +83 -0
  78. package/src/RedactoPrivacyCenter/ui/PCAvatar.tsx +33 -9
  79. package/src/shared/notice-consent-status.ts +190 -0
  80. package/src/shared/sandbox.ts +6 -0
  81. package/tests/Form.test.tsx +142 -5
  82. package/tests/RevokeWarningMessage.test.tsx +151 -0
  83. package/tests/consentClient.test.ts +46 -0
  84. package/src/RedactoPrivacyCenter/locales/bho/translation.json +0 -340
@@ -7,16 +7,16 @@
7
7
  CLI Cleaning output folder
8
8
  ESM Build start
9
9
  CJS Build start
10
- CJS dist/index.js 520.79 KB
11
- CJS dist/privacy-center.js 2.24 MB
12
- CJS ⚡️ Build success in 124ms
13
- ESM dist/index.mjs 506.34 KB
10
+ CJS dist/index.js 516.41 KB
11
+ CJS dist/privacy-center.js 2.21 MB
12
+ CJS ⚡️ Build success in 179ms
14
13
  ESM dist/chunk-6A665OPR.mjs 841.00 B
15
- ESM dist/privacy-center.mjs 2.20 MB
16
- ESM ⚡️ Build success in 124ms
14
+ ESM dist/index.mjs 501.90 KB
15
+ ESM dist/privacy-center.mjs 2.17 MB
16
+ ESM ⚡️ Build success in 184ms
17
17
  DTS Build start
18
- DTS ⚡️ Build success in 2664ms
19
- DTS dist/index.d.mts 8.27 KB
20
- DTS dist/privacy-center.d.mts 33.25 KB
21
- DTS dist/index.d.ts 8.27 KB
22
- DTS dist/privacy-center.d.ts 33.25 KB
18
+ DTS ⚡️ Build success in 3448ms
19
+ DTS dist/index.d.mts 8.42 KB
20
+ DTS dist/privacy-center.d.mts 33.31 KB
21
+ DTS dist/index.d.ts 8.42 KB
22
+ DTS dist/privacy-center.d.ts 33.31 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,114 @@
1
1
  # @redacto.io/consent-sdk-react
2
2
 
3
+ ## 10.0.0-beta.11
4
+
5
+ ### Minor Changes
6
+
7
+ - 43ea923: route the standard notice-content fetch through the Go ledger (ledgerBaseUrl); the magic-link flow (applicationId) and sandbox sessions stay on the consent server. Per-language audio uses the ledger when configured, except sandbox sessions, which the ledger's X-Consent-Token auth does not support
8
+
9
+ drop the separate ledger check-consent round-trip: the notice read already returns the per-principal reconsent overlay (`purpose_selections` / `reconsent_required`) inline, so the banner consumes it directly. This also fixes reconsent on a republished notice, which the standalone check-consent overlay could not detect (no notice-version awareness), and makes `validate_against` apply to the overlay
10
+
11
+ ### Patch Changes
12
+
13
+ - f4b3cad: Inline notice read: use the authenticated `notices/{notice_uuid}` endpoint whenever an access token is available, so the embedded widget works against the Go consent ledger.
14
+
15
+ The inline widget read the notice from `notices/get-notice/{notice_uuid}` — a tokenless endpoint the consent server serves and the ledger does not. Pointing `baseUrl` at the ledger therefore failed with 404 `Resource not found` even though the notice existed there, and the path is compiled into the SDK so no `baseUrl` change could fix it.
16
+
17
+ The inline widget already carries the access token it needs to submit consent. When that token is present the notice now comes from `notices/{notice_uuid}` with an `Authorization: Bearer` header — the same endpoint the modal (`RedactoNoticeConsent`) has always used, served by both the consent server and the ledger, and the one that returns the caller's `purpose_selections` / `reconsent_required` overlay and 409 `CONSENT_ALREADY_PROVIDED`. Without a token the legacy tokenless path is unchanged, so the OTP-gated assisted flow and any anonymous embed keep working against the consent server.
18
+
19
+ Because the token now selects the endpoint, a token that arrives after the widget mounts also has to re-read the notice: `InlineController.updateToken()` refetches when the first read was tokenless, so the unauthenticated content can no longer be auto-submitted. A later token refresh does not refetch, which would discard in-progress selections.
20
+
21
+ A token arriving while the first read is still in flight leaves two reads racing, so the notice read is now generation-guarded in `InlineController` — a superseded tokenless response can no longer replace the authenticated content, reset the selections under the user, or auto-submit against the newly stored token. `hasAlreadyConsented` is also cleared at the start of each read, so a 409 for one principal cannot blank the widget for the next one.
22
+
23
+ Also in this change: `Accept-Language` is sent on the tokenless read too (it was only set on the authenticated path in `consent-sdk-js` and `consent-sdk-react`, so `language` was ignored for anonymous callers), and the `consent-sdk-react` notice fetch is now abort-guarded like `consent-sdk-react-native`, so the tokenless request cannot resolve last and overwrite the authenticated one.
24
+
25
+ - udpate the beta version with latest changes
26
+
27
+ ## 10.0.0-beta.10
28
+
29
+ ### Patch Changes
30
+
31
+ - refactor(privacy-center): remove purpose revocability, keep the revoke warning message (CON-I1041). Removes only the non-revocable withdrawal-blocking behaviour from feature #490: the Privacy Center no longer consumes a per-purpose `revocable` flag, no longer disables the withdraw control for non-revocable purposes, and no longer maps the `purpose_not_revocable` backend error to a toast. `PurposeItem` drops `revocable`. The per-purpose custom `revoke_warning_message` shown in the revoke modal is **retained** (`PurposeItem` keeps `revoke_warning_message`). Paired with the consent-server and redfront changes; revocability moves to the notice level.
32
+
33
+ ## 10.0.0-beta.9
34
+
35
+ ### Patch Changes
36
+
37
+ - e44b1a3: Privacy Center: fix the DSAR request form showing "No products available" against the legacy Python backend. The request-form product picker is now sourced from `user-consents` on **both** backends — the Go ledger's `/public/.../user-consents` when `ledgerBaseUrl` is configured, Python's `/dsar/privacy-center/user-consents` otherwise (the same read the Manage Consent view already used in both modes) — instead of being skipped entirely without a ledger, which left the picker dependent on `form/data` product groups that Python no longer emits.
38
+
39
+ Two related gaps are closed: a successful-but-empty `user-consents` response no longer overwrites the product groups `form/data` did supply, and a backend that returns only the legacy flat `purposes` list now renders those purposes under a single "Your data" group instead of the empty state. Cases raised from that fallback group are submitted without a `product_uuid` anchor, matching the pre-grouping org-level case shape.
40
+
41
+ - source Privacy Center DSAR product picker from user-consents on both backends
42
+
43
+ ## 10.0.0-beta.8
44
+
45
+ ### Patch Changes
46
+
47
+ - fix(consent-sdk): record language on withdraw/regrant + localize RN activity log
48
+
49
+ ## 10.0.0-beta.7
50
+
51
+ ### Minor Changes
52
+
53
+ - feat(consent-sdk-react): show User ID as primary field in shared-contact profile picker
54
+
55
+ ## 10.0.0-beta.6
56
+
57
+ ### Patch Changes
58
+
59
+ - minor bug fix in beta version
60
+
61
+ ## 10.0.0-beta.5
62
+
63
+ ### Major Changes
64
+
65
+ - M3 Version
66
+
67
+ ### Minor Changes
68
+
69
+ - 1a11423: RedactoNoticeAssisted: add `ledgerBaseUrl` support with the standard fallback, for parity with RedactoNoticeConsent and RedactoNoticeConsentInline. When `ledgerBaseUrl` is set, the consent write is routed through `ledgerBaseUrl || baseUrl || BASE_URL` (only `submit-consent` moves to the ledger; the public notice / OTP / TTS endpoints stay on `baseUrl`). After OTP verification the widget also runs a ledger `check-consent` read and, if the principal has already fully consented, hands off via `onComplete` without writing a duplicate consent event — the ledger equivalent of the legacy Python 409 `CONSENT_ALREADY_PROVIDED`, which no longer fires once consent records live in the ledger. Without `ledgerBaseUrl` the behavior is unchanged (write to the legacy consent server, reactive 409-as-success). The ledger `check-consent` network read is now shared across all three notice components.
70
+
71
+ ### Patch Changes
72
+
73
+ - 1a11423: RedactoNoticeConsentInline: detect already-consented principals via the Go ledger after the consent cutover. Previously the embedded widget only recognized an already-consented user through Python's 409 `CONSENT_ALREADY_PROVIDED` on `get-notice`; once consent records move to the ledger, Python stops returning that 409, so the widget would re-render the notice and could auto-submit a duplicate consent. When `ledgerBaseUrl` is configured (and outside the magic-link `specific_uuid` flow), the widget now runs the same ledger `check-consent` read the banner uses and short-circuits to the already-consented state, gating auto-submit until that read settles. Without `ledgerBaseUrl` the legacy Python-409 path is unchanged. The ledger `check-consent` read is now shared between `RedactoNoticeConsent` and `RedactoNoticeConsentInline`.
74
+
75
+ ## 10.0.0-beta.4
76
+
77
+ ### Patch Changes
78
+
79
+ - 05b3452: fix(privacy-center): make the org logo visible and even in the header
80
+
81
+ PCAvatar applied its coloured fill to the `<img>` branch as well as the initials branch. Since every
82
+ call site passes `color="info"` and branding maps `--pc-info` to the org's own primary colour, a
83
+ brand-coloured logo on a transparent background was painted onto a disc of the same colour and
84
+ disappeared. Image avatars now render with `object-fit: contain` (no more stretching) and
85
+ `box-sizing: border-box` (unchanged 24/32/48px box), and fall back to initials when the logo fails to
86
+ load instead of showing an empty coloured circle. Standalone brand marks get a neutral surface and a
87
+ hairline ring; a new `framed={false}` opts out of that chrome when a parent control already draws it.
88
+
89
+ The header's logo menu is now a real navbar control: it uses the same size token, ring, background
90
+ and hover as the notification bell (`--pc-navbar-actions-control-height`, 32px circle), instead of an
91
+ ad-hoc transparent pill wrapping a smaller 24px avatar. That removes the size mismatch next to the
92
+ bell and the concentric rings its brand-tinted hover glow used to stack around the avatar's own ring.
93
+
94
+ - 31785c6: Remove Bhojpuri (`bho`) from the language selectors and bundled translations. The backend no longer
95
+ supports Bhojpuri (it is not a DPDPA-mandated language), so it is dropped from the Privacy Center and
96
+ Notice language lists to match the supported set. Any consumer still passing `bho` falls back to the
97
+ default language.
98
+ - Privacy Center: 400 error when DP changes language to Bhojpuri
99
+
100
+ ## 10.0.0-beta.3
101
+
102
+ ### Minor Changes
103
+
104
+ - show org_user_id to distinguish shared-contact profiles
105
+
106
+ ## 10.0.0-beta.2
107
+
108
+ ### Minor Changes
109
+
110
+ - add revokable and non revokable purposes
111
+
3
112
  ## 10.0.0-beta.1
4
113
 
5
114
  ### Major Changes
package/README.md CHANGED
@@ -117,6 +117,80 @@ npm install @tanstack/react-query @tanstack/react-table \
117
117
 
118
118
  If you only use `RedactoNoticeConsent` or `RedactoNoticeConsentInline`, these peers are not needed.
119
119
 
120
+ ## Sandbox Mode (No Backend Required)
121
+
122
+ Sandbox mode lets you build and test a full consent PoC — **notice → Privacy Center → DSAR** — straight from your app, with **no backend and no token minting**. Instead of your server generating a JWT, you paste a **static sandbox token** into the SDK. Everything you create is recorded as test data, isolated from your live records.
123
+
124
+ Going live is a config swap, not a rewrite: drop the sandbox props and pass a real JWT (see [Backend Server Setup](#backend-server-setup)).
125
+
126
+ ### 1. Get your sandbox credentials
127
+
128
+ In the **Redacto Dashboard → API Keys → Sandbox** tab, copy:
129
+
130
+ - your **Sandbox token** (a static string; it never expires and needs no refresh)
131
+ - your **Organization ID** and **Workspace ID** (shown under *Workspace identifiers* on the same page)
132
+
133
+ ### 2. Collect consent
134
+
135
+ Pass the sandbox `token`, org/workspace, and a test identity (`email`, `mobile`, or `ucic`). No `accessToken` is needed:
136
+
137
+ ```tsx
138
+ import { RedactoNoticeConsent } from "@redacto.io/consent-sdk-react";
139
+
140
+ <RedactoNoticeConsent
141
+ noticeId={NOTICE_UUID}
142
+ token={SANDBOX_TOKEN}
143
+ organisationUuid={ORG_UUID}
144
+ workspaceUuid={WORKSPACE_UUID}
145
+ email="test.user@example.com" // or `mobile`, or `ucic`
146
+ onAccept={() => console.log("consent recorded (test)")}
147
+ onDecline={() => {}}
148
+ />;
149
+ ```
150
+
151
+ ### 3. Manage consent & raise a DSAR
152
+
153
+ Point the Privacy Center at the same sandbox token and test identity. The same test user can now review the consent from step 2, withdraw it, and file a DSAR — end to end, all as test data:
154
+
155
+ ```tsx
156
+ import { RedactoPrivacyCenter } from "@redacto.io/consent-sdk-react/privacy-center";
157
+
158
+ <RedactoPrivacyCenter
159
+ token={SANDBOX_TOKEN}
160
+ organisationUuid={ORG_UUID}
161
+ workspaceUuid={WORKSPACE_UUID}
162
+ email="test.user@example.com" // or `mobile`, or `ucic`
163
+ slug="acme-co"
164
+ onError={(error) => {
165
+ console.error(error);
166
+ return false;
167
+ }}
168
+ />;
169
+ ```
170
+
171
+ ### Sandbox props
172
+
173
+ | Prop | Required | Description |
174
+ | --------------------------- | ------------ | --------------------------------------------------------------------------------- |
175
+ | `token` | Yes | Static sandbox token from the Dashboard. Its presence activates sandbox mode. |
176
+ | `organisationUuid` | Yes | Organization ID from the Dashboard. |
177
+ | `workspaceUuid` | Yes | Workspace ID from the Dashboard. |
178
+ | `email` / `mobile` / `ucic` | One required | The test subject. Precedence when more than one is set: `ucic` > `email` > `mobile`. |
179
+
180
+ `RedactoPrivacyCenter` takes the same sandbox props — `token`, `organisationUuid`, `workspaceUuid`, and `email` / `mobile` / `ucic`.
181
+
182
+ ### How it works
183
+
184
+ - The SDK sends the sandbox token as an `X-Consent-Token` header and the test identity inside each request (query params on reads, body on writes) — no JWT decode, no token refresh (a `401` fails fast).
185
+ - The server records everything under `environment=test`, namespaced so sandbox data never mixes with — or reads — your live records.
186
+ - Sandbox always talks to the consent server; it never routes to the Go ledger.
187
+
188
+ ### Going live
189
+
190
+ Sandbox and production use the same components. To ship, remove the sandbox props and pass a real `accessToken` / `refreshToken` (JWT) minted by your backend — see [Backend Server Setup](#backend-server-setup) below. New records are then written as `environment=live`.
191
+
192
+ > Sandbox is available on `RedactoNoticeConsent` and `RedactoPrivacyCenter`. The inline (`RedactoNoticeConsentInline`) and assisted (`RedactoNoticeAssisted`) widgets are JWT/OTP-only.
193
+
120
194
  ### Backend Server Setup
121
195
 
122
196
  Before using the SDK components, you need to set up backend server endpoints that generate access tokens by calling Redacto's API. Your server should implement the following endpoints:
@@ -249,6 +323,7 @@ A modal popup component for consent collection. Displays a full-screen modal wit
249
323
  | `accessToken` | `string` | Yes | - | Authentication token for API calls |
250
324
  | `refreshToken` | `string` | Yes | - | Refresh token for token renewal |
251
325
  | `baseUrl` | `string` | No | - | Base URL for the consent API |
326
+ | `ledgerBaseUrl` | `string` | No | - | Go ledger base URL. When set, consent writes and prior-consent checks route through the ledger (falls back: ledger → baseUrl → default). Omit to keep the legacy consent-server path. |
252
327
  | `blockUI` | `boolean` | No | `true` | Whether to block UI interaction |
253
328
  | `language` | `string` | No | `"en"` | Language code |
254
329
  | `settings` | `object` | No | - | Custom styling options |
@@ -335,6 +410,7 @@ The component automatically submits consent when all of the following conditions
335
410
  | `accessToken` | `string` | No | - | Authentication token |
336
411
  | `refreshToken` | `string` | No | - | Refresh token |
337
412
  | `baseUrl` | `string` | No | - | Base URL for the consent API |
413
+ | `ledgerBaseUrl` | `string` | No | - | Go ledger base URL. When set, consent writes and already-consented checks route through the ledger. Omit for legacy behavior. |
338
414
  | `language` | `string` | No | `"en"` | Language code |
339
415
  | `settings` | `object` | No | - | Custom styling options |
340
416
  | `applicationId` | `string` | No | - | Application-specific UUID |
@@ -365,6 +441,7 @@ A modal, agent-assisted consent widget for collecting consent from an end-user w
365
441
  | `workspaceUuid` | `string` | Yes | - | Workspace UUID (path segment of the public notice endpoint) |
366
442
  | `noticeUuid` | `string` | Yes | - | Notice UUID to fetch and render |
367
443
  | `baseUrl` | `string` | No | Production consent API | Base URL for the consent API |
444
+ | `ledgerBaseUrl` | `string` | No | - | Go ledger base URL. When set, the consent write routes through the ledger (falls back: ledger → baseUrl → default). Notice fetch, OTP, and TTS always stay on `baseUrl`. Omit for legacy behavior. |
368
445
  | `onDecline` | `() => void` | No | Logs and resets the flow | Called when the agent/customer declines (host should unmount the modal) |
369
446
  | `onComplete` | `() => void` | No | Logs and resets the flow | Called when the agent clicks "Proceed" on the confirmed screen |
370
447
 
@@ -761,6 +838,7 @@ import { RedactoPrivacyCenter } from "@redacto.io/consent-sdk-react/privacy-cent
761
838
  | Prop | Type | Required | Default | Description |
762
839
  | -------------- | -------------------------------------------------------------------------------------------------------------------------- | -------- | -------------------- | -------------------------------------------------------- |
763
840
  | `baseUrl` | `string` | Yes | - | Consent server base URL |
841
+ | `ledgerBaseUrl` | `string` | No | - | Go ledger base URL. When set, user consents, group purposes, receipts, and manage-consent route through the ledger, and the DSAR form's product picker is overlaid from ledger-served consents. Omit to use the legacy `/dsar/privacy-center/*` routes. |
764
842
  | `slug` | `string` | Yes | - | Workspace slug |
765
843
  | `accessToken` | `string` | Yes | - | JWT access token |
766
844
  | `refreshToken` | `string` | Yes | - | JWT refresh token |
@@ -25,6 +25,10 @@ var useMediaQuery = (query) => {
25
25
  return matches;
26
26
  };
27
27
 
28
+ // src/shared/sandbox.ts
29
+ var SANDBOX_TOKEN_HEADER = "X-Consent-Token";
30
+
28
31
  export {
32
+ SANDBOX_TOKEN_HEADER,
29
33
  useMediaQuery
30
34
  };
package/dist/index.d.mts CHANGED
@@ -43,8 +43,34 @@ type DigiLockerCallbackProps = {
43
43
 
44
44
  type Props$1 = Readonly<{
45
45
  noticeId: string;
46
- accessToken: string;
47
- refreshToken: string;
46
+ /**
47
+ * JWT access token. Optional so sandbox integrations (see `token`) can
48
+ * omit it. Required in the normal JWT flow.
49
+ */
50
+ accessToken?: string;
51
+ /** JWT refresh token. Optional; accepted for source-compat, currently unused. */
52
+ refreshToken?: string;
53
+ /**
54
+ * Sandbox PoC: a pasted static token. When set, the SDK runs against the
55
+ * sandbox with no JWT — it sends the single `X-Consent-Token` header, carries
56
+ * the acting identity (`email` || `mobile`) in each request's own payload,
57
+ * takes org/workspace from `organisationUuid`/`workspaceUuid`, and does no
58
+ * token refresh.
59
+ */
60
+ token?: string;
61
+ /** Sandbox test subject email (carried in the request payload when set). */
62
+ email?: string;
63
+ /** Sandbox test subject mobile (fallback subject when `email` is absent). */
64
+ mobile?: string;
65
+ /**
66
+ * Sandbox UCIC: the client's own user id / org_user_id, e.g. a UUID or
67
+ * customer code; optional third identifier alongside email/mobile.
68
+ */
69
+ ucic?: string;
70
+ /** Sandbox org UUID (replaces the JWT-decoded org in sandbox mode). */
71
+ organisationUuid?: string;
72
+ /** Sandbox workspace UUID (replaces the JWT-decoded workspace in sandbox mode). */
73
+ workspaceUuid?: string;
48
74
  baseUrl?: string;
49
75
  ledgerBaseUrl?: string;
50
76
  settings?: Partial<Settings$1>;
@@ -76,7 +102,7 @@ type Props$1 = Readonly<{
76
102
  * to view and manage their consent preferences. Supports both initial consent
77
103
  * collection and reconsent flows.
78
104
  */
79
- declare const RedactoNoticeConsent: ({ noticeId, accessToken, refreshToken, baseUrl, ledgerBaseUrl, language, blockUI, onAccept, onDecline, onError, settings, applicationId, validateAgainst, digilockerMode, digilockerCallbackUrl, includeFullyConsentedData, reviewModeButtonText, }: Props$1) => react__default.JSX.Element;
105
+ declare const RedactoNoticeConsent: ({ noticeId, accessToken, refreshToken, token, email, mobile, ucic, organisationUuid, workspaceUuid, baseUrl, ledgerBaseUrl, language, blockUI, onAccept, onDecline, onError, settings, applicationId, validateAgainst, digilockerMode, digilockerCallbackUrl, includeFullyConsentedData, reviewModeButtonText, }: Props$1) => react__default.JSX.Element;
80
106
 
81
107
  type Settings = {
82
108
  button: {
@@ -139,6 +165,8 @@ type RedactoNoticeAssistedProps = {
139
165
  noticeUuid: string;
140
166
  /** API base URL (defaults to the production consent API). */
141
167
  baseUrl?: string;
168
+ /** Go ledger base URL — routes the consent write to the ledger; omit to use the legacy consent server. */
169
+ ledgerBaseUrl?: string;
142
170
  /** Called when the agent/customer declines (host should unmount the modal). */
143
171
  onDecline?: () => void;
144
172
  /** Called when the agent clicks "Proceed" on the confirmed screen. */
@@ -159,7 +187,7 @@ type RedactoNoticeAssistedProps = {
159
187
  * submit, `onComplete` fires immediately with no confirmation screen (mirroring
160
188
  * RedactoNoticeConsent's `onAccept`). Steps: `notice` → `verify` (with `otpSent`).
161
189
  */
162
- declare const RedactoNoticeAssisted: ({ organisationUuid, workspaceUuid, noticeUuid, baseUrl, onDecline, onComplete, }: RedactoNoticeAssistedProps) => react.JSX.Element;
190
+ declare const RedactoNoticeAssisted: ({ organisationUuid, workspaceUuid, noticeUuid, baseUrl, ledgerBaseUrl, onDecline, onComplete, }: RedactoNoticeAssistedProps) => react.JSX.Element;
163
191
 
164
192
  /**
165
193
  * DigiLockerCallback Component
package/dist/index.d.ts CHANGED
@@ -43,8 +43,34 @@ type DigiLockerCallbackProps = {
43
43
 
44
44
  type Props$1 = Readonly<{
45
45
  noticeId: string;
46
- accessToken: string;
47
- refreshToken: string;
46
+ /**
47
+ * JWT access token. Optional so sandbox integrations (see `token`) can
48
+ * omit it. Required in the normal JWT flow.
49
+ */
50
+ accessToken?: string;
51
+ /** JWT refresh token. Optional; accepted for source-compat, currently unused. */
52
+ refreshToken?: string;
53
+ /**
54
+ * Sandbox PoC: a pasted static token. When set, the SDK runs against the
55
+ * sandbox with no JWT — it sends the single `X-Consent-Token` header, carries
56
+ * the acting identity (`email` || `mobile`) in each request's own payload,
57
+ * takes org/workspace from `organisationUuid`/`workspaceUuid`, and does no
58
+ * token refresh.
59
+ */
60
+ token?: string;
61
+ /** Sandbox test subject email (carried in the request payload when set). */
62
+ email?: string;
63
+ /** Sandbox test subject mobile (fallback subject when `email` is absent). */
64
+ mobile?: string;
65
+ /**
66
+ * Sandbox UCIC: the client's own user id / org_user_id, e.g. a UUID or
67
+ * customer code; optional third identifier alongside email/mobile.
68
+ */
69
+ ucic?: string;
70
+ /** Sandbox org UUID (replaces the JWT-decoded org in sandbox mode). */
71
+ organisationUuid?: string;
72
+ /** Sandbox workspace UUID (replaces the JWT-decoded workspace in sandbox mode). */
73
+ workspaceUuid?: string;
48
74
  baseUrl?: string;
49
75
  ledgerBaseUrl?: string;
50
76
  settings?: Partial<Settings$1>;
@@ -76,7 +102,7 @@ type Props$1 = Readonly<{
76
102
  * to view and manage their consent preferences. Supports both initial consent
77
103
  * collection and reconsent flows.
78
104
  */
79
- declare const RedactoNoticeConsent: ({ noticeId, accessToken, refreshToken, baseUrl, ledgerBaseUrl, language, blockUI, onAccept, onDecline, onError, settings, applicationId, validateAgainst, digilockerMode, digilockerCallbackUrl, includeFullyConsentedData, reviewModeButtonText, }: Props$1) => react__default.JSX.Element;
105
+ declare const RedactoNoticeConsent: ({ noticeId, accessToken, refreshToken, token, email, mobile, ucic, organisationUuid, workspaceUuid, baseUrl, ledgerBaseUrl, language, blockUI, onAccept, onDecline, onError, settings, applicationId, validateAgainst, digilockerMode, digilockerCallbackUrl, includeFullyConsentedData, reviewModeButtonText, }: Props$1) => react__default.JSX.Element;
80
106
 
81
107
  type Settings = {
82
108
  button: {
@@ -139,6 +165,8 @@ type RedactoNoticeAssistedProps = {
139
165
  noticeUuid: string;
140
166
  /** API base URL (defaults to the production consent API). */
141
167
  baseUrl?: string;
168
+ /** Go ledger base URL — routes the consent write to the ledger; omit to use the legacy consent server. */
169
+ ledgerBaseUrl?: string;
142
170
  /** Called when the agent/customer declines (host should unmount the modal). */
143
171
  onDecline?: () => void;
144
172
  /** Called when the agent clicks "Proceed" on the confirmed screen. */
@@ -159,7 +187,7 @@ type RedactoNoticeAssistedProps = {
159
187
  * submit, `onComplete` fires immediately with no confirmation screen (mirroring
160
188
  * RedactoNoticeConsent's `onAccept`). Steps: `notice` → `verify` (with `otpSent`).
161
189
  */
162
- declare const RedactoNoticeAssisted: ({ organisationUuid, workspaceUuid, noticeUuid, baseUrl, onDecline, onComplete, }: RedactoNoticeAssistedProps) => react.JSX.Element;
190
+ declare const RedactoNoticeAssisted: ({ organisationUuid, workspaceUuid, noticeUuid, baseUrl, ledgerBaseUrl, onDecline, onComplete, }: RedactoNoticeAssistedProps) => react.JSX.Element;
163
191
 
164
192
  /**
165
193
  * DigiLockerCallback Component