@tesouro/embedded-components-react 0.2.267 → 0.2.270

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 (66) 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 +3 -0
  5. package/dist/index.d.ts +46 -22
  6. package/dist/lib/AcceptDisclosuresWidget.d.ts +25 -1
  7. package/dist/lib/BalancesWidget.d.ts +24 -0
  8. package/dist/lib/BankAccountOnboardingWidget.d.ts +25 -1
  9. package/dist/lib/BankAccountsWidget.d.ts +25 -1
  10. package/dist/lib/BillPayWidget.d.ts +24 -0
  11. package/dist/lib/CardDetailsWidget.d.ts +25 -1
  12. package/dist/lib/CardsWidget.d.ts +25 -1
  13. package/dist/lib/ChartOfAccountsWidget.d.ts +25 -1
  14. package/dist/lib/CounterpartsWidget.d.ts +25 -1
  15. package/dist/lib/CreateCardWidget.d.ts +25 -1
  16. package/dist/lib/ExpenseApprovalPoliciesWidget.d.ts +25 -1
  17. package/dist/lib/ExpenseManagementWidget.d.ts +25 -1
  18. package/dist/lib/ExpenseRequirementsWidget.d.ts +25 -1
  19. package/dist/lib/HelpWidget.d.ts +25 -1
  20. package/dist/lib/InsightsWidget.d.ts +24 -0
  21. package/dist/lib/InvoicingWidget.d.ts +25 -1
  22. package/dist/lib/LinkedAccountsWidget.d.ts +25 -1
  23. package/dist/lib/ProductsWidget.d.ts +25 -1
  24. package/dist/lib/ProfileWidget.d.ts +25 -1
  25. package/dist/lib/ReceiptMatchWidget.d.ts +25 -1
  26. package/dist/lib/ReceivablesWidget.d.ts +25 -1
  27. package/dist/lib/SettingsWidget.d.ts +25 -1
  28. package/dist/lib/TagsWidget.d.ts +25 -1
  29. package/dist/lib/TeamWidget.d.ts +25 -1
  30. package/dist/lib/TransfersWidget.d.ts +24 -0
  31. package/dist/lib/WidgetProvider.d.ts +25 -1
  32. package/dist/lib/WidgetProviderPublic.d.ts +24 -0
  33. package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/index4.js +9 -8
  34. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index17.js +122 -121
  35. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index8.js +9 -8
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +11 -10
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +9 -8
  38. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index6.js +9 -8
  39. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index7.js +1 -1
  40. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index8.js +9 -8
  41. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsList.js +1 -1
  42. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsListDetailsSheet.js +1 -1
  43. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index8.js +9 -8
  44. package/dist/libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index7.js +94 -93
  45. package/dist/libs/tesouro-embedded-components-react/expense-approval-policies-widget/feature/dist/lib/ExpenseApprovalPoliciesWidgetFeature.js +7 -6
  46. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index3.js +9 -8
  47. package/dist/libs/tesouro-embedded-components-react/expense-receipt-match-widget/feature/dist/lib/ReceiptMatchWidget.js +12 -11
  48. package/dist/libs/tesouro-embedded-components-react/expense-requirements-widget/feature/dist/lib/ExpenseRequirementsWidget.js +7 -6
  49. package/dist/libs/tesouro-embedded-components-react/gl-code-table-widget/feature/dist/index8.js +9 -8
  50. package/dist/libs/tesouro-embedded-components-react/help-widget/feature/dist/index3.js +9 -8
  51. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index12.js +9 -8
  52. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index3.js +10 -9
  53. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/index9.js +9 -8
  54. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/index8.js +9 -8
  55. package/dist/libs/tesouro-embedded-components-react/profile-widget/feature/dist/index4.js +9 -8
  56. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index6.js +10 -9
  57. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +22 -21
  58. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/widgetGatewayHosts.js +14 -0
  59. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/RootWidgetProvider.js +76 -67
  60. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js +107 -101
  61. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  62. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/client.js +12 -4
  63. package/dist/libs/tesouro-embedded-components-react/tags-widget/feature/dist/index11.js +9 -8
  64. package/dist/libs/tesouro-embedded-components-react/team-widget/feature/dist/index17.js +106 -105
  65. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index6.js +9 -8
  66. package/package.json +1 -1
