Skip to main content

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:
Security: Never hardcode tokens in frontend codeThe getToken function must call your backend to fetch fresh tokens. This keeps your partner credentials secure and allows proper token rotation.

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:
Combine with menu configuration API to control which tabs appear.

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'.
Development is continuously deployed and uses provider test modes (Plaid sandbox, Stripe test). Data may be reset; never send real customer data.

Security Checklist

✅ Do: Fetch tokens from your backend endpoint❌ Don’t: Generate tokens in frontend code or hardcode credentials
✅ Do: Use business-scoped tokens in frontend❌ Don’t: Expose partner-scoped tokens (grants access to all businesses)
✅ Do: Serve your app over HTTPS in production❌ Don’t: Use HTTP (tokens will be exposed)
If using CSP, allow:
  • script-src for widget JavaScript
  • connect-src for the hosts the widget calls: the Thred backend (https://backend.thredfi.com in production, https://dev-backend.thredfi.com in development) and Ask Thred (https://ask-thred.thredfi.com in production, https://ask-thred-dev.thredfi.com in development)
  • frame-src if widget uses iframes internally

Resources


Widget embedded. Time to verify your integration works end-to-end.