nfe/client-nodejs/nfeio-node-sdk
Claude Code and agent skill by nfe/client-nodejs
- community
Checking that the SKILL.md file is still in the repository.
NFE.io Node.js SDK integration expert (package: nfe-io). MUST trigger when: code imports 'nfe-io' or references NfeClient; user mentions NFE.io, NFS-e, NF-e, CT-e, CF-e, CFe-SAT, nota fiscal, nota fiscal eletronica, Brazilian invoice, fiscal document, electronic invoice Brazil, CNPJ lookup, CPF lookup, service invoice, product invoice, transportation invoice, consumer invoice, tax calculation Brazilian taxes, SEFAZ, NFE API, emissao de nota, consulta CNPJ, consulta CPF, consulta CEP; user works…
Install
npx vskill@latest install nfe/client-nodejs/nfeio-node-sdkSKILL.md
NFE.io Node.js SDK Integration Guide
This skill enables you to write correct, production-ready code using the NFE.io SDK for Brazilian electronic fiscal documents. The SDK covers NFS-e (service invoices), NF-e (product invoices), CT-e (transportation), CFe-SAT (consumer), CNPJ/CPF lookups, tax calculation, and more.
Package & Import
The npm package name is `nfe-io`. (Until 2026-09-02 the JSDoc examples imported from @nfe-io/sdk, a package that does not exist; corrected at the source.)
Requirements: Node.js 22+ (uses native fetch). Zero runtime dependencies.
Quick Start
Two complementary API keys — not alternatives. Measured route by route (2026-10-14): the data key is rejected (403) on fiscal-document routes (NF-e, NFC-e, NFS-e, inbound documents, tax codes and calculation), and the main key is rejected (403) on the lookup hosts. Some account-registry routes also accept the data key; that is not a documented contract and the SDK does not rely on it.
- `apiKey` (main) → FISCAL hosts:
api.nfe.io,api.nfse.io. Covers every emission
resource plus certificates, municipalTaxes, stateTaxes, taxCodes and taxCalculation.
- `dataApiKey` → LOOKUP hosts:
nfe.api.nfe.io,legalentity,naturalperson,
address. Covers addresses, legalEntityLookup, naturalPersonLookup, productInvoiceQuery and consumerInvoiceQuery.
The SDK falls back from dataApiKey to apiKey when the former is absent — a convenience for accounts holding one key with both scopes, not a sign that one replaces the other.
From environment variable:
Resource Map
All resources are lazy-initialized via property getters on NfeClient. No resource is instantiated until first access.
| Accessor | Resource | API Host | Scope | Key Operations | |
|---|---|---|---|---|---|
nfe.serviceInvoices | NFS-e Service Invoices | api.nfe.io | Company | create, createAndWait, list, retrieve, retrieveByExternalId, cancel, cancelAndWait, sendEmail, downloadPdf/Xml | |
nfe.serviceInvoicesRtc | NFS-e RTC (Reforma Tributária) | api.nfe.io | Company | create, createAndWait, retrieve, downloadCancellationXml (leiaute IBS/CBS; RTC selecionado pelo payload) | |
nfe.companies | Companies | api.nfe.io | Global | CRUD, exists, uploadCertificate, findByTaxNumber, listAll, listIterator | |
nfe.legalPeople | Legal People (PJ) | api.nfe.io | Company | CRUD, createBatch, findByTaxNumber | |
nfe.naturalPeople | Natural People (PF) | api.nfe.io | Company | CRUD, createBatch, findByTaxNumber | |
nfe.webhooks | Webhooks | api.nfe.io (v2 p/ conta) | Company + Account | company CRUD, validateSignature; conta: listAccountWebhooks/create/retrieve/update/delete, deleteAllAccountWebhooks, pingAccountWebhook, fetchEventTypes | |
nfe.notifications | Notifications | api.nfe.io | Company | list, retrieve, delete, sendEmail | |
nfe.addresses | Address Lookup | address.api.nfe.io | Global | lookupByPostalCode (só CEP; busca/termo não existem na API real) | |
nfe.productInvoices | NF-e Product Invoices | api.nfse.io | Company | create, list (requer environment), retrieve, cancel, downloadPdf/Xml, sendCorrectionLetter | |
nfe.productInvoicesRtc | NF-e/NFC-e RTC | api.nfse.io | Company | create (webhook-driven; IBS/CBS/IS) | |
nfe.consumerInvoices | NFC-e Consumer Invoices | api.nfse.io | Company | create (webhook-driven), list (requer environment), retrieve, cancel, getItems, getEvents, downloadPdf/Xml/Rejection, disable | |
nfe.stateTaxes | State Tax (IE) | api.nfse.io | Company | CRUD, switchAuthorizer (pré-requisito p/ NF-e) | |
nfe.municipalTaxes | Municipal Tax (IM) | api.nfse.io | Company | CRUD (pré-requisito p/ NFS-e). ⚠️ updatePrefecture e getSeries estão depreciados: a plataforma não serve essas rotas | |
nfe.certificates | Certificates (por thumbprint) | api.nfse.io | Company | list, getByThumbprint, deleteByThumbprint (+ variantes v1) | |
nfe.taxCalculation | Tax Engine | api.nfse.io | Tenant | calculate (ICMS, PIS, COFINS, IPI, II) | |
nfe.taxCodes | Tax Code Reference | api.nfse.io | Global | listOperationCodes, listAcquisitionPurposes, listIssuer/RecipientTaxProfiles | |
nfe.transportationInvoices | CT-e Transport | api.nfse.io | Company | enable/disable, retrieve, downloadXml | |
nfe.inboundProductInvoices | Inbound NF-e | api.nfse.io | Company | enableAutoFetch, getDetails, downloadXml/Pdf, manifest | |
nfe.productInvoiceQuery | NF-e Query (SEFAZ) | nfe.api.nfe.io | Global | retrieve, downloadPdf/Xml, listEvents | |
nfe.consumerInvoiceQuery | CFe-SAT Query | nfe.api.nfe.io | Global | ⚠️ depreciado — a plataforma não serve /v1/consumerinvoices/coupon; ambos os métodos respondem 404 | |
nfe.legalEntityLookup | CNPJ Lookup | legalentity.api.nfe.io | Global | getBasicInfo, getStateTaxInfo, getStateTaxForInvoice | |
nfe.naturalPersonLookup | CPF Lookup | naturalperson.api.nfe.io | Global | getStatus |
Company-scoped resources require companyId as the first parameter in every method. Global resources operate without company context.
Core Pattern: Company-Scoped Operations
Most resources are scoped to a company. The pattern is always resource.method(companyId, ...):
Core Pattern: Async Invoice Processing (Critical)
Service invoice creation can return either an immediate result (201) or an async pending result (202), depending on the municipality. The SDK uses a discriminated union return type:
Recommended: Use `createAndWait()` — handles polling automatically:
Terminal FlowStatus values: Issued, IssueFailed, Cancelled, CancelFailed Non-terminal (still processing): WaitingSend, WaitingReturn, WaitingDownload, WaitingCalculateTaxes, WaitingDefineRpsNumber, WaitingSendCancel, PullFromCityHall
Core Pattern: Error Handling
The SDK provides a rich error hierarchy. Every error extends NfeError:
| Error Class | HTTP Status | When Thrown | |
|---|---|---|---|
AuthenticationError | 401 | Invalid or missing API key | |
ValidationError | 400/422 | Invalid request data | |
NotFoundError | 404 | Resource doesn't exist | |
ConflictError | 409 | Duplicate or conflict | |
RateLimitError | 429 | Too many requests | |
ServerError | 5xx | Server-side failures | |
ConnectionError | — | Network/DNS failures | |
TimeoutError | — | Request timeout | |
ConfigurationError | — | Invalid SDK configuration | |
PollingTimeoutError | — | Polling exceeded timeout | |
InvoiceProcessingError | — | Invoice processing failed |
All error objects have: message, type, code/status/statusCode, details, raw, toJSON().
Core Pattern: Pagination
The SDK uses two different pagination styles, and the response shape varies by resource:
Offset-based (service invoices, companies, people, webhooks) — 1-based: the first page is pageIndex: 1; the API rejects pageIndex: 0 with a validation error (confirmed live for companies and service invoices):
⚠️ Version note: innfe-io≤ 5.1.x,companies.list()subtracted 1 from the response(page.pageIndexcame back 0-based) andlistAll()/listIterator()started at page 0 —which the API rejects, so auto-pagination (andfindByTaxNumber/findByName/getCompaniesWithCertificates/getCompaniesWithExpiringCertificates) failed on the firstcall. Fixed in v5.2.0: 1-based on both request and response. The request was ALWAYS 1-basedon the wire — never sendpageIndex: 0regardless of SDK version.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/nfeio-node-sdk/SKILL.md
Popularity
- Repository stars
- 139
- Repository forks
- 29
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/nfe/client-nodejs/nfeio-node-sdk)