package/README.md CHANGED
@@ -107,18 +107,19 @@ App-level provider. Resolves `baseUrl` / `widgetToken` / `organizationId` (falli
107
107
 
108
108
  #### Props
109
109
 
110
- | Prop | Type | Description |
111
- | ------------------------------- | -------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
112
- | `baseUrl` | `string` | Base URL of the Tesouro embedded API (e.g. `"https://api.tesouro.com"`). Falls back to `global.baseUrl` when omitted. |
113
- | `widgetToken` | `string \| null` | Bearer token for widget auth. Falls back to `global.widgetToken` when omitted. Pass `null` to suppress auth. |
114
- | `organizationId` | `string \| null` | Org ID forwarded to data-access hooks. Falls back to `global.organizationId` when omitted; if still unset, defaults to `initResponse.organizationId` once the fetch resolves. Pass `null` to clear org scoping (never falls back). |
115
- | `configClient` | `(client: EmbeddedClient) => EmbeddedClient` | Optional post-creation hook for the HTTP client. Called after the built-in auth interceptor. Falls back to `global.configClient`. |
116
- | `linkComponent` | `LinkComponent` | Host link component widgets use to render navigational links. Falls back to `global.linkComponent`. |
117
- | `uiFramework` | `'shadcn' \| 'tecton' \| null` | UI framework the widget UI layer renders with for this tree. Falls back to `global.uiFramework`, then to `'shadcn'`. See UI framework selection. |
118
- | `implementation` | `'native' \| 'monite' \| null` | Which implementation the widgets render with for this tree. Falls back to `global.implementation`, then to `'native'`. See Implementation selection. |
119
- | `analytics` | `boolean` | Enables anonymous analytics for this provider tree (default `true`). `RootWidgetProvider` is the analytics owner; set `false` to disable capture and skip loading PostHog. |
120
- | `unstable_initResponseOverride` | `WidgetInitResponse` | First-party hosts only. Skips the `GET /api/widget-gateway/init` fetch and exposes this host-authored object as `initResponse` to the subtree. Use when the host authenticates users directly against the Tesouro issuer and passes the user's bearer access token as `widgetToken`. Embed integrations minting widget JWEs must leave this unset. |
121
- | `children` | `ReactNode` | The React subtree that consumes the widget context. |
110
+ | Prop | Type | Description |
111
+ | ------------------------------- | -------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
112
+ | `baseUrl` | `string` | Base URL of the Tesouro embedded API (e.g. `"https://api.tesouro.com"`). Falls back to `global.baseUrl` when omitted. |
113
+ | `widgetToken` | `string \| null` | Bearer token for widget auth. Falls back to `global.widgetToken` when omitted. Pass `null` to suppress auth. |
114
+ | `organizationId` | `string \| null` | Org ID forwarded to data-access hooks. Falls back to `global.organizationId` when omitted; if still unset, defaults to `initResponse.organizationId` once the fetch resolves. Pass `null` to clear org scoping (never falls back). |
115
+ | `configClient` | `(client: EmbeddedClient) => EmbeddedClient` | Optional post-creation hook for the HTTP client. Called after the built-in auth and gateway-routing interceptors. Falls back to `global.configClient`. |
116
+ | `gatewayRouting` | `boolean` | Overrides widget-gateway routing (the `/api/widget-gateway/proxy` path prefix plus the `X-Widget-Token` header). Unset, routing applies per request when the request origin is a known Tesouro API host; `true` forces it on (e.g. a custom domain in front of the gateway), `false` forces it off (a host that routes its own requests). Falls back to `global.gatewayRouting`. |
117
+ | `linkComponent` | `LinkComponent` | Host link component widgets use to render navigational links. Falls back to `global.linkComponent`. |
118
+ | `uiFramework` | `'shadcn' \| 'tecton' \| null` | UI framework the widget UI layer renders with for this tree. Falls back to `global.uiFramework`, then to `'shadcn'`. See UI framework selection. |
119
+ | `implementation` | `'native' \| 'monite' \| null` | Which implementation the widgets render with for this tree. Falls back to `global.implementation`, then to `'native'`. See Implementation selection. |
120
+ | `analytics` | `boolean` | Enables anonymous analytics for this provider tree (default `true`). `RootWidgetProvider` is the analytics owner; set `false` to disable capture and skip loading PostHog. |
121
+ | `unstable_initResponseOverride` | `WidgetInitResponse` | First-party hosts only. Skips the `GET /api/widget-gateway/init` fetch and exposes this host-authored object as `initResponse` to the subtree. Use when the host authenticates users directly against the Tesouro issuer and passes the user's bearer access token as `widgetToken`. Embed integrations minting widget JWEs must leave this unset. |
122
+ | `children` | `ReactNode` | The React subtree that consumes the widget context. |
122
123
 
123
124
  ### `WidgetProvider`
124
125
 
@@ -132,6 +133,7 @@ Mid-tree or standalone provider. With no props it is a transparent pass-through
132
133
  | `widgetToken` | `string \| null` | Override the widget token for this subtree. Triggers a new `/api/widget-gateway/init` fetch. Pass `null` to suppress auth at this level. When omitted, inherits from parent. |
133
134
  | `organizationId` | `string \| null` | Override the org ID for this subtree. Does **not** trigger a re-fetch on its own. When omitted, inherits from parent; if unset through the whole cascade, defaults to this level's `initResponse.organizationId` (an ancestor's explicit org wins over it). Pass `null` to explicitly clear org scoping (never falls back). |
134
135
  | `configClient` | `(client: EmbeddedClient) => EmbeddedClient` | Optional post-creation hook for the scoped HTTP client. Only called when this provider creates its own client (i.e. not in pass-through mode). When omitted, inherits from parent. |
136
+ | `gatewayRouting` | `boolean` | Overrides widget-gateway routing (the `/api/widget-gateway/proxy` path prefix plus the `X-Widget-Token` header) for this subtree's scoped client. Unset, routing applies per request when the request origin is a known Tesouro API host; `true` forces it on, `false` forces it off. When omitted, inherits from parent. |
135
137
  | `linkComponent` | `LinkComponent` | Override the host link component for this subtree. When omitted, inherits from parent. |
136
138
  | `uiFramework` | `'shadcn' \| 'tecton' \| null` | Override the UI framework for this subtree. When omitted (or `null`), inherits the nearest ancestor's selection, defaulting to `'shadcn'`. See UI framework selection. |
137
139
  | `implementation` | `'native' \| 'monite' \| null` | Override the implementation for this subtree. When omitted (or `null`), inherits the nearest ancestor's selection, defaulting to `'native'`. See Implementation selection. |
@@ -164,6 +166,7 @@ Bundles `WidgetTokenRefreshProvider` + `RootWidgetProvider` and wires the live t
164
166
  | `baseUrl` | `RootWidgetProvider` | Falls back to the global store when omitted. |
