Most Popular

Node.js SDK

The official Taxu Node.js library provides convenient access to the Taxu API from applications written in server-side JavaScript and TypeScript.

What is the Taxu Node.js SDK?

The Taxu Node.js SDK is a production-ready library that enables developers to integrate tax filing, compliance, and financial management capabilities directly into their Node.js applications. Built with modern async/await patterns and full TypeScript support, it provides a seamless developer experience for building tax and finance products.

Whether you're building a payroll platform, managing contractor payments with 1099 forms, or calculating tax obligations, the Node.js SDK handles the complexity of tax regulations, e-filing protocols, and IRS requirements so you can focus on your core product.

Perfect For:

  • • SaaS platforms handling contractor payments
  • • Payroll and HR systems
  • • Accounting and bookkeeping software
  • • Marketplace and gig economy platforms

Key Capabilities:

  • • IRS-compliant tax form filing (W-2, 1099, W-9)
  • • Real-time tax calculations
  • • Document extraction and validation
  • • Automated compliance monitoring
TypeScript First
Full type safety & autocomplete
Async/Await
Modern promise-based API
Battle Tested
Used by 5000+ companies
v4.2.0
TypeScript Support
Node 14+

Installation

Install the package with your preferred package manager:

npm
npm install taxu
yarn
yarn add taxu
pnpm
pnpm add taxu

Requirements: Node.js 14.0.0 or higher

Authentication

Initialize the library with your API key. You can find your API keys in your dashboard.

javascript
const Taxu = require('taxu');

const taxu = new Taxu('your_api_key_here');

Security: Never commit your API keys to version control. Use environment variables instead.

Basic Usage

Here's a quick example of filing a Form 1099-NEC:

javascript
const filing = await taxu.tax.file1099NEC(({
taxYear: 2024,
payer: {
name: 'Acme Corp',
ein: '12-3456789',
address: '123 Business St',
},
recipient: {
name: 'John Contractor',
ssn: '123-45-6789',
address: '456 Worker Ave',
},
nonEmployeeCompensation: 15000
});

console.log(filing.id); // fil_1234567890

TypeScript Support

The library includes TypeScript definitions for all API methods and responses:

typescript
import Taxu from 'taxu';
import type { Filing, TaxCalculation } from 'taxu';

const taxu = new Taxu(process.env.TAXU_API_KEY);

const calculation: TaxCalculation = await taxu.tax.calculate(({
income: 75000,
filingStatus: 'single'
});

Full Type Safety

Complete TypeScript definitions for all API endpoints and responses

IntelliSense Support

Auto-completion and inline documentation in VS Code and other IDEs

More Examples

Calculate Federal Tax

javascript
const result = await taxu.tax.calculate(({
income: 85000,
filingStatus: 'married_filing_jointly',
deductions: {
standard: true
}
});

// Result:
// { taxLiability: 7488, effectiveRate: 8.8 }

Upload & Extract W-2

javascript
const fs = require('fs');

const document = await taxu.documents.upload(({
file: fs.createReadStream('./w2.pdf'),
type: 'w2'
});

// Wait for processing
const extracted = await taxu.documents.retrieve(document.id);
console.log(extracted.data.wages); // 75000

Error Handling

The SDK throws specific error types for different failure scenarios:

javascript
try {
const filing = await taxu.tax.file1099(data);
} catch (error) {
if (error instanceof Taxu.errors.TaxuAuthenticationError) {
// Invalid API key
} else if (error instanceof Taxu.errors.TaxuValidationError) {
// Invalid parameters
} else if (error instanceof Taxu.errors.TaxuRateLimitError) {
// Too many requests
}
}
TaxuAuthenticationError

Invalid API key or authentication failure

TaxuValidationError

Invalid request parameters or missing required fields

TaxuRateLimitError

API rate limit exceeded

TaxuAPIError

General API error or server-side issue

Additional Resources