@tesouro/embedded-components-react 0.2.266 → 0.2.269

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 (97) hide show
  1. package/README.md +15 -12
  2. package/dist/experimental/WidgetSuite.d.ts +25 -1
  3. package/dist/experimental/index.d.ts +25 -1
  4. package/dist/index.css +45 -9
  5. package/dist/index.d.ts +46 -22
  6. package/dist/index.js +1 -1
  7. package/dist/lib/AcceptDisclosuresWidget.d.ts +25 -1
  8. package/dist/lib/BalancesWidget.d.ts +24 -0
  9. package/dist/lib/BankAccountOnboardingWidget.d.ts +25 -1
  10. package/dist/lib/BankAccountsWidget.d.ts +25 -1
  11. package/dist/lib/BillPayWidget.d.ts +24 -0
  12. package/dist/lib/BillPayWidget.js +1 -1
  13. package/dist/lib/CardDetailsWidget.d.ts +25 -1
  14. package/dist/lib/CardsWidget.d.ts +25 -1
  15. package/dist/lib/ChartOfAccountsWidget.d.ts +25 -1
  16. package/dist/lib/CounterpartsWidget.d.ts +25 -1
  17. package/dist/lib/CreateCardWidget.d.ts +25 -1
  18. package/dist/lib/ExpenseApprovalPoliciesWidget.d.ts +25 -1
  19. package/dist/lib/ExpenseManagementWidget.d.ts +25 -1
  20. package/dist/lib/ExpenseRequirementsWidget.d.ts +25 -1
  21. package/dist/lib/HelpWidget.d.ts +25 -1
  22. package/dist/lib/InsightsWidget.d.ts +24 -0
  23. package/dist/lib/InvoicingWidget.d.ts +25 -1
  24. package/dist/lib/LinkedAccountsWidget.d.ts +25 -1
  25. package/dist/lib/ProductsWidget.d.ts +25 -1
  26. package/dist/lib/ProfileWidget.d.ts +25 -1
  27. package/dist/lib/ReceiptMatchWidget.d.ts +25 -1
  28. package/dist/lib/ReceivablesWidget.d.ts +25 -1
  29. package/dist/lib/SettingsWidget.d.ts +25 -1
  30. package/dist/lib/TagsWidget.d.ts +25 -1
  31. package/dist/lib/TeamWidget.d.ts +25 -1
  32. package/dist/lib/TransfersWidget.d.ts +24 -0
  33. package/dist/lib/WidgetProvider.d.ts +25 -1
  34. package/dist/lib/WidgetProviderPublic.d.ts +24 -0
  35. package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/index4.js +9 -8
  36. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index17.js +122 -121
  37. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index8.js +9 -8
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +6 -6
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +99 -7
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index11.js +7 -97
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +99 -4
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index13.js +4 -4
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +2 -41
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +44 -1
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js +1 -50
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +48 -6
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +9 -5
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +8 -91
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index2.js +6 -2
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +7 -3
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +100 -6
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +3 -9
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +6 -83
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +9 -3
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +83 -6
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +2 -111
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +8 -1
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +104 -16
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +1 -0
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +25 -0
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +37 -27
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +15 -116
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index8.js +126 -31
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +32 -69
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index12.js +0 -3
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index13.js +34 -69
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index15.js +4 -0
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js +261 -181
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index28.js +32 -33
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index7.js +2 -2
  71. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index6.js +9 -8
  72. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index8.js +9 -8
  73. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index8.js +9 -8
  74. package/dist/libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index7.js +94 -93
  75. package/dist/libs/tesouro-embedded-components-react/expense-approval-policies-widget/feature/dist/lib/ExpenseApprovalPoliciesWidgetFeature.js +7 -6
  76. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index3.js +9 -8
  77. package/dist/libs/tesouro-embedded-components-react/expense-receipt-match-widget/feature/dist/lib/ReceiptMatchWidget.js +12 -11
  78. package/dist/libs/tesouro-embedded-components-react/expense-requirements-widget/feature/dist/lib/ExpenseRequirementsWidget.js +7 -6
  79. package/dist/libs/tesouro-embedded-components-react/gl-code-table-widget/feature/dist/index8.js +9 -8
  80. package/dist/libs/tesouro-embedded-components-react/help-widget/feature/dist/index3.js +9 -8
  81. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index12.js +9 -8
  82. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index3.js +10 -9
  83. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/index9.js +9 -8
  84. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/index8.js +9 -8
  85. package/dist/libs/tesouro-embedded-components-react/profile-widget/feature/dist/index4.js +9 -8
  86. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index6.js +10 -9
  87. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +22 -21
  88. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/widgetGatewayHosts.js +14 -0
  89. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/RootWidgetProvider.js +76 -67
  90. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js +107 -101
  91. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  92. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/client.js +12 -4
  93. package/dist/libs/tesouro-embedded-components-react/tags-widget/feature/dist/index11.js +9 -8
  94. package/dist/libs/tesouro-embedded-components-react/team-widget/feature/dist/index17.js +106 -105
  95. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index5.js +1 -1
  96. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index6.js +9 -8
  97. package/package.json +1 -1
