Installation
Quick Start
1
Add container element
Add a div where the widget will mount:
2
Import and mount
3
Implement token endpoint
Create a backend endpoint that returns business-scoped tokens:
CDN Usage (No Bundler)
For vanilla JavaScript or server-rendered apps:Configuration Reference
Required Options
Optional Options
Theme Customization
Match your platform’s visual identity:Multi-Language Support
Change language dynamically:
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 is required and takes 'development' or 'production' (@thredfi/accounting 0.14.0 and later). Fetch business tokens from the matching environment: development tokens with 'development', production tokens with 'production'.
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 the hosts the widget calls: the Thred backend (https://backend.thredfi.comin production,https://dev-backend.thredfi.comin development) and Ask Thred (https://ask-thred.thredfi.comin production,https://ask-thred-dev.thredfi.comin development)frame-srcif widget uses iframes internally
Resources
Widget embedded. Time to verify your integration works end-to-end.