Accept Disclosures

Shows the bank partner's required disclosure documents with an agreement checkbox and an Accept button.

Part ofEmbedded Banking

Shows the bank partner's required disclosure documents with an agreement checkbox and an Accept button. The document set, titles and order come from your program's backend configuration, so you pass no URLs.


Quick Start

Mount it when widget init reports status: 'INVITED', or disclosuresRequired: 'REQUIRED' with disclosuresAccepted: false. Don't gate on REQUIRED alone: an invited user in a NOT_REQUIRED org must still accept to activate.

import {
  AcceptDisclosuresWidget,
  useWidgetConfig,
} from '@tesouro/embedded-components-react';

function Gate({ children }: { children: React.ReactNode }) {
  const { initResponse } = useWidgetConfig();
  const isInvitee = initResponse?.status === 'INVITED';
  const owesAcceptance =
    initResponse?.disclosuresRequired === 'REQUIRED' &&
    !initResponse.disclosuresAccepted;

  return isInvitee || owesAcceptance ? <AcceptDisclosuresWidget /> : children;
}

Behaviour

  • Accept activates an invited user and records acceptance in one step. On success the widget awaits onAccepted, locks the control so acceptance can't be posted twice, then refreshes widget init so your gate clears.
  • If onAccepted rejects, the widget shows an inline error and stays retryable.
  • If a newer disclosure version is published while the user is reading, Accept is refused and the widget reloads the current documents.
  • The widget renders nothing until the documents and the tenant's bank name load. A failed load shows an error with retry.
  • An org with no documents still shows Accept, using the noDocuments* labels.
  • Use a normal widgetToken. Never pass an application (APP) / M2M token.

Props

Widget props

PropTypeDefaultDescription
onAcceptedEvent() => void | Promise<void>undefinedCalled after the atomic accept succeeds and before init refresh; awaited before the widget locks. Reject to surface an error and keep Accept retryable.
Label overrides
PropTypeDefaultDescription
labelsLabels
Partial<AcceptDisclosuresWidgetLabels>
Partial<AcceptDisclosuresWidgetLabels>
English labelsOverride widget copy. {documents} in agreementTextTemplate is replaced with the document titles. The noDocuments* labels apply when there are no documents. Document titles aren't overridable.

TypeScript

import type {
  AcceptDisclosuresWidgetProps,
  AcceptDisclosuresWidgetLabels,
} from '@tesouro/embedded-components-react';

On this page