165
167
  | `organizationId` | `RootWidgetProvider` | Pass `null` to clear the org scope; falls back to the global store when omitted. |
166
168
  | `configClient` | `RootWidgetProvider` | Optional post-creation hook for the scoped HTTP client. |
169
+ | `gatewayRouting` | `RootWidgetProvider` | Overrides widget-gateway routing; unset, it applies per request when the request origin is a known Tesouro API host. |
167
170
  | `linkComponent` | `RootWidgetProvider` | Component used in place of plain `<a>` tags inside widgets. |
168
171
  | `uiFramework` | `RootWidgetProvider` | `'shadcn'` (default) or `'tecton'`; inherits down the provider cascade. |
169
172
  | `implementation` | `RootWidgetProvider` | `'native'` (default) or `'monite'`; inherits down the provider cascade. |
@@ -506,6 +506,30 @@ interface WidgetConfigInput {
506
506
  * ```
507
507
  */
508
508
  configClient?: (client: EmbeddedClient) => EmbeddedClient;
509
+ /**
510
+ * Overrides the widget-gateway routing decision for the scoped HTTP client.
511
+ *
512
+ * Any caller reaching the Tesouro API with a widget token must route data
513
+ * requests through the widget gateway: prefix the path with
514
+ * `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
515
+ * provider applies both automatically per request when the request origin is
516
+ * a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
517
+ * generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
518
+ * init round-trip) always pass through untouched.
519
+ *
520
+ * - `undefined` — decide from the request origin, as above. Inherits from
521
+ * the nearest ancestor or global store like every other config field.
522
+ * - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
523
+ * custom domain in front of the gateway).
524
+ * - `false` — never apply it. For hosts that route widget requests their own
525
+ * way, such as a same-origin BFF whose `configClient` retargets every
526
+ * request.
527
+ *
528
+ * Independent of {@link configClient}: a host that only adds a header keeps
529
+ * the built-in routing, and the built-in interceptor runs before any
530
+ * `configClient` interceptor.
531
+ */
532
+ gatewayRouting?: boolean;
509
533
  /**
510
534
  * Component the embedded widgets should render in place of plain `<a>` tags.
511
535
  *
@@ -817,7 +841,7 @@ interface WidgetSuiteProps extends WidgetProviderProps {
817
841
  * deep-linking, and is deliberately not invented on an experimental export
818
842
  * before a host asks for it.
819
843
  */
