TypeScript programs that run directly with Node.js type stripping (no build step), using the @desktopaccountingapi/quickbooks-desktop SDK.
- Node.js 22.18 or later (type stripping on by default). The examples root
mise.tomlpins the version:mise install. - The environment variables from the examples README:
DAAPI_SECRET_KEY,DAAPI_END_USER_ID, optionallyDAAPI_BASE_URL(staging:https://api-staging.desktopaccountingapi.com),DAAPI_WEBHOOK_SECRETandPORT. - For
create-invoice,network-dropandasync-webhooks: an active customer and an active service item in the company file. The examples use the first ones they find; setDAAPI_CUSTOMER_IDandDAAPI_ITEM_IDto choose.
cd node
npm installThe examples CI uses the SDK repository checked out at $SDK_REPOS_DIR/quickbooks-desktop-node (default <examples root>/sdk/quickbooks-desktop-node):
(cd "${SDK_REPOS_DIR:-../sdk}/quickbooks-desktop-node" && npm ci) # installs and builds the SDK's dist/
node scripts/use-local-sdk.mjs # links it into node_modulesnpm install switches back to the npm package.
node quickstart.ts
node create-invoice.ts # RUN_ID=<id> repeats a run: the same idempotency keys replay instead of duplicating
node network-drop.ts
node sync-customers.ts
node sync-customers.ts --slow # SLOW_SECONDS=15 per page by default
node async-webhooks.ts # async-mode create, waits on the request handle
node async-webhooks.ts --receive # webhook receiver on PORT (default 8080)
node async-webhooks.ts --self-test # signs and verifies a sample event locally; needs no API key
node error-handling.tscreate-invoice, network-drop and async-webhooks create records and void the invoices they create. Use a test company file.
node scripts/check.mjsLinks the local SDK checkout (see above), type-checks every example with the SDK's TypeScript in strict mode, and runs the webhook self-test. It makes no API calls.