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

@beliq/sdk

v0.1.1

Published

Official beliq SDK: generate, validate, parse, and convert EU-compliant e-invoices (XRechnung, ZUGFeRD, Factur-X, Peppol BIS) against authority-pinned, drift-checked rules.

Readme

@beliq/sdk

Official Node/TypeScript SDK for the beliq e-invoicing compliance API. Generate, validate, parse, and convert EN 16931 invoices (XRechnung, ZUGFeRD, Factur-X, Peppol BIS) against authority-pinned, nightly-drift-checked rules.

beliq produces and checks the compliant document. Transmission (Peppol, PDP, KSeF, SDI), archiving, and tax-authority reporting stay with your access point.

Install

npm install @beliq/sdk

Requires Node >= 20.15. Ships ESM and CommonJS builds with bundled type declarations.

Quick start

import { Beliq } from '@beliq/sdk';

const beliq = new Beliq({ apiKey: process.env.BELIQ_API_KEY! });

// Account, plan, and quota context (no quota cost).
const account = await beliq.me();

// Generate an XRechnung document from an EN 16931 invoice object.
const generated = await beliq.generate({
  standard: 'xrechnung',
  verify: true,
  invoice: {
    number: 'INV-2026-001',
    issueDate: '2026-01-15',
    currencyCode: 'EUR',
    seller: { name: 'Seller GmbH', address: { city: 'Berlin', postalCode: '10115', countryCode: 'DE' } },
    buyer: { name: 'Buyer GmbH', address: { city: 'Munich', postalCode: '80331', countryCode: 'DE' } },
    lines: [{ description: 'Consulting', quantity: 10, unitCode: 'HUR', unitPrice: 100, lineTotal: 1000, vatRate: 19, vatCategoryCode: 'S' }],
    totalNetAmount: 1000,
    totalTaxAmount: 190,
    totalGrossAmount: 1190,
  },
});
console.log(generated.xml, generated.meta.schematronVersion);

// Validate any document against authority-pinned rules.
const result = await beliq.validate(generated.xml!, { format: 'auto' });
if (!result.valid) {
  for (const issue of result.errors) console.log(issue.ruleId, issue.message);
}

Authentication

Create an API key in the beliq dashboard under API Keys, then pass it to the client:

new Beliq({ apiKey: 'blq_...' });                 // sends X-API-Key (default)
new Beliq({ apiKey: 'blq_...', auth: 'bearer' });  // sends Authorization: Bearer
new Beliq({ apiKey: 'blq_...', baseUrl: 'https://staging.beliq.eu' });

API

| Method | Endpoint | Input | Returns | |---|---|---|---| | me() | GET /v1/me | none | AccountInfo (no quota cost) | | generate(input) | POST /v1/generate | EN 16931 invoice object | { contentType, bytes, xml?, meta } | | validate(document, options?) | POST /v1/validate | XML or PDF | ValidationResult | | parse(document, options?) | POST /v1/parse | XML or PDF | ParseResult | | convert(document, options) | POST /v1/convert | XML or PDF | { contentType, bytes, meta } |

document accepts a string, Uint8Array, Buffer, ArrayBuffer, or typed array. The content type is sniffed from the bytes (PDF vs XML) unless you pass options.contentType. generate and convert return raw document bytes plus the response-header metadata (schematronVersion, pdfKind, sourceFormat/targetFormat, lostElements, conversionTools); for an XML output, generate also decodes xml.

Every option enum is typed from the OpenAPI spec, so wrong values fail at compile time. Errors throw BeliqApiError with a typed .code, HTTP .status, and any .details:

import { BeliqApiError } from '@beliq/sdk';

try {
  await beliq.validate('not xml');
} catch (err) {
  if (err instanceof BeliqApiError) console.log(err.code, err.status, err.message);
}

Types stay in sync with the API

src/generated/schema.ts is generated from a vendored copy of the published OpenAPI spec (openapi.json).

npm run sync:spec      # refresh openapi.json from beliq-api / the live spec
npm run gen:types      # regenerate src/generated/schema.ts
npm run openapi:check  # CI drift guard: fails if the generated types are stale

The vendored spec is committed so builds are reproducible; nothing is fetched from the network at build time.

Development

npm install
npm run build       # tsup: dual ESM + CJS + d.ts
npm run typecheck
npm run lint
npm test            # unit tests (no network)
BELIQ_API_KEY=blq_xxx npm run test:integration   # hits the live API; draws quota

Publishing

Released to npm as @beliq/sdk. Releases run from .github/workflows/release.yml via npm Trusted Publishing (OIDC, with provenance): push a v*.*.* tag to publish. No npm token is stored in the repo.

License

MIT