Overview
The Sync2Books Link is a pre-built UI component that handles the OAuth flow for connecting accounting systems. It provides:- ✅ Pre-built UI - No need to build OAuth flows yourself
- ✅ Multi-framework support - React, Vue, Angular, Svelte
- ✅ Customizable branding - Use your app’s logo and name
- ✅ Automatic token management - Handles refresh and expiration
This page describes the OAuth flow (QuickBooks, Xero, Sage). Odoo doesn’t use OAuth —
the Link modal instead shows a credentials form (URL, database, username, API key)
directly inside the same widget. See
Set up the Odoo integration for that flow specifically;
everything else on this page (installation,
useSync2Books, error handling) applies the
same way regardless of which integration is selected.How Link Works
Prerequisites
- ✅ API Key - Your application’s API key
- ✅ Application ID - Your application ID
- ✅ Company ID - The company/user ID in your system
- ✅ Redirect URIs - Configured in your application settings
React Integration
Installation
Basic Usage
Advanced Usage
API Reference
useSync2Books(config)
Config Options:
Returns:
openLink(args?)- Function to open the Link modalisReady- Boolean indicating if Link is readyisInitiated- Boolean indicating if Link has been initialized
Vue Integration
Installation
Basic Usage
Advanced Usage
Angular Integration
Installation
Basic Usage
Svelte Integration
Installation
Basic Usage
Customization
Application Settings
Configure your application’s Link appearance in the dashboard:- Go to Applications → Settings
- Set Link Logo URL - Your app’s logo (shown in OAuth consent)
- Set Link Display Name - Your app’s name (shown in OAuth consent)
- Add Redirect URIs - URLs where users are redirected after OAuth
Redirect URIs
Redirect URIs must be configured in your application settings. Examples:http://localhost:3000/callbackhttps://app.example.com/callbackhttps://app.example.com/application/{applicationId}/connect
Error Handling
User Recoverable Errors
Some errors allow users to retry:Common Errors
Best Practices
- Show loading state - Disable buttons until
isReadyistrue - Handle errors gracefully - Show user-friendly error messages
- Store connection ID - Save
connectionIdafter successful connection - Test redirect URIs - Ensure redirect URIs are correctly configured
- Use production API keys - Use
sk_production_...keys in production
Link UI Preview
The Link component shows a modal/dialog with the following steps:Step 1: Integration Selection
The user sees a searchable list of available integrations:Step 2: OAuth Consent
After selecting an integration, a new tab/window opens with the accounting system’s OAuth consent page (e.g., QuickBooks). The modal shows:Step 3: Success
After successful OAuth, the modal shows:Customization
The Link component can be customized via your application settings:- Logo - Set
linkLogoUrlto show your app’s logo in the OAuth consent screen - Display Name - Set
linkDisplayNameto show your app’s name (e.g., “Your App Name”) - Redirect URIs - Configure where users are redirected after OAuth completes
Next Steps
- Getting Started - Set up your API key
- Expense Management - Create and sync expenses
- Sync & Monitoring - Track sync status