@@ -477,6 +477,30 @@ interface WidgetConfigInput {
477
477
  * ```
478
478
  */
479
479
  configClient?: (client: EmbeddedClient) => EmbeddedClient;
480
+ /**
481
+ * Overrides the widget-gateway routing decision for the scoped HTTP client.
482
+ *
483
+ * Any caller reaching the Tesouro API with a widget token must route data
484
+ * requests through the widget gateway: prefix the path with
485
+ * `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
486
+ * provider applies both automatically per request when the request origin is
487
+ * a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
488
+ * generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
489
+ * init round-trip) always pass through untouched.
490
+ *
491
+ * - `undefined` — decide from the request origin, as above. Inherits from
492
+ * the nearest ancestor or global store like every other config field.
493
+ * - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
494
+ * custom domain in front of the gateway).
495
+ * - `false` — never apply it. For hosts that route widget requests their own
496
+ * way, such as a same-origin BFF whose `configClient` retargets every
497
+ * request.
498
+ *
499
+ * Independent of {@link configClient}: a host that only adds a header keeps
500
+ * the built-in routing, and the built-in interceptor runs before any
501
+ * `configClient` interceptor.
502
+ */
503
+ gatewayRouting?: boolean;
480
504
  /**
481
505
  * Component the embedded widgets should render in place of plain `<a>` tags.
482
506
  *
@@ -573,7 +597,7 @@ type ReceiptMatchWidgetProps = WidgetProviderProps & {
573
597
  targetTransactionId?: string;
574
598
  onSingleTransactionUpdate?: () => void;
575
599
  };
576
- declare function ReceiptMatchWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, isOpen, preSelectedReceiptIds, onClose, targetTransactionId, onSingleTransactionUpdate, }: ReceiptMatchWidgetProps): React.JSX.Element;
600
+ declare function ReceiptMatchWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, isOpen, preSelectedReceiptIds, onClose, targetTransactionId, onSingleTransactionUpdate, }: ReceiptMatchWidgetProps): React.JSX.Element;
577
601
 
578
602
  export { ReceiptMatchWidget };
579
603
  export type { ReceiptMatchWidgetProps };
@@ -484,6 +484,30 @@ interface WidgetConfigInput {
484
484
  * ```
485
485
  */
486
486
  configClient?: (client: EmbeddedClient) => EmbeddedClient;
487
+ /**
488
+ * Overrides the widget-gateway routing decision for the scoped HTTP client.
489
+ *
490
+ * Any caller reaching the Tesouro API with a widget token must route data
491
+ * requests through the widget gateway: prefix the path with
492
+ * `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
493
+ * provider applies both automatically per request when the request origin is
494
+ * a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
495
+ * generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
496
+ * init round-trip) always pass through untouched.
497
+ *
498
+ * - `undefined` — decide from the request origin, as above. Inherits from
499
+ * the nearest ancestor or global store like every other config field.
500
+ * - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
501
+ * custom domain in front of the gateway).
502
+ * - `false` — never apply it. For hosts that route widget requests their own
503
+ * way, such as a same-origin BFF whose `configClient` retargets every
504
+ * request.
505
+ *
506
+ * Independent of {@link configClient}: a host that only adds a header keeps
507
+ * the built-in routing, and the built-in interceptor runs before any
508
+ * `configClient` interceptor.
509
+ */
510
+ gatewayRouting?: boolean;
487
511
  /**
488
512
  * Component the embedded widgets should render in place of plain `<a>` tags.
489
513
  *
@@ -979,7 +1003,7 @@ interface ReceivablesWidgetOwnProps {
979
1003
  }
980
1004
  type ReceivablesWidgetProps = WidgetProviderProps & ReceivablesWidgetOwnProps;
981
1005
 
982
- declare function ReceivablesWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: ReceivablesWidgetProps): React.JSX.Element;
1006
+ declare function ReceivablesWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: ReceivablesWidgetProps): React.JSX.Element;
983
1007
 
984
1008
  export { ReceivablesWidget };
985
1009
  export type { CounterpartFormSheetLabels, CounterpartMessageLabels, MeasureUnitDeleteDialogLabels, MeasureUnitsManagerLabels, ProductFormSheetLabels, ProductMessageLabels, ReceivableActionDialogLabels, ReceivableDetailsSheetLabelOverrides, ReceivableDetailsSheetLabels, ReceivableDocumentType, ReceivableFormSheetLabels, ReceivableMessageLabels, ReceivablePaymentDialogLabels, ReceivableSendDialogLabels, ReceivableStatusBadgeLabels, ReceivablesScreenLabelOverrides, ReceivablesScreenLabels, ReceivablesWidgetProps, ReceivablesWidgetTab };
@@ -496,6 +496,30 @@ interface WidgetConfigInput {
496
496
  * ```
497
497
  */
