Bank Accounts
Lists the organization's Tesouro bank accounts, lets the user open an account with team access, and shows each account's details.
Part ofEmbedded Banking
Lists the organization's Tesouro bank accounts, lets the user open an account with team access, and shows each account's details.
Quick Start
import { BankAccountsWidget } from '@tesouro/embedded-components-react';
export function BankingPage() {
return <BankAccountsWidget isBankingTaglineVisible />;
}Under RefreshingRootWidgetProvider or WidgetProvider, the auth props are inherited.
Behaviour
- The widget ships no bank artwork or document URLs. Supply
bankLogoSrc,depositAgreementUrl,bankAddressandsupportTeamUrlyourself; each one you omit is left out. - Without
depositAgreementUrl, the create-account legal copy drops the clause that asks the user to agree to the deposit agreement. Both wordings are overridable vialabels.createLegalTemplateandlabels.createLegalTemplateWithoutAgreement. - The bank name comes from widget init, not from a prop.
- The widget reads no URL or router. By default it switches between list and details itself; to own navigation, pass
selectedAccountIdand handleonSelectedAccountIdChange. - When the organization or signed-in user changes, the open account is cleared. In controlled mode the widget calls
onSelectedAccountIdChange(null)instead. A token refresh doesn't clear it.
Props
Widget props
| Prop | Type | Default | Description |
|---|---|---|---|
isBankingTaglineVisible | boolean | true | Shows the banking tagline at the top of the widget. The page heading above it belongs to your page. |
bankLogoSrc | string | undefined | Bank logo for the tagline row. Omit and the row shows the bank name alone. |
bankLogoAlt | string | undefined | Alt text when bankLogoSrc is set. |
depositAgreementUrl | string | undefined | Deposit-agreement PDF linked from the create-account legal copy. Omit and the clause naming it isn't rendered. |
bankAddress | string | undefined | Bank postal address shown in the account-details domestic wire panel. |
supportTeamUrl | string | undefined | Support URL linked from the account-details domestic wire copy. |
data-testid | string | undefined | Optional test id forwarded to the widget root. |
selectedAccountIdControlled | string | null | undefined | Controls the open details account. |
defaultSelectedAccountIdUncontrolled | string | null | undefined | Initial uncontrolled details account. |
onSelectedAccountIdChangeEvent | (id: string | null) => void | undefined | Called when the user opens details or goes back. |
Label overrides
| Prop | Type | Default | Description |
|---|---|---|---|
labelsLabels | Partial<BankAccountsWidgetLabels> | English labels | Overrides list/create-account UI copy. |
accountDetailsLabelsLabels |
| English labels | Overrides the internal account details UI copy. |
featureLabelsLabels |
| English labels | Overrides feature-level copy (account fallback name, create/edit/copy toasts, and account-details export toasts). |
Examples
Selected account in a URL query param
'use client';
import { BankAccountsWidget } from '@tesouro/embedded-components-react';
import { usePathname, useRouter, useSearchParams } from 'next/navigation';
export function AccountsPage() {
const router = useRouter();
const pathname = usePathname();
const searchParams = useSearchParams();
return (
<BankAccountsWidget
selectedAccountId={searchParams.get('bankAccountId')}
onSelectedAccountIdChange={(id) => {
const params = new URLSearchParams(searchParams.toString());
if (id) params.set('bankAccountId', id);
else params.delete('bankAccountId');
const qs = params.toString();
router.push(qs ? `${pathname}?${qs}` : pathname);
}}
/>
);
}TypeScript
import type {
AccountDetailsWidgetLabels,
BankAccountsWidgetFeatureLabels,
BankAccountsWidgetLabels,
BankAccountsWidgetProps,
} from '@tesouro/embedded-components-react';