SDK

Essentials

Last updated on

Ready-to-use artifacts for common business forms

@paradoc/essentials ships finished artifacts for common business forms: IRS tax forms, the USCIS I-9, and ACH authorizations. Each one is a form instance with its spec and layers bundled in, so you fill, render, and seal it without loading files or configuring a resolver.

Installation

npm install @paradoc/essentials

Included artifacts

SubpathExportForm
/taxw9IRS W-9, Request for Taxpayer Identification Number and Certification
/taxf1099NECIRS 1099-NEC, Nonemployee Compensation
/taxf1099MISCIRS 1099-MISC, Miscellaneous Information
/taxf4506TIRS 4506-T, Request for Transcript of Tax Return
/employmenti9USCIS I-9, Employment Eligibility Verification
/bankingachBankAccountInfoACH bank account information
/bankingachChangeFormACH change form
/bankingachCreditAuthorizationACH credit authorization
/bankingachDebitAuthorizationACH debit authorization
/bankingachDirectDepositACH direct deposit authorization

Import from a subpath or from the package root:

import { w9 } from '@paradoc/essentials/tax'
import { i9 } from '@paradoc/essentials/employment'
import { achDirectDeposit } from '@paradoc/essentials/banking'

// or
import { w9, i9, achDirectDeposit } from '@paradoc/essentials'

Fill and render

Each export is a FormInstance, so it has the full form API. Every artifact has a markdown layer and one or more PDF layers built from the official form.

import { w9 } from '@paradoc/essentials/tax'

const draft = w9.fill({
  parties: {
    taxpayer: {
      id: 'taxpayer-0',
      name: 'Jane Q. Public',
      firstName: 'Jane',
      lastName: 'Public',
    },
  },
  fields: {
    taxClassification: 'individual_or_sole_proprietor',
    ssn: '123-45-6789',
    mailingAddress: {
      line1: '1 Main St',
      locality: 'Springfield',
      region: 'IL',
      postalCode: '62704',
      country: 'US',
    },
  },
})

const markdown = await draft.render({ layer: 'markdown' })
const pdf = await draft.render({ layer: 'pdf' })

The PDF template is read through a resolver bound when the package built the instance, so render and seal need none.

Seal

A PDF layer seals locally, with no adapter. The W-9 PDF layer declares two signature slots:

const signable = await draft
  .addSigner('jane', { person: { name: 'Jane Q. Public' } })
  .addSignatory('taxpayer', 'taxpayer-0', { signerId: 'jane' })
  .seal()

signable.signatureMap      // where each signature goes
signable.canonicalPdfHash  // 'sha256:...'

Validate input

Check data without filling a form:

const result = w9.safeParseData(input)
if (result.success) {
  // result.data is typed to the W-9
}

Read the spec

Each export also carries spec, the raw artifact definition it was built from:

w9.spec.name     // 'w-9'
w9.spec.version  // '1.0.0'
  • form - The form API every essential exposes
  • Sessions - Collect answers for an essential across turns
  • Bundles - Combine several forms into one packet

On this page