Node SDK
One class, four methods — issue, consult, cancel, reissue — typed end to end in TypeScript.
The official Node/TypeScript SDK (npm install @stackin-io/stackin-node-sdk) wraps the REST API in a single Invoice class. There is nothing else to instantiate: issue(), consult(), cancel() and reissue() are the whole surface, and each one returns the API's own response shape rather than a parallel model of it.
It ships its own type declarations, so DocumentType.NFE is a real enum member and a misspelled document type is a compile error rather than a 422 from the API. The same applies to br.Product and Address — the fields NF-e requires are on the type, so a missing ncm or an incomplete recipient address is caught by tsc or by local validation before a request is ever sent.
Authentication is one API key, identical to the raw API, so moving between the SDK and direct HTTP calls needs no separate credential. The key resolves the issuing company entirely — CNPJ, state, certificate and fiscal environment — and nothing about the issuer is ever passed on a call.
Errors arrive as three distinct classes rather than one generic failure: ValidationError for anything the SDK rejected locally, APIError carrying the status code and the API's own detail, and ConnectionFailedError when the request never got a response. All three extend InvoiceError, so a single catch still works when you don't need to tell them apart.
reissue() is worth calling out because its argument is not an access key. A submission that failed never received one, so it takes the invoice's local id instead — and it consumes quota exactly like a fresh issue, which is why the SDK deliberately has no automatic retry loop around it.
Requires Node 18 or newer, since it uses the platform fetch rather than bundling an HTTP client. Every request honours a configurable timeout, and the fetch implementation itself is injectable, which is what the test suite uses to run without a network.
See the SDKs section of the API reference for install commands and side-by-side examples, or the code on GitHub.