820
- declare function WidgetSuite({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: WidgetSuiteProps): React.JSX.Element;
844
+ declare function WidgetSuite({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: WidgetSuiteProps): React.JSX.Element;
821
845
 
822
846
  export { WIDGET_SUITE_CONTENT_LABELS_EN, WIDGET_SUITE_DEFAULT_SECTIONS, WIDGET_SUITE_DISCLOSURE_LABELS_EN, WIDGET_SUITE_SECTION_LABELS_EN, WIDGET_SUITE_SECTION_TITLE_LABELS_EN, WIDGET_SUITE_SHELL_LABELS_EN, WidgetSuite, WidgetSuiteSectionId };
823
847
  export type { AcceptDisclosuresLinks, PartialDeep, WidgetSuiteContentLabels, WidgetSuiteDisclosureLabels, WidgetSuiteProps, WidgetSuiteSectionLabels, WidgetSuiteSectionTitleLabels, WidgetSuiteShellLabels };
@@ -506,6 +506,30 @@ interface WidgetConfigInput {
506
506
  * ```
507
507
  */
508
508
  configClient?: (client: EmbeddedClient) => EmbeddedClient;
509
+ /**
510
+ * Overrides the widget-gateway routing decision for the scoped HTTP client.
511
+ *
512
+ * Any caller reaching the Tesouro API with a widget token must route data
513
+ * requests through the widget gateway: prefix the path with
514
+ * `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
515
+ * provider applies both automatically per request when the request origin is
516
+ * a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
517
+ * generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
518
+ * init round-trip) always pass through untouched.
519
+ *
520
+ * - `undefined` — decide from the request origin, as above. Inherits from
521
+ * the nearest ancestor or global store like every other config field.
522
+ * - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
523
+ * custom domain in front of the gateway).
524
+ * - `false` — never apply it. For hosts that route widget requests their own
525
+ * way, such as a same-origin BFF whose `configClient` retargets every
526
+ * request.
527
+ *
528
+ * Independent of {@link configClient}: a host that only adds a header keeps
529
+ * the built-in routing, and the built-in interceptor runs before any
530
+ * `configClient` interceptor.
531
+ */
532
+ gatewayRouting?: boolean;
509
533
  /**
510
534
  * Component the embedded widgets should render in place of plain `<a>` tags.
511
535
  *
@@ -817,7 +841,7 @@ interface WidgetSuiteProps extends WidgetProviderProps {
817
841
  * deep-linking, and is deliberately not invented on an experimental export
818
842
  * before a host asks for it.
819
843
  */
820
- declare function WidgetSuite({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: WidgetSuiteProps): React.JSX.Element;
844
+ declare function WidgetSuite({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: WidgetSuiteProps): React.JSX.Element;
821
845
 
822
846
  export { WIDGET_SUITE_CONTENT_LABELS_EN, WIDGET_SUITE_DEFAULT_SECTIONS, WIDGET_SUITE_DISCLOSURE_LABELS_EN, WIDGET_SUITE_SECTION_LABELS_EN, WIDGET_SUITE_SECTION_TITLE_LABELS_EN, WIDGET_SUITE_SHELL_LABELS_EN, WidgetSuite, WidgetSuiteSectionId };
823
847
  export type { AcceptDisclosuresLinks, PartialDeep, WidgetSuiteContentLabels, WidgetSuiteDisclosureLabels, WidgetSuiteProps, WidgetSuiteSectionLabels, WidgetSuiteSectionTitleLabels, WidgetSuiteShellLabels };
package/dist/index.css CHANGED
@@ -1715,6 +1715,9 @@
1715
1715
  .ttw\:justify-items-start {
1716
1716
  justify-items: start;
1717
1717
  }
1718
+ .ttw\:\!gap-0 {
1719
+ gap: 0px !important;
1720
+ }
1718
1721
  .ttw\:gap-0 {
1719
1722
  gap: 0px;
1720
1723
  }
package/dist/index.d.ts CHANGED
@@ -622,6 +622,30 @@ interface WidgetConfigInput {
622
622
  * ```
623
623
  */
624
624
  configClient?: (client: EmbeddedClient) => EmbeddedClient;
625
+ /**
626
+ * Overrides the widget-gateway routing decision for the scoped HTTP client.
627
+ *
628
+ * Any caller reaching the Tesouro API with a widget token must route data
629
+ * requests through the widget gateway: prefix the path with
630
+ * `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
631
+ * provider applies both automatically per request when the request origin is
632
+ * a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
633
+ * generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
634
+ * init round-trip) always pass through untouched.
635
+ *
636
+ * - `undefined` — decide from the request origin, as above. Inherits from
637
+ * the nearest ancestor or global store like every other config field.
638
+ * - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
639
+ * custom domain in front of the gateway).
640
+ * - `false` — never apply it. For hosts that route widget requests their own
641
+ * way, such as a same-origin BFF whose `configClient` retargets every
642
+ * request.
643
+ *
644
+ * Independent of {@link configClient}: a host that only adds a header keeps
645
+ * the built-in routing, and the built-in interceptor runs before any
646
+ * `configClient` interceptor.
647
+ */
648
+ gatewayRouting?: boolean;
625
649
  /**
626
650
  * Component the embedded widgets should render in place of plain `<a>` tags.
627
651
  *
@@ -975,7 +999,7 @@ interface RootWidgetProviderProps extends WidgetProviderBaseProps {
975
999
  * @see {@link useWidgetConfig} to read the resolved config in descendants
976
1000
  * @see {@link setGlobalWidgetConfig} to push config imperatively from outside React
977
1001
  */
978
- declare function RootWidgetProvider({ children, baseUrl, widgetToken, organizationId, configClient, linkComponent, uiFramework, implementation, analytics, unstable_initResponseOverride, }: PropsWithChildren<RootWidgetProviderProps>): React.JSX.Element;
1002
+ declare function RootWidgetProvider({ children, baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, uiFramework, implementation, analytics, unstable_initResponseOverride, }: PropsWithChildren<RootWidgetProviderProps>): React.JSX.Element;
979
1003
 
980
1004
  /**
981
1005
  * Props for {@link WidgetProvider}.
@@ -1407,7 +1431,7 @@ type AcceptDisclosuresWidgetProps = WidgetProviderProps & InnerProps;
1407
1431
  * neither, and the same init refresh clears the gate that mounted this. See
1408
1432
  * `WidgetSuite`, which mounts it as its acceptance state.
1409
1433
  */
1410
- declare function AcceptDisclosuresWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: AcceptDisclosuresWidgetProps): React.JSX.Element;
1434
+ declare function AcceptDisclosuresWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: AcceptDisclosuresWidgetProps): React.JSX.Element;
1411
1435
 
1412
1436
  interface Labels$6 {
1413
1437
  title: string;
@@ -1544,7 +1568,7 @@ interface BankAccountsWidgetProps extends WidgetProviderProps {
1544
1568
  /** Called when the user opens account details or goes back to the list. */
1545
1569
  onSelectedAccountIdChange?: (accountId: string | null) => void;
1546
1570
  }
1547
- declare function BankAccountsWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: BankAccountsWidgetProps): React.JSX.Element;
1571
+ declare function BankAccountsWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: BankAccountsWidgetProps): React.JSX.Element;
1548
1572
 
1549
1573
  /**
1550
1574
  * Action handlers for custom payment flows in payable operations.
@@ -1954,7 +1978,7 @@ interface CardDetailsWidgetProps extends WidgetProviderProps {
1954
1978
  * Both placements are covered by specs, because they take different code paths
1955
1979
  * through the provider and this export exists for the standalone one.
1956
1980
  */
1957
- declare function CardDetailsWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: CardDetailsWidgetProps): React.JSX.Element;
1981
+ declare function CardDetailsWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: CardDetailsWidgetProps): React.JSX.Element;
1958
1982
 
1959
1983
  type PartialDeep$2<T> = {
1960
1984
  [K in keyof T]?: T[K] extends object ? PartialDeep$2<T[K]> : T[K];
@@ -2063,7 +2087,7 @@ type CreateCardWidgetProps = WidgetProviderProps & {
2063
2087
  * Self-contained Create Card widget. Issues a debit card via the Embed API and
2064
2088
  * drives setup → preparing → success with sonner toasts for the mutation.
2065
2089
  */
2066
- declare function CreateCardWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: CreateCardWidgetProps): React.JSX.Element;
2090
+ declare function CreateCardWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: CreateCardWidgetProps): React.JSX.Element;
2067
2091
 
2068
2092
  /** Opaque UI format values — mapped to API `DebitCardType` in the feature. */
