npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@freecorps/freecorpsnfe-sdk

v0.1.0

Published

Cliente TypeScript da API v1 da Freecorps NF-e, publicado no npm:

Readme

SDK Freecorps

Cliente TypeScript da API v1 da Freecorps NF-e, publicado no npm:

npm install @freecorps/freecorpsnfe-sdk
import { FreecorpsClient } from "@freecorps/freecorpsnfe-sdk";
const client = new FreecorpsClient({
  baseUrl: process.env.FREECORPS_BASE_URL!,
  apiKey: process.env.FREECORPS_API_KEY!,
  environment: "sandbox",
});
const companies = await client.call("listCompanies", {
  path: {},
  query: { limit: 20 },
  body: {},
});

No serviço hospedado, baseUrl é https://api.nfe.freecorps.com.br, sem /v1.

Requer Node 22 ou 24 com Fetch, AbortSignal e Web Crypto. O receptor SQLite de referência requer Node 22.13+ ou 24. O subpath @freecorps/freecorpsnfe-sdk/webhooks usa somente Web Crypto; não importa Zod, Convex, React ou bibliotecas de login. Outros runtimes não são declarados como testados.

call recebe o nome da operação da referência OpenAPI e seus parâmetros tipados. O timeout padrão de 30 segundos cobre todas as tentativas. timeoutMs aceita inteiros de 1 a 2.147.483.647 ms; valores fora dessa faixa são recusados antes de qualquer chamada. São no máximo dois retries, apenas em leituras JSON e operações classificadas como idempotentes. Escritas idempotentes exigem idempotencyKey, preservada byte a byte nas tentativas. 429/502/503/504 e falha de transporte permitem retry; Retry-After é respeitado até o prazo total, inclusive se o gateway não retornar JSON. Um erro JSON com retryable=false impede retry automático. O erro exposto só anuncia retryable quando a operação permite repetição segura. Upload, confirmação, controles de operação, cadastro/edição e rotação de webhook não têm retry automático. downloadOriginal faz uma tentativa de leitura binária. Inspecione o recurso após timeout.

O verificador recebe bytes originais, headers em minúsculas, segredo(s), now e toleranceMs opcional. A tolerância padrão é de cinco minutos. A expiração validUntil de cada segredo é conferida contra o timestamp e o relógio atual. Falha criptográfica é diferente de evento duplicado ou versão antiga; o receptor deve persistir esses controles junto do efeito de negócio.

Guia: https://nfe.freecorps.com.br/docs/sdk. Webhooks: https://nfe.freecorps.com.br/docs/webhooks. Exemplo: https://nfe.freecorps.com.br/developer/quickstart.ts. Não coloque API keys em código, URLs ou bundles de navegador. O cliente e os contratos externos incorporados usam MIT. Consulte LICENSING.md.