Installation
Quick Start
CDN Usage (No Bundler)
For vanilla JavaScript or server-rendered apps:Configuration Reference
Required Options
| Option | Type | Description |
|---|---|---|
thredfiSelector | string | CSS selector for container element (e.g., '#thredfi-widget') |
getToken | function | Async function returning {access_token, expires_in} |
businessId | string | Business UUID from Thred |
Optional Options
| Option | Type | Default | Description |
|---|---|---|---|
environment | string | 'sandbox' | 'sandbox' or 'production' |
lang | string | 'en' | Language code (see supported languages) |
basePath | string | '' | Base path for routing (e.g., '/accounting') |
theme | object | - | Color overrides for branding |
hideMenu | boolean | false | Hide header navigation |
Theme Customization
Match your platform’s visual identity:Multi-Language Support
| Code | Language |
|---|---|
en | English (US) |
en-GB | English (UK) |
de | German |
es | Spanish |
fr | French |
it | Italian |
nl | Dutch |
nb | Norwegian |
Advanced Configuration
Custom Routing
If your app uses routing (e.g.,/dashboard/accounting), set basePath:
Hide Navigation Menu
Hide the widget’s header when you want to provide your own navigation:Deep Linking
Navigate directly to specific tabs:Environment Configuration
| Environment | Backend URL | Use For |
|---|---|---|
sandbox | https://api-sandbox.thredfi.com | Development and testing |
production | https://api.thredfi.com | Live production deployments |
Security Checklist
Backend token generation
Backend token generation
✅ Do: Fetch tokens from your backend endpoint❌ Don’t: Generate tokens in frontend code or hardcode credentials
Token scope
Token scope
✅ Do: Use business-scoped tokens in frontend❌ Don’t: Expose partner-scoped tokens (grants access to all businesses)
HTTPS only
HTTPS only
✅ Do: Serve your app over HTTPS in production❌ Don’t: Use HTTP (tokens will be exposed)
Content Security Policy
Content Security Policy
If using CSP, allow:
script-srcfor widget JavaScriptconnect-srcfor API calls tohttps://api.thredfi.comorhttps://api-sandbox.thredfi.comframe-srcif widget uses iframes internally
Resources
Widget embedded. Time to verify your integration works end-to-end.