498
498
  configClient?: (client: EmbeddedClient) => EmbeddedClient;
499
+ /**
500
+ * Overrides the widget-gateway routing decision for the scoped HTTP client.
501
+ *
502
+ * Any caller reaching the Tesouro API with a widget token must route data
503
+ * requests through the widget gateway: prefix the path with
504
+ * `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
505
+ * provider applies both automatically per request when the request origin is
506
+ * a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
507
+ * generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
508
+ * init round-trip) always pass through untouched.
509
+ *
510
+ * - `undefined` — decide from the request origin, as above. Inherits from
511
+ * the nearest ancestor or global store like every other config field.
512
+ * - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
513
+ * custom domain in front of the gateway).
514
+ * - `false` — never apply it. For hosts that route widget requests their own
515
+ * way, such as a same-origin BFF whose `configClient` retargets every
516
+ * request.
517
+ *
518
+ * Independent of {@link configClient}: a host that only adds a header keeps
519
+ * the built-in routing, and the built-in interceptor runs before any
520
+ * `configClient` interceptor.
521
+ */
522
+ gatewayRouting?: boolean;
499
523
  /**
500
524
  * Component the embedded widgets should render in place of plain `<a>` tags.
501
525
  *
@@ -680,7 +704,7 @@ interface SettingsWidgetProps extends MoniteRegionProviderProps {
680
704
  tagsContent?: ReactNode;
681
705
  invoiceContent?: ReactNode;
682
706
  }
683
- declare function SettingsWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, finopsThemeColors, analytics, ...innerProps }: SettingsWidgetProps): React.JSX.Element;
707
+ declare function SettingsWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, finopsThemeColors, analytics, ...innerProps }: SettingsWidgetProps): React.JSX.Element;
684
708
 
685
709
  export { SettingsSection, SettingsWidget };
686
710
  export type { SettingsWidgetAdditionalSection, FeatureLabels as SettingsWidgetFeatureLabels, Labels as SettingsWidgetLabels, SettingsWidgetProps, SettingsWidgetSection, SettingsWidgetSectionId };
@@ -477,6 +477,30 @@ interface WidgetConfigInput {
477
477
  * ```
478
478
  */
479
479
  configClient?: (client: EmbeddedClient) => EmbeddedClient;
480
+ /**
481
+ * Overrides the widget-gateway routing decision for the scoped HTTP client.
482
+ *
483
+ * Any caller reaching the Tesouro API with a widget token must route data
484
+ * requests through the widget gateway: prefix the path with
485
+ * `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
486
+ * provider applies both automatically per request when the request origin is
487
+ * a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
488
+ * generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
489
+ * init round-trip) always pass through untouched.
490
+ *
491
+ * - `undefined` — decide from the request origin, as above. Inherits from
492
+ * the nearest ancestor or global store like every other config field.
493
+ * - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
494
+ * custom domain in front of the gateway).
495
+ * - `false` — never apply it. For hosts that route widget requests their own
496
+ * way, such as a same-origin BFF whose `configClient` retargets every
497
+ * request.
498
+ *
499
+ * Independent of {@link configClient}: a host that only adds a header keeps
500
+ * the built-in routing, and the built-in interceptor runs before any
501
+ * `configClient` interceptor.
502
+ */
503
+ gatewayRouting?: boolean;
480
504
  /**
481
505
  * Component the embedded widgets should render in place of plain `<a>` tags.
482
506
  *
@@ -653,7 +677,7 @@ type TagsWidgetProps = WidgetProviderProps & TagsWidgetOwnProps;
653
677
  * <TagsWidget baseUrl="https://api.tesouro.com" widgetToken="wt_..." organizationId="org_..." />
654
678
  * ```
655
679
  */
