🟢

Node.js SDK

v2.1.0

Official Node.js SDK for server-side JavaScript and TypeScript applications

Installation

npm install @taxu/node

Quick Start

Initialize the Client

const Taxu = require('@taxu/node');

const taxu = new Taxu({
  apiKey: process.env.TAXU_API_KEY
});

Upload a Document

const fs = require('fs');

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

console.log('Document ID:', uploadedDoc.id);

Calculate Tax Refund

const refund = await taxu.tax.calculateRefund({
  filingStatus: 'single',
  income: 75000,
  deductions: {
    standard: true
  },
  year: 2024
});

console.log('Estimated Refund:', refund.amount);

Features

TypeScript Support

Full type definitions included

Automatic Retries

Built-in retry logic for failed requests

Webhook Verification

HMAC signature validation helpers

Promise-based API

Modern async/await support

API Reference

taxu.documents.upload(params)

Upload a tax document for processing

Parameters:

  • file - File stream or buffer
  • type - Document type (w2, 1099, etc.)
  • year - Tax year

taxu.tax.calculateRefund(params)

Calculate estimated tax refund

Parameters:

  • filingStatus - Filing status
  • income - Total income
  • deductions - Deduction details
  • year - Tax year

taxu.webhooks.verify(payload, signature, secret)

Verify webhook signature

Parameters:

  • payload - Webhook payload string
  • signature - X-Taxu-Signature header
  • secret - Webhook secret