2069
2093
  declare const CardFormatValue: {
@@ -2283,7 +2307,7 @@ interface CardsWidgetProps extends WidgetProviderProps {
2283
2307
  * inside `WidgetProvider`'s subtree, which is what the data-access hooks read
2284
2308
  * their client, org and token from.
2285
2309
  */
2286
- declare function CardsWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: CardsWidgetProps): React.JSX.Element;
2310
+ declare function CardsWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: CardsWidgetProps): React.JSX.Element;
2287
2311
 
2288
2312
  interface AddressFieldGroupLabels {
2289
2313
  line1: string;
@@ -2554,7 +2578,7 @@ type CounterpartsWidgetProps = WidgetProviderProps & CounterpartsWidgetOwnProps;
2554
2578
  * />
2555
2579
  * ```
2556
2580
  */
2557
- declare function CounterpartsWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: CounterpartsWidgetProps): React.JSX.Element;
2581
+ declare function CounterpartsWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: CounterpartsWidgetProps): React.JSX.Element;
2558
2582
 
2559
2583
  interface Labels$4 {
2560
2584
  title: string;
@@ -2598,7 +2622,7 @@ interface ExpenseManagementWidgetProps extends WidgetProviderProps {
2598
2622
  policiesContent?: ReactNode;
2599
2623
  requirementsContent?: ReactNode;
2600
2624
  }
2601
- declare function ExpenseManagementWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: ExpenseManagementWidgetProps): React.JSX.Element;
2625
+ declare function ExpenseManagementWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: ExpenseManagementWidgetProps): React.JSX.Element;
2602
2626
 
2603
2627
  type ExpenseApprovalPoliciesWidgetProps = WidgetProviderProps & {
2604
2628
  /** @deprecated Use `widgetToken` instead */
@@ -2606,7 +2630,7 @@ type ExpenseApprovalPoliciesWidgetProps = WidgetProviderProps & {
2606
2630
  /** @deprecated Use `organizationId` instead */
2607
2631
  orgId?: string | null;
2608
2632
  };
2609
- declare function ExpenseApprovalPoliciesWidget({ token, orgId, widgetToken, organizationId, baseUrl, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, }?: ExpenseApprovalPoliciesWidgetProps): React.JSX.Element;
2633
+ declare function ExpenseApprovalPoliciesWidget({ token, orgId, widgetToken, organizationId, baseUrl, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, }?: ExpenseApprovalPoliciesWidgetProps): React.JSX.Element;
2610
2634
 
2611
2635
  type ExpenseRequirementsWidgetProps = WidgetProviderProps & {
2612
2636
  /** @deprecated Use `widgetToken` instead */
@@ -2614,7 +2638,7 @@ type ExpenseRequirementsWidgetProps = WidgetProviderProps & {
2614
2638
  /** @deprecated Use `organizationId` instead */
2615
2639
  orgId?: string | null;
2616
2640
  };
2617
- declare function ExpenseRequirementsWidget({ token, orgId, widgetToken, organizationId, baseUrl, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, }?: ExpenseRequirementsWidgetProps): React.JSX.Element;
2641
+ declare function ExpenseRequirementsWidget({ token, orgId, widgetToken, organizationId, baseUrl, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, }?: ExpenseRequirementsWidgetProps): React.JSX.Element;
2618
2642
 
2619
2643
  interface BalancesWidgetLabels {
2620
2644
  /** Card header title (e.g. next to the building icon) */
@@ -3069,7 +3093,7 @@ type ChartOfAccountsWidgetProps = WidgetProviderProps & TableProps & ChartOfAcco
3069
3093
  * />
3070
3094
  * ```
3071
3095
  */
3072
- declare function ChartOfAccountsWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, analytics, errorFallback, onError, ...tableProps }: ChartOfAccountsWidgetProps): React.JSX.Element;
3096
+ declare function ChartOfAccountsWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, analytics, errorFallback, onError, ...tableProps }: ChartOfAccountsWidgetProps): React.JSX.Element;
3073
3097
 
3074
3098
  /**
3075
3099
  * Static FAQ content for the Help widget.
@@ -3177,12 +3201,12 @@ type HelpWidgetProps = WidgetProviderProps & HelpContentProps;
3177
3201
  * <HelpWidget bankName="Acme Bank" contactUrl="https://acme.example/support" />
3178
3202
  * ```
3179
3203
  */
3180
- declare function HelpWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...contentProps }: HelpWidgetProps): React.JSX.Element;
3204
+ declare function HelpWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...contentProps }: HelpWidgetProps): React.JSX.Element;
3181
3205
 
3182
3206
  type ReceivablesWidgetMoniteProps = MoniteRegionProviderProps & Omit<ReceivablesProps, 'pageTitleComponent' | 'initialView' | 'initialCounterpartId'> & {
3183
3207
  pageTitleComponent?: ReceivablesProps['pageTitleComponent'];
3184
3208
  };
3185
- declare function ReceivablesWidgetMonite({ baseUrl, widgetToken, organizationId, configClient, linkComponent, errorFallback, onError, finopsThemeColors, analytics, pageTitleComponent, uiFramework, ...receivablesProps }: ReceivablesWidgetMoniteProps): React.JSX.Element;
3209
+ declare function ReceivablesWidgetMonite({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, errorFallback, onError, finopsThemeColors, analytics, pageTitleComponent, uiFramework, ...receivablesProps }: ReceivablesWidgetMoniteProps): React.JSX.Element;
3186
3210
 
