@soyio/soyio-widget 3.2.0 → 3.4.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 +38 -3
- package/dist/index.d.ts +13 -0
- package/dist/index.js +1212 -1092
- package/dist/index.umd.cjs +36 -36
- package/package.json +12 -26
- package/src/schemas/config.schema.json +138 -0
package/README.md
CHANGED
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
</a>
|
|
13
13
|
</p>
|
|
14
14
|
|
|
15
|
+
This package is validated by the Soyio SDK CI workflow.
|
|
16
|
+
|
|
15
17
|
## Table of Contents
|
|
16
18
|
|
|
17
19
|
- [Installation](#installation)
|
|
@@ -81,7 +83,7 @@ The **`ConsentBox`** is a component that allows you to embed a consent request d
|
|
|
81
83
|
appearance: {}, // Optional
|
|
82
84
|
actionToken: "<action token>", // Optional
|
|
83
85
|
entityId: "<entity id>", // Optional
|
|
84
|
-
|
|
86
|
+
origin: "<origin>", // Optional
|
|
85
87
|
onReady: () => console.log("ConsentBox is ready"), // Optional
|
|
86
88
|
optionalReconsentBehavior: "notice", // Optional
|
|
87
89
|
mandatoryReconsentBehavior: "notice", // Optional
|
|
@@ -193,6 +195,18 @@ The `PrivacyCenterBox` lets you embed the Privacy Center inside your page. You c
|
|
|
193
195
|
{ id: "op_rectification", label: "Rectification" },
|
|
194
196
|
],
|
|
195
197
|
|
|
198
|
+
// Customize which user data categories appear in DSR dropdowns (optional)
|
|
199
|
+
requestableDataCategories: [
|
|
200
|
+
{
|
|
201
|
+
value: "user.contact.email",
|
|
202
|
+
label: "Primary email",
|
|
203
|
+
description: "The email address we use for this account.",
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
value: "user.name.first",
|
|
207
|
+
},
|
|
208
|
+
],
|
|
209
|
+
|
|
196
210
|
// Override the "exercise your rights" link shown in consent-only mode (optional)
|
|
197
211
|
externalRightsExerciseUrl: "https://privacy.example.com/rights",
|
|
198
212
|
|
|
@@ -240,6 +254,8 @@ The `PrivacyCenterBox` lets you embed the Privacy Center inside your page. You c
|
|
|
240
254
|
consentRetentionPeriod: "30 days", // Optional: prevents immediate revoke for this period
|
|
241
255
|
allowGranularScopeSelection: true, // Optional: only applies when templates have multiple scopes
|
|
242
256
|
groupConsentsByScope: true, // Optional: groups consent templates by scope in consent management
|
|
257
|
+
origin: "<origin>", // Optional: attached to consent actions captured here
|
|
258
|
+
metadata: { key: "value" }, // Optional: attached to consent actions captured here
|
|
243
259
|
onEvent: (event) => console.log(event),
|
|
244
260
|
onReady: () => console.log("PrivacyCenterBox is ready"), // Optional
|
|
245
261
|
isSandbox: true, // Optional
|
|
@@ -271,6 +287,14 @@ The `PrivacyCenterBox` lets you embed the Privacy Center inside your page. You c
|
|
|
271
287
|
- `allowedExtensions`: Array of allowed file extensions (e.g. `['pdf', 'jpg']`). Default: `['pdf', 'png', 'jpeg', 'jpg']`.
|
|
272
288
|
- `maxFileSize`: Maximum file size in bytes. Default: `5 * 1024 * 1024` (5MB).
|
|
273
289
|
- `redecOperationIds`: Optional array of `{ id, label }` values for the Redec operation select. Required if `redec` right is included in `enabledRights` param.
|
|
290
|
+
- `requestableDataCategories`: Optional array of `{ value, label?, description? }` objects to customize the categories shown in DSR dropdowns.
|
|
291
|
+
- `value`: Must be a canonical `user` data category taxonomy key such as `user.contact.email`, `user.name.first`, or `user.labor_activity.salary`.
|
|
292
|
+
- `label`: Optional override for the option label shown to end users.
|
|
293
|
+
- `description`: Optional override for the option helper text shown in the dropdown.
|
|
294
|
+
- When omitted, the Privacy Center keeps the default grouped category list.
|
|
295
|
+
- When provided, the Privacy Center uses the configured list and order.
|
|
296
|
+
- Non-`user` taxonomy values are ignored.
|
|
297
|
+
- Backend `blacklistedDataCategories` can still hide configured values.
|
|
274
298
|
- `externalRightsExerciseUrl`: Optional URL used by required consent alerts when users need to exercise their rights outside the embedded privacy center.
|
|
275
299
|
- `appearance.config.showHeader`: Optional boolean to show/hide the privacy center header (title and description).
|
|
276
300
|
- `content.header`: Optional object with `title` and `description` overrides for the privacy center header copy.
|
|
@@ -287,6 +311,8 @@ The `PrivacyCenterBox` lets you embed the Privacy Center inside your page. You c
|
|
|
287
311
|
- `groupConsentsByScope`: Optional boolean, groups consent templates by scope in consent management. This must be enabled for `consentManagement.scopeGroups` to apply.
|
|
288
312
|
- `consentManagement.scopeGroups`: Optional array to customize accordion groups in consent management. Each group requires a `title` and a `scopes` array with `{ scopeType: 'product' | 'branch', scopeId: string }` entries. Scopes not included in custom groups keep the default scope grouping.
|
|
289
313
|
- `showBatchConsentConfirmation`: Optional boolean, whether to show a confirmation dialog before saving consent changes in batch mode.
|
|
314
|
+
- `origin`: Optional string attached to every consent action captured by the Privacy Center. Useful to identify the business context where the consent was given (e.g. `"my-onboarding-flow"`).
|
|
315
|
+
- `metadata`: Optional object with arbitrary metadata attached to every consent action captured by the Privacy Center. The object must be serializable to JSON; properties with non-serializable values (like functions or `undefined`) will be omitted.
|
|
290
316
|
- `appearance`: Customize the iframe appearance. See Appearance section below.
|
|
291
317
|
- `onEvent`: Callback that receives events from the iframe.
|
|
292
318
|
- `onReady`: Optional callback fired when the iframe becomes ready.
|
|
@@ -294,7 +320,7 @@ The `PrivacyCenterBox` lets you embed the Privacy Center inside your page. You c
|
|
|
294
320
|
Note:
|
|
295
321
|
- When `sessionToken` is provided, do not pass `companyId`.
|
|
296
322
|
- `consentManagement.scopeGroups` is applied during initial iframe URL render and also synchronized through `SET_PRIVACY_CENTER_CONFIG` updates.
|
|
297
|
-
- `content.header`, `content.consentManagement.header`, `appearance.config.showConsentManagementHeader`, and `
|
|
323
|
+
- `content.header`, `content.consentManagement.header`, `appearance.config.showConsentManagementHeader`, `externalRightsExerciseUrl`, and `requestableDataCategories` are applied through `SET_PRIVACY_CENTER_CONFIG`; those overrides may briefly appear after the iframe is ready.
|
|
298
324
|
|
|
299
325
|
### Privacy Center Events
|
|
300
326
|
|
|
@@ -1244,7 +1270,7 @@ export default function PrivacyCenterContainer() {
|
|
|
1244
1270
|
To run the widget customization smoke test locally:
|
|
1245
1271
|
|
|
1246
1272
|
```sh
|
|
1247
|
-
|
|
1273
|
+
pnpm smoke
|
|
1248
1274
|
```
|
|
1249
1275
|
|
|
1250
1276
|
The smoke test configuration is loaded from `smoke-test/.env.development`. You can modify this file to change the default values:
|
|
@@ -1261,6 +1287,15 @@ To test DSR rights in the Privacy Center tab, add these parameters to the JSON c
|
|
|
1261
1287
|
```json
|
|
1262
1288
|
{
|
|
1263
1289
|
"enabledRights": ["arsop", "redec"],
|
|
1290
|
+
"requestableDataCategories": [
|
|
1291
|
+
{
|
|
1292
|
+
"value": "user.contact.email",
|
|
1293
|
+
"label": "Primary email"
|
|
1294
|
+
},
|
|
1295
|
+
{
|
|
1296
|
+
"value": "user.name.first"
|
|
1297
|
+
}
|
|
1298
|
+
],
|
|
1264
1299
|
"redecOperationIds": [
|
|
1265
1300
|
{ "id": "op_update", "label": "Update" },
|
|
1266
1301
|
{ "id": "op_rectification", "label": "Rectification" }
|
package/dist/index.d.ts
CHANGED
|
@@ -345,9 +345,12 @@ declare type PrivacyCenterConfig = BaseConfig & {
|
|
|
345
345
|
showBatchConsentConfirmation?: boolean;
|
|
346
346
|
consentManagement?: PrivacyCenterConsentManagementConfig;
|
|
347
347
|
redecOperationIds?: RedecOperationId[];
|
|
348
|
+
requestableDataCategories?: PrivacyCenterRequestableDataCategoryOption[];
|
|
348
349
|
content?: PrivacyCenterContentConfig;
|
|
349
350
|
header?: PrivacyCenterHeaderCopyConfig;
|
|
350
351
|
rightExamples?: PrivacyCenterContentConfig['rightExamples'];
|
|
352
|
+
origin?: string;
|
|
353
|
+
metadata?: Record<string, unknown>;
|
|
351
354
|
} & ({
|
|
352
355
|
companyId: `com_${string}`;
|
|
353
356
|
sessionToken?: never;
|
|
@@ -384,6 +387,12 @@ declare type PrivacyCenterHeaderCopyConfig = {
|
|
|
384
387
|
description?: string;
|
|
385
388
|
};
|
|
386
389
|
|
|
390
|
+
declare type PrivacyCenterRequestableDataCategoryOption = {
|
|
391
|
+
value: UserDataCategoryKey;
|
|
392
|
+
label?: string;
|
|
393
|
+
description?: string;
|
|
394
|
+
};
|
|
395
|
+
|
|
387
396
|
declare type PrivacyCenterRight = 'arsop' | 'redec';
|
|
388
397
|
|
|
389
398
|
declare type PrivacyCenterScopeReference = {
|
|
@@ -656,4 +665,8 @@ export declare class _TooltipManager {
|
|
|
656
665
|
destroy(): void;
|
|
657
666
|
}
|
|
658
667
|
|
|
668
|
+
declare const USER_DATA_CATEGORY_KEYS: readonly ["user", "user.account", "user.authorization", "user.behavior", "user.biometric", "user.childrens", "user.contact", "user.content", "user.demographic", "user.location", "user.device", "user.payment", "user.social", "user.unique_id", "user.telemetry", "user.user_sensor", "user.workplace", "user.sensor", "user.financial", "user.government_id", "user.health_and_medical", "user.name", "user.criminal_history", "user.privacy_preferences", "user.job_title", "user.account.settings", "user.account.username", "user.authorization.credentials", "user.authorization.biometric", "user.authorization.password", "user.behavior.browsing_history", "user.behavior.media_consumption", "user.behavior.purchase_history", "user.behavior.search_history", "user.biometric.fingerprint", "user.biometric.retinal", "user.biometric.voice", "user.biometric.health", "user.contact.address", "user.contact.email", "user.contact.phone_number", "user.contact.url", "user.contact.fax_number", "user.contact.organization", "user.contact.address.city", "user.contact.address.country", "user.contact.address.postal_code", "user.contact.address.state", "user.contact.address.street", "user.content.private", "user.content.public", "user.content.self_image", "user.demographic.age_range", "user.demographic.date_of_birth", "user.demographic.gender", "user.demographic.language", "user.demographic.marital_status", "user.demographic.political_opinion", "user.demographic.profile", "user.demographic.race_ethnicity", "user.demographic.religious_belief", "user.demographic.sexual_orientation", "user.demographic.nationality", "user.device.cookie", "user.device.cookie_id", "user.device.device_id", "user.device.ip_address", "user.financial.bank_account", "user.financial.credit_card", "user.government_id.birth_certificate", "user.government_id.drivers_license_number", "user.government_id.immigration", "user.government_id.national_identification_number", "user.government_id.passport_number", "user.government_id.vehicle_registration", "user.health_and_medical.genetic", "user.health_and_medical.insurance_beneficiary_id", "user.health_and_medical.record_id", "user.labor_activity", "user.labor_activity.profession", "user.labor_activity.job_title", "user.labor_activity.worker_type", "user.labor_activity.salary", "user.labor_activity.workplace", "user.location.imprecise", "user.location.precise", "user.name.first", "user.name.last", "user.unique_id.pseudonymous"];
|
|
669
|
+
|
|
670
|
+
declare type UserDataCategoryKey = (typeof USER_DATA_CATEGORY_KEYS)[number];
|
|
671
|
+
|
|
659
672
|
export { }
|