656
- declare function TagsWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: TagsWidgetProps): React.JSX.Element;
680
+ declare function TagsWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: TagsWidgetProps): React.JSX.Element;
657
681
 
658
682
  export { TagsWidget };
659
683
  export type { TagDeleteDialogLabels, TagFormSheetLabels, TagMessageLabels, TagsScreenLabels, TagsWidgetProps };
@@ -477,6 +477,30 @@ interface WidgetConfigInput {
477
477
  * ```
478
478
  */
479
479
  configClient?: (client: EmbeddedClient) => EmbeddedClient;
480
+ /**
481
+ * Overrides the widget-gateway routing decision for the scoped HTTP client.
482
+ *
483
+ * Any caller reaching the Tesouro API with a widget token must route data
484
+ * requests through the widget gateway: prefix the path with
485
+ * `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
486
+ * provider applies both automatically per request when the request origin is
487
+ * a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
488
+ * generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
489
+ * init round-trip) always pass through untouched.
490
+ *
491
+ * - `undefined` — decide from the request origin, as above. Inherits from
492
+ * the nearest ancestor or global store like every other config field.
493
+ * - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
494
+ * custom domain in front of the gateway).
495
+ * - `false` — never apply it. For hosts that route widget requests their own
496
+ * way, such as a same-origin BFF whose `configClient` retargets every
497
+ * request.
498
+ *
499
+ * Independent of {@link configClient}: a host that only adds a header keeps
500
+ * the built-in routing, and the built-in interceptor runs before any
501
+ * `configClient` interceptor.
502
+ */
503
+ gatewayRouting?: boolean;
480
504
  /**
481
505
  * Component the embedded widgets should render in place of plain `<a>` tags.
482
506
  *
@@ -814,7 +838,7 @@ interface TeamWidgetProps extends WidgetProviderProps {
814
838
  */
815
839
  acceptInviteRedirectUri?: string;
816
840
  }
817
- declare function TeamWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: TeamWidgetProps): React.JSX.Element;
841
+ declare function TeamWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: TeamWidgetProps): React.JSX.Element;
818
842
 
819
843
  export { TeamWidget };
820
844
  export type { FeatureLabels as TeamWidgetFeatureLabels, Labels as TeamWidgetLabels, TeamWidgetProps };
@@ -477,6 +477,30 @@ interface WidgetConfigInput {
477
477
  * ```
478
478
  */
479
479
  configClient?: (client: EmbeddedClient) => EmbeddedClient;
480
+ /**
481
+ * Overrides the widget-gateway routing decision for the scoped HTTP client.
482
+ *
483
+ * Any caller reaching the Tesouro API with a widget token must route data
484
+ * requests through the widget gateway: prefix the path with
485
+ * `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
486
+ * provider applies both automatically per request when the request origin is
487
+ * a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
488
+ * generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
489
+ * init round-trip) always pass through untouched.
490
+ *
491
+ * - `undefined` — decide from the request origin, as above. Inherits from
492
+ * the nearest ancestor or global store like every other config field.
493
+ * - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
494
+ * custom domain in front of the gateway).
495
+ * - `false` — never apply it. For hosts that route widget requests their own
496
+ * way, such as a same-origin BFF whose `configClient` retargets every
497
+ * request.
498
+ *
499
+ * Independent of {@link configClient}: a host that only adds a header keeps
500
+ * the built-in routing, and the built-in interceptor runs before any
501
+ * `configClient` interceptor.
502
+ */
503
+ gatewayRouting?: boolean;
480
504
  /**
481
505
  * Component the embedded widgets should render in place of plain `<a>` tags.
482
506
  *
@@ -561,6 +561,30 @@ interface WidgetConfigInput {
561
561
  * ```
562
562
  */
563
563
  configClient?: (client: EmbeddedClient) => EmbeddedClient;