3187
3211
  interface ProductFormSheetLabels {
3188
3212
  createTitle: string;
@@ -3507,7 +3531,7 @@ interface ReceivablesWidgetOwnProps {
3507
3531
  }
3508
3532
  type ReceivablesWidgetProps = WidgetProviderProps & ReceivablesWidgetOwnProps;
3509
3533
 
3510
- declare function ReceivablesWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: ReceivablesWidgetProps): React.JSX.Element;
3534
+ declare function ReceivablesWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: ReceivablesWidgetProps): React.JSX.Element;
3511
3535
 
3512
3536
  interface Labels$3 {
3513
3537
  title: string;
@@ -3589,7 +3613,7 @@ interface LinkedAccountsWidgetProps extends WidgetProviderProps {
3589
3613
  labels?: Partial<Labels$3>;
3590
3614
  featureLabels?: Partial<FeatureLabels$4>;
3591
3615
  }
3592
- declare function LinkedAccountsWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: LinkedAccountsWidgetProps): React.JSX.Element;
3616
+ declare function LinkedAccountsWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: LinkedAccountsWidgetProps): React.JSX.Element;
3593
3617
 
3594
3618
  interface AdditionalOwnersLabels {
3595
3619
  heading: string;
@@ -3893,7 +3917,7 @@ interface BankAccountOnboardingWidgetInnerProps {
3893
3917
  onOpenChange?: (open: boolean) => void;
3894
3918
  }
3895
3919
  type BankAccountOnboardingWidgetProps = WidgetProviderProps & BankAccountOnboardingWidgetInnerProps;
3896
- declare function BankAccountOnboardingWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: BankAccountOnboardingWidgetProps): React.JSX.Element;
3920
+ declare function BankAccountOnboardingWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: BankAccountOnboardingWidgetProps): React.JSX.Element;
3897
3921
 
3898
3922
  /**
3899
3923
  * Co-located user-facing strings for the products widget UI. Each component
@@ -3991,7 +4015,7 @@ type ProductsWidgetProps = WidgetProviderProps & ProductsWidgetOwnProps;
3991
4015
  * <ProductsWidget baseUrl="https://api.tesouro.com" widgetToken="wt_..." organizationId="org_..." />
3992
4016
  * ```
3993
4017
  */
3994
- declare function ProductsWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: ProductsWidgetProps): React.JSX.Element;
4018
+ declare function ProductsWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: ProductsWidgetProps): React.JSX.Element;
3995
4019
 
3996
4020
  interface Labels$2 {
3997
4021
  loadingLabel: string;
@@ -4032,7 +4056,7 @@ interface ProfileWidgetProps extends WidgetProviderProps {
4032
4056
  */
4033
4057
  contactUrl?: string;
4034
4058
  }
4035
- declare function ProfileWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: ProfileWidgetProps): React.JSX.Element;
4059
+ declare function ProfileWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: ProfileWidgetProps): React.JSX.Element;
4036
4060
 
4037
4061
  type ReceiptMatchWidgetProps = WidgetProviderProps & {
4038
4062
  isOpen?: boolean;
@@ -4041,7 +4065,7 @@ type ReceiptMatchWidgetProps = WidgetProviderProps & {
4041
4065
  targetTransactionId?: string;
4042
4066
  onSingleTransactionUpdate?: () => void;
4043
4067
  };
4044
- declare function ReceiptMatchWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, isOpen, preSelectedReceiptIds, onClose, targetTransactionId, onSingleTransactionUpdate, }: ReceiptMatchWidgetProps): React.JSX.Element;
4068
+ declare function ReceiptMatchWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, isOpen, preSelectedReceiptIds, onClose, targetTransactionId, onSingleTransactionUpdate, }: ReceiptMatchWidgetProps): React.JSX.Element;
4045
4069
 
4046
4070
  interface Labels$1 {
4047
4071
  title: string;
@@ -4147,7 +4171,7 @@ interface SettingsWidgetProps extends MoniteRegionProviderProps {
4147
4171
  tagsContent?: ReactNode;
4148
4172
  invoiceContent?: ReactNode;
4149
4173
  }
4150
- declare function SettingsWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, finopsThemeColors, analytics, ...innerProps }: SettingsWidgetProps): React.JSX.Element;
4174
+ declare function SettingsWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, finopsThemeColors, analytics, ...innerProps }: SettingsWidgetProps): React.JSX.Element;
4151
4175
 
4152
4176
  /**
4153
4177
  * Co-located user-facing strings for the tags widget UI. Each component takes a
@@ -4236,7 +4260,7 @@ type TagsWidgetProps = WidgetProviderProps & TagsWidgetOwnProps;
4236
4260
  * <TagsWidget baseUrl="https://api.tesouro.com" widgetToken="wt_..." organizationId="org_..." />
4237
4261
  * ```
4238
4262
  */
4239
- declare function TagsWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: TagsWidgetProps): React.JSX.Element;
4263
+ declare function TagsWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: TagsWidgetProps): React.JSX.Element;
4240
4264
 
4241
4265
  interface Labels {
4242
4266
  title: string;
@@ -4486,7 +4510,7 @@ interface TeamWidgetProps extends WidgetProviderProps {
4486
4510
  */
4487
4511
  acceptInviteRedirectUri?: string;
4488
4512
  }
4489
- declare function TeamWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: TeamWidgetProps): React.JSX.Element;
4513
+ declare function TeamWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: TeamWidgetProps): React.JSX.Element;
4490
4514
 
