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

@cheqi/sdk

v0.5.0

Published

Cheqi TypeScript SDK for encrypted receipt and credit note processing

Readme

Cheqi TypeScript SDK

TypeScript-first Cheqi SDK for encrypted receipt and credit note processing.

Included

  • SDK entrypoint with config and service wiring
  • Customer matching
  • Receipt processing flow: match -> template -> encrypt -> digital, email, or client-encrypted download delivery
  • Credit note processing flow
  • Hybrid RSA-OAEP + AES-256-GCM encryption/decryption
  • Retry-capable HTTP client
  • JSON canonical hashing and basic XML normalization hashing
  • Company and store service wrappers
  • Generated declarations from the TypeScript source

Install

npm install

Test

npm test

Usage

import { CheqiSDK, Environment } from "@cheqi/sdk";

const sdk = CheqiSDK.builder()
  .apiEndpoint(Environment.SANDBOX)
  .apiKey("sk_test_...")
  .build();

const result = await sdk.receiptService.processCompleteReceipt(
  {
    recipientEmail: "[email protected]"
  },
  {
    documentNumber: "INV-001",
    currency: "EUR",
    totalAmount: 12.1
  }
);

if (result.deliveryStatus === "PENDING_DOWNLOAD_TEMPLATE") {
  // Commit the original request and result.downloadUrl in your durable store
  // before displaying or printing the URL.
}

if (result.deliveryStatus === "PENDING_DOWNLOAD_UPLOAD") {
  // Persist result.downloadCiphertext and retry those exact bytes later.
}

Notes

  • Models are plain TypeScript object shapes with automatic camelCase serialization.
  • The public service structure now includes Java-style builder() and get*Service() accessors.
  • The package ships .d.ts declarations so it can be consumed directly from TypeScript.
  • The full Java model class hierarchy is still not recreated as class-per-model; the payload contract is represented as typed object shapes instead.
  • XML verification currently normalizes formatting whitespace and hashes the result. If strict XML C14N compatibility is required, that part should be hardened next.

Client-encrypted receipt download links

The high-level flow uses the same client-encrypted mechanism when matching selects DOWNLOAD_FALLBACK and when a transient service failure requires deferred completion. When a healthy matching response returns routeFound: false, the SDK returns CUSTOMER_NOT_FOUND and does not bypass a disabled download fallback.

The SDK also provides stateless primitives for resuming a URL under your own scheduler. It does not store receipts, start background workers, or choose a retry schedule. Your integration owns persistence and decides where and when deferred work runs.

import {
  buildDownloadEnvelope,
  encryptDownloadEnvelope,
  generateDownloadLink
} from "@cheqi/sdk/download";

const link = generateDownloadLink("https://receipt.cheqi.io");

// Persist the complete template request, link.downloadId, and protected
// link.contentKey using your own durable storage before exposing link.url.
await receiptJobs.create({ templateRequest, ...link });
printQr(link.url);

// Later, on compute and a schedule controlled by your integration:
const template = await sdk.receiptService.generateReceiptTemplate(templateRequest);
const envelope = buildDownloadEnvelope(template);
const ciphertext = await encryptDownloadEnvelope(envelope, link.contentKey);

// Persist the exact ciphertext before its first upload attempt. After an ambiguous
// result, every retry must reuse these bytes rather than encrypting again.
await receiptJobs.markReady(link.downloadId, ciphertext);
await sdk.receiptService.uploadClientEncryptedReceipt({
  downloadId: link.downloadId,
  ciphertext
});

The customer may open the URL before the receipt is uploaded. The download page reports that the receipt is not yet available and can be visited again later. Do not implement receipt template generation locally: call the normal template endpoint after connectivity returns so CHEQI, UBL, seller, and VAT behavior remains canonical.