@neofaceid/web-sdk 1.36.2 → 1.38.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/dist/index.d.ts CHANGED
@@ -421,6 +421,24 @@ export declare function confirmPasswordReset(token: string, new_password: string
421
421
  message: string;
422
422
  }>;
423
423
 
424
+ /**
425
+ * Dados de consentimento LGPD informados pelo integrador.
426
+ * Usados pelo SDK para registrar a base legal da coleta biométrica.
427
+ */
428
+ export declare interface Consent {
429
+ /** Finalidade da coleta (ex: 'authentication', 'onboarding'). */
430
+ purpose: string;
431
+ /**
432
+ * Base legal. Legítimo interesse não é permitido para dado sensível (LGPD art. 11).
433
+ * Valores: 'consent' | 'legal_obligation' | 'fraud_prevention'.
434
+ */
435
+ legalBasis: 'consent' | 'legal_obligation' | 'fraud_prevention';
436
+ /** URL da política de privacidade apresentada ao titular. */
437
+ privacyPolicyUrl: string;
438
+ /** Prazo de retenção em dias (0 = indefinido/não informado). */
439
+ retentionDays: number;
440
+ }
441
+
424
442
  declare type ConsentFlow = 'verification' | 'registration';
425
443
 
426
444
  export declare interface ConsentInfo {
@@ -684,6 +702,9 @@ export declare function getCachedCaptureSession(): CaptureSession | null;
684
702
  */
685
703
  export declare function getConfig(): Readonly<SDKConfig>;
686
704
 
705
+ /** Retorna os dados de consentimento configurados (ou os defaults conservadores). */
706
+ export declare function getConsent(): Consent;
707
+
687
708
  /**
688
709
  * Retorna o ambiente atual configurado.
689
710
  */
@@ -1334,7 +1355,7 @@ export declare const registerPersonWithoutFace: (personData: {
1334
1355
  /**
1335
1356
  * Data de lançamento da versão atual
1336
1357
  */
1337
- export declare const RELEASE_DATE = "2026-09-03";
1358
+ export declare const RELEASE_DATE = "2026-09-06";
1338
1359
 
1339
1360
  declare interface RequestChallengeWithSessionParams {
1340
1361
  applicationToken: string;
@@ -1446,6 +1467,7 @@ declare interface SDKConfig {
1446
1467
  theme: SDKTheme;
1447
1468
  locale: string;
1448
1469
  resolvedTheme: ResolvedTheme | null;
1470
+ consent: Consent;
1449
1471
  }
1450
1472
 
1451
1473
  /**
@@ -1497,6 +1519,11 @@ export declare interface SDKInitOptions {
1497
1519
  * Locale da UI. Padrão `pt-BR`.
1498
1520
  */
1499
1521
  locale?: string;
1522
+ /**
1523
+ * Dados de consentimento LGPD. Se omitido, o SDK usa defaults conservadores
1524
+ * e emite `console.warn` uma única vez.
1525
+ */
1526
+ consent?: Consent;
1500
1527
  }
1501
1528
 
1502
1529
  export declare type SDKRadius = 8 | 16 | 24;
@@ -1695,7 +1722,7 @@ export declare const validateToken: (applicationToken: string) => Promise<boolea
1695
1722
  * MINOR: Incrementado quando adicionamos funcionalidades mantendo compatibilidade
1696
1723
  * PATCH: Incrementado quando corrigimos bugs mantendo compatibilidade
1697
1724
  */
1698
- export declare const VERSION = "1.36.2";
1725
+ export declare const VERSION = "1.38.0";
1699
1726
 
1700
1727
  /**
1701
1728
  * Executa `fn(sessionId)`. Se o servidor devolver 410 (sessão consumida/expirada),
@@ -4534,6 +4534,12 @@ function injectScopedStyles(id, css) {
4534
4534
  document.head.appendChild(style);
4535
4535
  }
4536
4536
  const __vite_import_meta_env__ = {};
4537
+ const DEFAULT_CONSENT = {
4538
+ purpose: "authentication",
4539
+ legalBasis: "fraud_prevention",
4540
+ privacyPolicyUrl: "",
4541
+ retentionDays: 0
4542
+ };
4537
4543
  const ENVIRONMENT_URLS = {
4538
4544
  development: "http://localhost:8000",
4539
4545
  sandbox: "https://sandbox-core.neofaceid.com",
@@ -4554,12 +4560,25 @@ function makeDefaultConfig() {
4554
4560
  radius: DEFAULT_RADIUS,
4555
4561
  theme: DEFAULT_THEME,
4556
4562
  locale: DEFAULT_LOCALE,
4557
- resolvedTheme: null
4563
+ resolvedTheme: null,
4564
+ consent: { ...DEFAULT_CONSENT }
4558
4565
  };
4559
4566
  }
4560
4567
  let globalConfig = makeDefaultConfig();
4568
+ let consentWarningShown = false;
4561
4569
  function init(options = {}) {
4562
- const { environment, baseUrl, applicationToken, appName, accent, radius, theme, locale } = options;
4570
+ const { environment, baseUrl, applicationToken, appName, accent, radius, theme, locale, consent } = options;
4571
+ if (consent) {
4572
+ globalConfig.consent = consent;
4573
+ } else {
4574
+ globalConfig.consent = { ...DEFAULT_CONSENT };
4575
+ if (!consentWarningShown) {
4576
+ console.warn(
4577
+ "[NeoFaceID SDK] Consentimento não configurado em init(). Usando valores padrão (fraud_prevention). Configure consent: { purpose, legalBasis, privacyPolicyUrl, retentionDays }."
4578
+ );
4579
+ consentWarningShown = true;
4580
+ }
4581
+ }
4563
4582
  if (baseUrl) {
4564
4583
  globalConfig.baseUrl = baseUrl;
4565
4584
  globalConfig.environment = "custom";
@@ -4659,6 +4678,9 @@ function getResolvedThemeMode() {
4659
4678
  function getLocale() {
4660
4679
  return globalConfig.locale;
4661
4680
  }
4681
+ function getConsent() {
4682
+ return { ...globalConfig.consent };
4683
+ }
4662
4684
  const getApiBaseUrl = () => getBaseUrl();
4663
4685
  const REQUEST_TIMEOUT = 1e4;
4664
4686
  const ensureSecureContext = () => {
@@ -8808,9 +8830,9 @@ function ConsentModalComponent({
8808
8830
  border-top: 1px solid var(--nfid-line);
8809
8831
  }
8810
8832
  .neofaceid-consent-seal {
8811
- font-size: 11px;
8812
- font-weight: 700;
8813
- letter-spacing: 0.09em;
8833
+ font-size: 10px;
8834
+ font-weight: 500;
8835
+ letter-spacing: 0.06em;
8814
8836
  text-transform: uppercase;
8815
8837
  color: var(--nfid-text-subtle);
8816
8838
  }
@@ -9469,9 +9491,9 @@ class BiometricCaptureModal {
9469
9491
  border-top: 1px solid var(--nfid-line, #E6ECF4);
9470
9492
  }
9471
9493
  .neofaceid-seal {
9472
- font-size: 11px;
9473
- font-weight: 700;
9474
- letter-spacing: 0.09em;
9494
+ font-size: 10px;
9495
+ font-weight: 500;
9496
+ letter-spacing: 0.06em;
9475
9497
  text-transform: uppercase;
9476
9498
  color: var(--nfid-text-subtle, #617489);
9477
9499
  }
@@ -11177,8 +11199,8 @@ const biometricDetection = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.
11177
11199
  initializeBiometricDetection,
11178
11200
  isAdvancedDetectionAvailable
11179
11201
  }, Symbol.toStringTag, { value: "Module" }));
11180
- const VERSION = "1.36.2";
11181
- const RELEASE_DATE = "2026-09-03";
11202
+ const VERSION = "1.38.0";
11203
+ const RELEASE_DATE = "2026-09-06";
11182
11204
  let cachedSession = null;
11183
11205
  function getCachedCaptureSession() {
11184
11206
  return cachedSession;
@@ -11541,7 +11563,7 @@ class OnboardingCaptureModal {
11541
11563
  .neofaceid-root .neofaceid-capture-btn { background: var(--nfid-action); color: var(--nfid-action-text); border:none; border-radius:8px; padding:10px 18px; cursor:pointer; min-height: 44px; }
11542
11564
  .neofaceid-root .neofaceid-capture-btn:disabled { background: var(--nfid-line); cursor:not-allowed; }
11543
11565
  .neofaceid-root .neofaceid-seal-row { display:flex; justify-content:center; padding:12px 20px 14px; border-top: 1px solid var(--nfid-line); }
11544
- .neofaceid-root .neofaceid-seal { font-size:11px; font-weight:700; letter-spacing:0.09em; text-transform:uppercase; color: var(--nfid-text-subtle); }
11566
+ .neofaceid-root .neofaceid-seal { font-size:10px; font-weight:500; letter-spacing:0.06em; text-transform:uppercase; color: var(--nfid-text-subtle); }
11545
11567
  `
11546
11568
  );
11547
11569
  overlay.classList.add("neofaceid-root");
@@ -12871,13 +12893,13 @@ function AuthorizeModalComponent({
12871
12893
  .neofaceid-root .nfid-authorize-header { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }
12872
12894
  .neofaceid-root .nfid-authorize-appname { font-size: 15px; font-weight: 700; color: var(--nfid-text); line-height: 1.2; }
12873
12895
  .neofaceid-root .nfid-authorize-amount { font-size: 13px; color: var(--nfid-text-muted); }
12874
- .neofaceid-root .nfid-authorize-brand { font-size: 11px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--nfid-text-subtle); }
12896
+ .neofaceid-root .nfid-authorize-brand { font-size: 10px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--nfid-text-subtle); }
12875
12897
  .neofaceid-root .nfid-authorize-video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
12876
12898
  .neofaceid-root .nfid-authorize-instruction { margin: 20px 0 0; font-size: 17px; font-weight: 600; color: var(--nfid-text); text-align: center; line-height: 1.3; }
12877
12899
  .neofaceid-root .nfid-authorize-support { margin: 6px 0 0; font-size: 13px; color: var(--nfid-text-muted); text-align: center; }
12878
12900
  .neofaceid-root .nfid-authorize-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; align-items: center; }
12879
12901
  .neofaceid-root .nfid-authorize-footer { display: flex; justify-content: center; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--nfid-line); }
12880
- .neofaceid-root .nfid-authorize-seal { font-size: 11px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--nfid-text-subtle); }
12902
+ .neofaceid-root .nfid-authorize-seal { font-size: 10px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--nfid-text-subtle); }
12881
12903
  .neofaceid-root .nfid-authorize-close {
12882
12904
  position: absolute; top: 8px; right: 8px;
12883
12905
  min-width: 44px; min-height: 44px;
@@ -14291,6 +14313,7 @@ export {
14291
14313
  getBaseUrl,
14292
14314
  getCachedCaptureSession,
14293
14315
  getConfig,
14316
+ getConsent,
14294
14317
  getEnvironment,
14295
14318
  getLocale,
14296
14319
  getRadius,