4491
4515
  interface TransfersWidgetLabels {
4492
4516
  widgetTitle: string;
@@ -529,6 +529,30 @@ interface WidgetConfigInput {
529
529
  * ```
530
530
  */
531
531
  configClient?: (client: EmbeddedClient) => EmbeddedClient;
532
+ /**
533
+ * Overrides the widget-gateway routing decision for the scoped HTTP client.
534
+ *
535
+ * Any caller reaching the Tesouro API with a widget token must route data
536
+ * requests through the widget gateway: prefix the path with
537
+ * `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
538
+ * provider applies both automatically per request when the request origin is
539
+ * a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
540
+ * generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
541
+ * init round-trip) always pass through untouched.
542
+ *
543
+ * - `undefined` — decide from the request origin, as above. Inherits from
544
+ * the nearest ancestor or global store like every other config field.
545
+ * - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
546
+ * custom domain in front of the gateway).
547
+ * - `false` — never apply it. For hosts that route widget requests their own
548
+ * way, such as a same-origin BFF whose `configClient` retargets every
549
+ * request.
550
+ *
551
+ * Independent of {@link configClient}: a host that only adds a header keeps
552
+ * the built-in routing, and the built-in interceptor runs before any
553
+ * `configClient` interceptor.
554
+ */
555
+ gatewayRouting?: boolean;
532
556
  /**
533
557
  * Component the embedded widgets should render in place of plain `<a>` tags.
534
558
  *
@@ -685,7 +709,7 @@ type AcceptDisclosuresWidgetProps = WidgetProviderProps & InnerProps;
685
709
  * neither, and the same init refresh clears the gate that mounted this. See
686
710
  * `WidgetSuite`, which mounts it as its acceptance state.
687
711
  */
688
- declare function AcceptDisclosuresWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: AcceptDisclosuresWidgetProps): React.JSX.Element;
712
+ declare function AcceptDisclosuresWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: AcceptDisclosuresWidgetProps): React.JSX.Element;
689
713
 
690
714
  export { ACCEPT_DISCLOSURES_WIDGET_LABELS_EN, AcceptDisclosuresWidget };
691
715
  export type { AcceptDisclosuresLinks, AcceptDisclosuresWidgetLabels, AcceptDisclosuresWidgetProps };
@@ -498,6 +498,30 @@ interface WidgetConfigInput {
498
498
  * ```
499
499
  */
500
500
  configClient?: (client: EmbeddedClient) => EmbeddedClient;
501
+ /**
502
+ * Overrides the widget-gateway routing decision for the scoped HTTP client.
503
+ *
504
+ * Any caller reaching the Tesouro API with a widget token must route data
505
+ * requests through the widget gateway: prefix the path with
506
+ * `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
507
+ * provider applies both automatically per request when the request origin is
508
+ * a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
509
+ * generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
510
+ * init round-trip) always pass through untouched.
511
+ *
512
+ * - `undefined` — decide from the request origin, as above. Inherits from
513
+ * the nearest ancestor or global store like every other config field.
514
+ * - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
515
+ * custom domain in front of the gateway).
516
+ * - `false` — never apply it. For hosts that route widget requests their own
517
+ * way, such as a same-origin BFF whose `configClient` retargets every
518
+ * request.
519
+ *
520
+ * Independent of {@link configClient}: a host that only adds a header keeps
521
+ * the built-in routing, and the built-in interceptor runs before any
522
+ * `configClient` interceptor.
523
+ */
524
+ gatewayRouting?: boolean;
501
525
  /**
502
526
  * Component the embedded widgets should render in place of plain `<a>` tags.
503
527
  *
@@ -744,6 +744,30 @@ interface WidgetConfigInput {
744
744
  * ```
745
745
  */
746
746
  configClient?: (client: EmbeddedClient) => EmbeddedClient;
747
+ /**
748
+ * Overrides the widget-gateway routing decision for the scoped HTTP client.
749
+ *
750
+ * Any caller reaching the Tesouro API with a widget token must route data
751
+ * requests through the widget gateway: prefix the path with
752
+ * `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
753
+ * provider applies both automatically per request when the request origin is
754
+ * a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
755
+ * generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
756
+ * init round-trip) always pass through untouched.
757
+ *
758
+ * - `undefined` — decide from the request origin, as above. Inherits from
759
+ * the nearest ancestor or global store like every other config field.
760
+ * - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
761
+ * custom domain in front of the gateway).
762
+ * - `false` — never apply it. For hosts that route widget requests their own
763
+ * way, such as a same-origin BFF whose `configClient` retargets every
764
+ * request.
765
+ *
766
+ * Independent of {@link configClient}: a host that only adds a header keeps
767
+ * the built-in routing, and the built-in interceptor runs before any
768
+ * `configClient` interceptor.
769
+ */
770
+ gatewayRouting?: boolean;
747
771
  /**
748
772
  * Component the embedded widgets should render in place of plain `<a>` tags.
749
773
  *
@@ -923,7 +947,7 @@ interface BankAccountOnboardingWidgetInnerProps {
923
947
  onOpenChange?: (open: boolean) => void;
924
948
  }
925
949
  type BankAccountOnboardingWidgetProps = WidgetProviderProps & BankAccountOnboardingWidgetInnerProps;
926
- declare function BankAccountOnboardingWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: BankAccountOnboardingWidgetProps): React.JSX.Element;
950
+ declare function BankAccountOnboardingWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: BankAccountOnboardingWidgetProps): React.JSX.Element;
927
951
 
928
952
  export { ADDITIONAL_OWNERS_LABELS_EN, BUSINESS_DETAILS_LABELS_EN, BankAccountOnboardingWidget, PERSONAL_DETAILS_LABELS_EN, RESULT_LABELS_EN };
929
953
  export type { AdditionalOwner, AdditionalOwnersLabels, BankAccountOnboardingWidgetLabels, BankAccountOnboardingWidgetProps, BusinessDetailsLabels, BusinessDetailsValues, CompanyStructureValue, DisclosureLinks, MarketingWidgetContent, PersonalDetailsLabels, PersonalDetailsValues, ResultLabels };
@@ -516,6 +516,30 @@ interface WidgetConfigInput {
516
516
  * ```
517
517
  */
