Overview
Tax Documentation React SDK
Embed tax documentation collection directly in your React application.
Package: @taxbit/react-sdk on npm — see the package page for the latest version.
The Taxbit React SDK provides a TaxbitQuestionnaire component and a useTaxbit hook for collecting and managing tax documentation within your React application. Information collected through the SDK flows directly into the Taxbit platform for TIN matching, validation, and end-of-year information returns.
The SDK supports three questionnaire types, each covering different regulatory requirements. The table below helps you determine which one to use.
Which questionnaire do you need?
| Questionnaire | Regulations | Your end user is… | Outputs | PDF? |
|---|---|---|---|---|
W-FORM | IRS Forms 1099 (e.g., 1099-B, 1099-DIV, 1099-INT), backup withholding, US FDAP income treaty claims | A US person (W-9) or foreign person (W-8BEN, W-8BEN-E, W-8IMY) | Certified W-9 or W-8 form stored in Taxbit; TIN validation | Yes |
DPS | DAC7 (EU), MRDP (OECD), plus UK, NZ, Canada local implementations | A seller on your digital platform | Digital Platform Seller interview data; VAT validation via VIES | No |
SELF-CERT | CRS (Common Reporting Standard), CARF (Crypto-Asset Reporting Framework), DAC8 | A financial account holder or crypto-asset user | Self-certification for CRS/CARF/DAC8 reporting; tax residency data | Yes |
Not sure which to use? See the integration design guide for a decision flowchart and regulatory context, or reach out to your Taxbit representative.
How it works
Integrating the SDK involves a server-side setup phase (obtaining tokens and creating account owners via the Taxbit API) and a client-side rendering phase (embedding the TaxbitQuestionnaire component in your React app).
sequenceDiagram
participant Server as Your Server
participant Taxbit as Taxbit API
participant Client as Your React App
Server->>Taxbit: POST /v1/oauth/token (client_id, client_secret, tenant_id)
Taxbit-->>Server: tenant-scoped bearer token (valid 24h)
Server->>Taxbit: POST /v1/account-owners (id, account_owner_type)
Taxbit-->>Server: 201 Created (account_owner_id)
Server->>Taxbit: POST /v1/oauth/account-owner-token (account_owner_id)
Taxbit-->>Server: AO-scoped bearer token (valid 24h)
Server->>Client: Pass AO-scoped bearer token
Client->>Client: Render <TaxbitQuestionnaire bearerToken={token} questionnaire="W-FORM" />
Client->>Taxbit: SDK submits completed form using AO-scoped token
Taxbit-->>Client: Success response
Note: Account creation is optional for the SDK. You can include an Account object in the Account Owner API call or create one separately. Account creation is not required for the SDK to function, but you may need to create Accounts later for transaction reporting and cost basis tracking. See Setting up account owners for details.
The account-owner-scoped bearer token limits the SDK's access to a single account owner's data. Your server generates this token and passes it to the client — the client_secret never reaches the browser.
After submission, Taxbit validates the documentation (TIN matching, VAT verification, etc.) and surfaces results via the useTaxbit hook and the Taxbit Dashboard. You can also subscribe to webhook events for background monitoring at scale. See Monitoring and remediation for details.
What you'll need
Before diving into the quickstart, make sure you have a Taxbit account with API credentials (available in Dashboard > Settings > Developer Settings) and an existing React 16+ application. For demo mode, you only need the React app — no credentials required.
Try it now
The fastest way to see the SDK in action is demo mode — no server, no credentials, no setup. Drop this into any React component:
import '@taxbit/react-sdk/style/inline.css';
import { TaxbitQuestionnaire } from '@taxbit/react-sdk';
export function DemoTaxForm() {
return (
<TaxbitQuestionnaire
questionnaire="W-FORM"
demoMode
/>
);
}Demo mode works with all three questionnaire types (W-FORM, DPS, SELF-CERT). The form renders and accepts input, but no data is sent to a server.
Get started
| Path | Description | Time |
|---|---|---|
| Quickstart | Install the SDK and render a working questionnaire, from demo mode to production auth. | ~3–5 min |
| Integration design guide | Which questionnaire to choose, where to place the SDK in your UX, and how to optimize entry points. | Read |
| Setting up account owners | Create account owners via the API, understand ID strategy, and handle existing-user backfill. | How-to |
| Component and hook reference | Full props table, hook return values, TypeScript types, and status enums. | Reference |
Compatibility
| Dependency | Supported versions |
|---|---|
| React | 16, 17, 18, 19 |
| TypeScript | 4, 5 |
Installation
The SDK is available as an npm package. See the npm package page for the latest version.
npm install @taxbit/react-sdkKey capabilities
| Capability | Description | Learn more |
|---|---|---|
| Demo mode | Render the SDK without a server or bearer token for development and testing. Works with all questionnaire types. | Quickstart |
| Adaptive mode | Pre-fill known data with skipLock (read-only) or skipEdit (editable) to reduce friction for returning users. | Adaptive mode |
| Real-time TIN validation | Validate US TINs against the IRS in real time during W-9 collection. | Collecting W-9 forms |
| Treaty claims | Collect US FDAP Income treaty claim information as part of the W-8 flow. | Collecting W-8 forms |
| VAT validation | Automatic VAT number validation through the VIES system for DPS questionnaires. | DAC7 / DPS collection |
| Localization | 50+ languages for DPS/Self-Cert, ~20 languages for W-FORM. End users can also switch language in the UI. | Component and hook reference |
| PDF generation | Generate downloadable PDF copies of completed W-9, W-8, and Self-Cert forms via the useTaxbit hook. Not available for DPS. | Component and hook reference |
| Status monitoring | Track completion status, TIN validation state, VAT status, and re-submission needs via React hooks. Webhook events are also available for background monitoring at scale (see Webhooks guide). | Monitoring and remediation |
| CSS customization | Three built-in stylesheets (inline.css, basic.css, minimal.css) plus full CSS class targeting for custom styling. See branded integration examples on the Adaptive mode page. | Component and hook reference |
Base URL
| Environment | Base URL |
|---|---|
| Sandbox and production | https://api.multi1.enterprise.taxbit.com |
Obtain your client_id, client_secret, and tenant_id from Dashboard > Settings > Developer Settings.
Content Security Policy
If your application uses a Content Security Policy, you must allow the SDK to connect to Taxbit's API:
connect-src https://*.taxbit.com;
Without this, the SDK will render but API calls will silently fail. See Troubleshooting for more CSP details.
Updated 23 days ago
