Overview
Tesouro’s embedded components are available as framework-agnostic web components loaded via a CDN script. Drop them into any HTML page — no build step or framework required.1. Load the script
Add the following script tag to the<head> of your web application:
2. Set up a widget token endpoint
Embedded components authenticate users via short-lived, user-scoped widget tokens. Your backend exposes an endpoint that accepts{ userId, userEmail } and returns { widgetToken }.
See the React guide for a full server-side implementation example.
3. Place a component
Drop the component element anywhere in your HTML. Passdata-widget-token-refresh-url to point components at your token endpoint:
Customization
All components support the followingdata-* attributes for theming:
| Attribute | Example |
|---|---|
data-primary-color | data-primary-color="#1a5eea" |
data-font-family | data-font-family="Inter" |
data-font-color | data-font-color="#151e32" |
data-contrast-text-color | data-contrast-text-color="#ffffff" |
data-hyperlink-color | data-hyperlink-color="#1a5eea" |
data-button-color | data-button-color="#1a5eea" |
data-button-border-radius | data-button-border-radius="8px" |
data-widget-background-color | data-widget-background-color="#f8fafc" |
data-widget-border-radius | data-widget-border-radius="12px" |
data-modal-background-color | data-modal-background-color="#ffffff" |
data-modal-border-radius | data-modal-border-radius="12px" |
setWidgetDefaults to avoid repeating them on every element. Inline data-* attributes on an individual component take precedence over values set via setWidgetDefaults: