What problem does it solve?
It prevents costly integration mistakes when automating Brazilian electronic fiscal documents (NFS-e, NF-e, CT-e, CFe-SAT) by guiding you through the correct NFE.io Node.js SDK patterns, types, polling behavior, and error handling.
Core Features & Use Cases
- Service invoice (NFS-e) async processing: Handle immediate vs async responses using discriminated unions, or rely on
createAndWait() for polling until terminal states.
- End-to-end document lifecycle automation: Create, cancel, send email, and download PDFs/XMLs for issued documents.
- Production-grade reliability: Use the SDK retry configuration and a structured error hierarchy (including polling timeouts and invoice processing failures).
- Lookups and reference data: Fetch CEP/address, CNPJ/CPF status, state tax (IE) prerequisites, and tax calculation outputs.
- Webhooks & signature validation: Validate incoming webhook signatures and react to invoice events.
Quick Start
Initialize NfeClient with your API key, create a service invoice with createAndWait() using a sufficient polling timeout, and store the resulting issued/cancelled flow outcome plus the returned invoice identifiers.