564
+ /**
565
+ * Overrides the widget-gateway routing decision for the scoped HTTP client.
566
+ *
567
+ * Any caller reaching the Tesouro API with a widget token must route data
568
+ * requests through the widget gateway: prefix the path with
569
+ * `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
570
+ * provider applies both automatically per request when the request origin is
571
+ * a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
572
+ * generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
573
+ * init round-trip) always pass through untouched.
574
+ *
575
+ * - `undefined` — decide from the request origin, as above. Inherits from
576
+ * the nearest ancestor or global store like every other config field.
577
+ * - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
578
+ * custom domain in front of the gateway).
579
+ * - `false` — never apply it. For hosts that route widget requests their own
580
+ * way, such as a same-origin BFF whose `configClient` retargets every
581
+ * request.
582
+ *
583
+ * Independent of {@link configClient}: a host that only adds a header keeps
584
+ * the built-in routing, and the built-in interceptor runs before any
585
+ * `configClient` interceptor.
586
+ */
587
+ gatewayRouting?: boolean;
564
588
  /**
565
589
  * Component the embedded widgets should render in place of plain `<a>` tags.
566
590
  *
@@ -914,7 +938,7 @@ interface RootWidgetProviderProps extends WidgetProviderBaseProps {
914
938
  * @see {@link useWidgetConfig} to read the resolved config in descendants
915
939
  * @see {@link setGlobalWidgetConfig} to push config imperatively from outside React
916
940
  */
917
- declare function RootWidgetProvider({ children, baseUrl, widgetToken, organizationId, configClient, linkComponent, uiFramework, implementation, analytics, unstable_initResponseOverride, }: PropsWithChildren<RootWidgetProviderProps>): React.JSX.Element;
941
+ declare function RootWidgetProvider({ children, baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, uiFramework, implementation, analytics, unstable_initResponseOverride, }: PropsWithChildren<RootWidgetProviderProps>): React.JSX.Element;
918
942
 
919
943
  /**
920
944
  * Props for {@link WidgetProvider}.
@@ -476,6 +476,30 @@ interface WidgetConfigInput {
476
476
  * ```
477
477
  */
478
478
  configClient?: (client: EmbeddedClient) => EmbeddedClient;
479
+ /**
480
+ * Overrides the widget-gateway routing decision for the scoped HTTP client.
481
+ *
482
+ * Any caller reaching the Tesouro API with a widget token must route data
483
+ * requests through the widget gateway: prefix the path with
484
+ * `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
485
+ * provider applies both automatically per request when the request origin is
486
+ * a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
487
+ * generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
488
+ * init round-trip) always pass through untouched.
489
+ *
490
+ * - `undefined` — decide from the request origin, as above. Inherits from
491
+ * the nearest ancestor or global store like every other config field.
492
+ * - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
493
+ * custom domain in front of the gateway).
494
+ * - `false` — never apply it. For hosts that route widget requests their own
495
+ * way, such as a same-origin BFF whose `configClient` retargets every
496
+ * request.
497
+ *
498
+ * Independent of {@link configClient}: a host that only adds a header keeps
499
+ * the built-in routing, and the built-in interceptor runs before any
500
+ * `configClient` interceptor.
501
+ */
502
+ gatewayRouting?: boolean;
479
503
  /**
480
504
  * Component the embedded widgets should render in place of plain `<a>` tags.
481
505
  *
@@ -113,20 +113,21 @@ function S({ invitationToken: e, userId: t, labelOverrides: n, content: i, label
113
113
  errorMessage: p
114
114
  });
115
115
  }
116
- function C({ baseUrl: e, widgetToken: n, organizationId: r, configClient: i, linkComponent: a, implementation: o, uiFramework: c, errorFallback: l, onError: u, analytics: d, ...f }) {
116
+ function C({ baseUrl: e, widgetToken: n, organizationId: r, configClient: i, gatewayRouting: a, linkComponent: o, implementation: c, uiFramework: l, errorFallback: u, onError: d, analytics: f, ...p }) {
117
117
  return /* @__PURE__ */ _(s, {
118
118
  widgetName: t,
119
119
  baseUrl: e,
120
120
  widgetToken: n,
121
121
  organizationId: r,
122
122
  configClient: i,
123
- linkComponent: a,
124
- implementation: o,
125
- uiFramework: c,
126
- errorFallback: l,
127
- onError: u,
128
- analytics: d,
129
- children: /* @__PURE__ */ _(x, { ...f })
123
+ gatewayRouting: a,
124
+ linkComponent: o,
125
+ implementation: c,
126
+ uiFramework: l,
127
+ errorFallback: u,
128
+ onError: d,
129
+ analytics: f,
130
+ children: /* @__PURE__ */ _(x, { ...p })
130
131
  });
131
132
  }
132
133
  //#endregion