nfeio-sdk

Automate Brazilian electronic fiscal document workflows using the NFE.io Node.js SDK.

139|27|Updated Nov 9, 2014
One-click install
npx skills add https://github.com/nfe/client-nodejs --skill nfeio-sdk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nfeio-sdk
Source: https://github.com/nfe/client-nodejs/tree/main/skills/nfeio-sdk
Command: npx skills add https://github.com/nfe/client-nodejs --skill nfeio-sdk

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

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.

Frequently Asked Questions about nfeio-sdk

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate Brazilian NFS-e invoice creation with Node.js?

To automate NFS-e invoice creation with Node.js, initialize the NFE.io SDK client, use the createAndWait() method for polling until terminal states, and handle the returned discriminated-union responses to capture the final flow outcome and invoice identifiers.

Does the NFE.io SDK support webhook signature validation for invoice events?

Yes, the NFE.io SDK supports webhook signature validation. You must validate incoming webhook HMAC signatures to securely react to invoice events and ensure production-grade reliability for your document lifecycle automation.

What's the best way to handle async polling for NF-e product invoices in JavaScript?

The best way to handle async polling for NF-e product invoices is using the createAndWait() SDK method with a sufficient polling timeout, which manages the polling lifecycle until the document reaches a terminal issued or cancelled state.

Can I fetch CNPJ status and CEP address lookups using the NFE.io Node.js package?

Yes, you can fetch CNPJ and CPF status alongside CEP address lookups using the NFE.io Node.js package. It provides reference data retrieval for state tax prerequisites and tax calculation outputs required for invoice issuance.

Why does my NFE.io SDK invoice download return a Buffer instead of a file resource?

Your NFE.io SDK invoice download returns a Buffer instead of a file resource due to the SDK's specific return types. You must correctly distinguish between Buffer and file-resource download return types when retrieving issued PDFs and XMLs.

Are there specific Node.js version requirements for the NFE.io fiscal document SDK?

Yes, the NFE.io fiscal document SDK requires Node.js 18 or higher. It is designed for TypeScript and JavaScript applications that need robust invoice lifecycle management, applying SDK-provided error hierarchy and pagination conventions.