Insights
Shows onboarding-style insights derived from the organization's embedded and external bank accounts, in Active and Dismissed tabs.
Part ofEmbedded Banking
Shows onboarding-style insights derived from the organization's embedded and external bank accounts, in Active and Dismissed tabs. Users can dismiss insights, and the widget remembers dismissals per organization.
Quick Start
import { useState } from 'react';
import { InsightsWidget } from '@tesouro/embedded-components-react';
export function DashboardInsights() {
const [routingEnabled, setRoutingEnabled] = useState(false);
return (
<InsightsWidget
baseUrl="https://api.example.com"
widgetToken="wt_live_abc123"
organizationId="org_xyz"
routingEnabled={routingEnabled}
onRoutingToggleChange={setRoutingEnabled}
onLinkExternalAccountClick={() => openLinkExternalAccountModal()}
/>
);
}All widget props are optional. Pass the callbacks to wire the routing switch and the Link account CTA into your app.
Behaviour
- The payment-routing onboarding insight appears only when the widget token grants
user:write:org. There is no visibility prop. - Dismissals are saved per organization and don't carry over to other orgs. Without an organization id, dismiss has no effect.
- Dismiss is optimistic. If saving fails, the insight returns to the Active tab.
- If every account read fails, the widget shows an error with Retry. If only one of the two reads fails, it silently shows the insights it could build and offers no retry.
- Insights that need an account list the token can't read aren't shown.
Props
Widget props
| Prop | Type | Default | Description |
|---|---|---|---|
routingEnabled | boolean | false | Controlled switch state for the routing onboarding insight. |
onRoutingToggleChangeEvent | (enabled: boolean) => void | undefined | When set, controls the routing switch from the host; otherwise the widget keeps local toggle state. |
onLinkExternalAccountClickEvent | () => void | undefined | When set, the connect-external-account insight shows a Link account CTA. |
Label overrides
| Prop | Type | Default | Description |
|---|---|---|---|
labelsLabels | Partial<InsightsWidgetLabels> | English labels | Shell copy (tabs, empty, error). |
singleInsightLabelsLabels | Partial<SingleInsightLabels> | English labels | Per-row UI strings, such as the dismiss button's aria-label. |
featureLabelsLabels | Partial<InsightsFeatureLabels> | English labels | Generated insight body copy and action labels. |
Examples
Custom labels (i18n)
<InsightsWidget
labels={{ activeTab: 'Activas', dismissedTab: 'Descartadas' }}
featureLabels={{
createAccountText: 'Cree una cuenta para comenzar.',
verifyExternalAccountText: (nickname) => `Verifique ${nickname}.`,
}}
/>See the exported InsightsWidgetLabels, SingleInsightLabels and InsightsFeatureLabels types for every key.
TypeScript
import type {
InsightsWidgetProps,
InsightsWidgetLabels,
SingleInsightLabels,
InsightsFeatureLabels,
} from '@tesouro/embedded-components-react';