Documentation Index
Fetch the complete documentation index at: https://docs.tesouro.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The@tesouro/embedded-components-react package provides a set of React components that embed Tesouro functionality directly into your application. Wrap your app in EmbeddedProvider, then render any combination of components — no Next.js required.
Before you begin
You will need:- A Tesouro client ID and client secret (provided during onboarding)
- A widget secret (
TESOURO_WIDGET_SECRET) — a separate credential used to mint user-scoped widget tokens, also provided during onboarding
1. Install
2. Set up a widget token endpoint
Embedded components authenticate users via short-lived, user-scoped widget tokens — not your API access token. Your backend is responsible for minting these tokens and exposing them via an endpoint.Widget tokens are user-scoped JWE tokens encrypted with your
TESOURO_WIDGET_SECRET. They must
be generated server-side to keep your credentials secure.{ userId, userEmail } and return { widgetToken }:
| Variable | Description |
|---|---|
TESOURO_WIDGET_SECRET | Hex-encoded secret key for encrypting widget tokens |
TESOURO_CLIENT_ID | Your Tesouro client ID |
TESOURO_CLIENT_SECRET | Your Tesouro client secret |
3. Wrap your app with EmbeddedProvider
Import EmbeddedProvider and configure it with the current user’s identity and your token endpoint:
| Prop | Required | Description |
|---|---|---|
userId | Yes | Your platform’s unique identifier for the current user |
userEmail | Yes | The current user’s email address |
widgetTokenRefreshUrl | Yes | URL of your widget token endpoint |
env | No | "sandbox" or "production" (default: "sandbox") |
widgetTokenRefreshInterval | No | Token refresh interval in ms (default: 300000) |
styleOverrides | No | Theme customizations (see below) |
navigationAdapter | No | Custom navigation adapter (see below) |
(Optional) Navigation adapter
By default,EmbeddedProvider uses browser-native navigation (window.history). Pass a navigationAdapter to integrate with your router:
(Optional) Style overrides
Customize the look and feel to match your platform:Next steps
- Embedded Banking components — onboarding, balances, transfers, and more
- FinOps components — invoicing, expense management, and bill pay