WhiteBooks Node.js SDK

npm-published SDK for Node 18+ LTS. ESM and CommonJS imports both supported. Ships full TypeScript type definitions for every endpoint, request, and response shape.

Installation

npm install whitebooks-sdk
# or
pnpm add whitebooks-sdk
# or
yarn add whitebooks-sdk

Quickstart (TypeScript)

import { WhiteBooks } from 'whitebooks-sdk';

const wb = new WhiteBooks({
  clientId:     process.env.WB_CLIENT_ID!,
  clientSecret: process.env.WB_CLIENT_SECRET!,
  env:          'sandbox',     // or 'production'
});

// Same client, four APIs:
const gstr2b   = await wb.gst.gstr2b.fetch({ gstin: '29AAAAA0000A1Z5', month: '04', year: '2026' });
const irn      = await wb.einvoice.generateIrn({ /* invoice payload */ });
const ewb      = await wb.eway.generate({ /* EWB payload */ });
const clear    = await wb.ksaEinvoice.clearance({ /* UBL 2.1 */ });

Features

Part of the WhiteBooks developer documentation cluster. See /llms.txt for the full machine-readable site index. Last updated 27 May 2026.