518
518
  configClient?: (client: EmbeddedClient) => EmbeddedClient;
519
+ /**
520
+ * Overrides the widget-gateway routing decision for the scoped HTTP client.
521
+ *
522
+ * Any caller reaching the Tesouro API with a widget token must route data
523
+ * requests through the widget gateway: prefix the path with
524
+ * `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
525
+ * provider applies both automatically per request when the request origin is
526
+ * a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
527
+ * generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
528
+ * init round-trip) always pass through untouched.
529
+ *
530
+ * - `undefined` — decide from the request origin, as above. Inherits from
531
+ * the nearest ancestor or global store like every other config field.
532
+ * - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
533
+ * custom domain in front of the gateway).
534
+ * - `false` — never apply it. For hosts that route widget requests their own
535
+ * way, such as a same-origin BFF whose `configClient` retargets every
536
+ * request.
537
+ *
538
+ * Independent of {@link configClient}: a host that only adds a header keeps
539
+ * the built-in routing, and the built-in interceptor runs before any
540
+ * `configClient` interceptor.
541
+ */
542
+ gatewayRouting?: boolean;
519
543
  /**
520
544
  * Component the embedded widgets should render in place of plain `<a>` tags.
521
545
  *
@@ -701,7 +725,7 @@ interface BankAccountsWidgetProps extends WidgetProviderProps {
701
725
  /** Called when the user opens account details or goes back to the list. */
702
726
  onSelectedAccountIdChange?: (accountId: string | null) => void;
703
727
  }
704
- declare function BankAccountsWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: BankAccountsWidgetProps): React.JSX.Element;
728
+ declare function BankAccountsWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: BankAccountsWidgetProps): React.JSX.Element;
705
729
 
706
730
  export { BankAccountsWidget };
707
731
  export type { Labels as AccountDetailsWidgetLabels, FeatureLabels as BankAccountsWidgetFeatureLabels, Labels$1 as BankAccountsWidgetLabels, BankAccountsWidgetProps };
@@ -628,6 +628,30 @@ interface WidgetConfigInput {
628
628
  * ```
629
629
  */
630
630
  configClient?: (client: EmbeddedClient) => EmbeddedClient;
631
+ /**
632
+ * Overrides the widget-gateway routing decision for the scoped HTTP client.
633
+ *
634
+ * Any caller reaching the Tesouro API with a widget token must route data
635
+ * requests through the widget gateway: prefix the path with
636
+ * `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
637
+ * provider applies both automatically per request when the request origin is
638
+ * a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
639
+ * generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
640
+ * init round-trip) always pass through untouched.
641
+ *
642
+ * - `undefined` — decide from the request origin, as above. Inherits from
643
+ * the nearest ancestor or global store like every other config field.
644
+ * - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
645
+ * custom domain in front of the gateway).
646
+ * - `false` — never apply it. For hosts that route widget requests their own
647
+ * way, such as a same-origin BFF whose `configClient` retargets every
648
+ * request.
649
+ *
650
+ * Independent of {@link configClient}: a host that only adds a header keeps
651
+ * the built-in routing, and the built-in interceptor runs before any
652
+ * `configClient` interceptor.
653
+ */
654
+ gatewayRouting?: boolean;
631
655
  /**
632
656
  * Component the embedded widgets should render in place of plain `<a>` tags.
633
657
  *
@@ -522,6 +522,30 @@ interface WidgetConfigInput {
522
522
  * ```
523
523
  */
524
524
  configClient?: (client: EmbeddedClient) => EmbeddedClient;
525
+ /**
526
+ * Overrides the widget-gateway routing decision for the scoped HTTP client.
527
+ *
528
+ * Any caller reaching the Tesouro API with a widget token must route data
529
+ * requests through the widget gateway: prefix the path with
530
+ * `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
531
+ * provider applies both automatically per request when the request origin is
532
+ * a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
533
+ * generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
534
+ * init round-trip) always pass through untouched.
535
+ *
536
+ * - `undefined` — decide from the request origin, as above. Inherits from
537
+ * the nearest ancestor or global store like every other config field.
538
+ * - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
539
+ * custom domain in front of the gateway).
540
+ * - `false` — never apply it. For hosts that route widget requests their own
541
+ * way, such as a same-origin BFF whose `configClient` retargets every
542
+ * request.
543
+ *
544
+ * Independent of {@link configClient}: a host that only adds a header keeps
545
+ * the built-in routing, and the built-in interceptor runs before any
546
+ * `configClient` interceptor.
547
+ */
548
+ gatewayRouting?: boolean;
525
549
  /**
526
550
  * Component the embedded widgets should render in place of plain `<a>` tags.
527
551
  *
@@ -744,7 +768,7 @@ interface CardDetailsWidgetProps extends WidgetProviderProps {
744
768
  * Both placements are covered by specs, because they take different code paths
745
769
  * through the provider and this export exists for the standalone one.
746
770
  */
747
- declare function CardDetailsWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: CardDetailsWidgetProps): React.JSX.Element;
771
+ declare function CardDetailsWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: CardDetailsWidgetProps): React.JSX.Element;
748
772
 
749
773
  export { CardDetailsWidget };
750
774
  export type { CardDetailsFeatureLabels, CardDetailsPanelLabels as CardDetailsWidgetLabels, CardDetailsWidgetProps };