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

@attestia/node

v0.2.1

Published

Attestia HTTP service — REST API for intent lifecycle, reconciliation, and attestation

Readme

@attestia/node

Part of Attestia — financial truth infrastructure for the decentralized world.

Production-ready HTTP service built on Hono with authentication, multi-tenancy, rate limiting, and 30+ API endpoints.

npm version License: MIT


At a Glance

  • Hono-based HTTP server with createApp() factory for testability
  • 30+ endpoints across intents, events, verification, proofs, compliance, attestation, and export
  • Authentication: API key (X-Api-Key) and JWT with role-based permissions (admin, operator, viewer)
  • Multi-tenancy: isolated AttestiaService instances per tenant via TenantRegistry
  • Rate limiting: token bucket algorithm with configurable RPM and burst
  • Idempotency: automatic deduplication for POST requests via Idempotency-Key header
  • Prometheus metrics endpoint for monitoring (request count, latency, error rates)
  • Public endpoints for third-party verification, proof checking, and compliance reports
  • Structured logging via Pino, request ID tracking, ETag support, CORS
  • Zod-validated configuration from environment variables
  • Graceful shutdown on SIGTERM/SIGINT
  • 184 tests

Installation

npm install @attestia/node

Usage

Quick Start

import { createApp } from "@attestia/node";

const { app } = createApp({
  serviceConfig: {
    ownerId: "my-org",
    defaultCurrency: "USDC",
    defaultDecimals: 6,
  },
});

// Use with @hono/node-server, Bun, Deno, or any Hono-compatible runtime

With Authentication and Rate Limiting

import { createApp, parseApiKeys } from "@attestia/node";

const keys = parseApiKeys("sk-live-abc:admin:tenant-1,sk-live-def:viewer:tenant-2");

const { app } = createApp({
  serviceConfig: {
    ownerId: "default",
    defaultCurrency: "USDC",
    defaultDecimals: 6,
  },
  auth: {
    apiKeys: new Map(keys.map((k) => [k.key, k])),
    jwtSecret: process.env.JWT_SECRET,
  },
  rateLimit: { rpm: 100, burst: 20 },
});

Environment Configuration

All configuration is loaded from environment variables via Zod validation:

PORT=3000
HOST=0.0.0.0
LOG_LEVEL=info
NODE_ENV=production

# Auth
API_KEYS=sk-live-abc:admin:tenant-1,sk-live-def:operator:tenant-2
JWT_SECRET=your-secret
JWT_ISSUER=attestia

# Rate limiting
RATE_LIMIT_RPM=100
RATE_LIMIT_BURST=20

# Domain
DEFAULT_CURRENCY=USDC
DEFAULT_DECIMALS=6

Programmatic Usage (Testing)

import { createApp } from "@attestia/node";

const { app, tenantRegistry, metricsCollector } = createApp({
  serviceConfig: { ownerId: "test", defaultCurrency: "USDC", defaultDecimals: 6 },
});

// Direct request for testing (no HTTP server needed)
const res = await app.request("/api/v1/intents", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    id: "test-001",
    kind: "transfer",
    description: "Test intent",
    params: {},
  }),
});

API Endpoints

Authenticated (/api/v1/)

| Method | Path | Description | |---|---|---| | POST | /api/v1/intents | Declare a new intent | | GET | /api/v1/intents | List intents (paginated) | | GET | /api/v1/intents/:id | Get intent by ID | | POST | /api/v1/intents/:id/approve | Approve an intent | | POST | /api/v1/intents/:id/reject | Reject an intent | | POST | /api/v1/intents/:id/execute | Mark intent as executed | | POST | /api/v1/intents/:id/verify | Verify an intent | | GET | /api/v1/events | List all events | | GET | /api/v1/verify/hash | Get current GlobalStateHash | | POST | /api/v1/verify/replay | Full replay verification | | GET | /api/v1/proofs/merkle-root | Get current Merkle root | | GET | /api/v1/proofs/attestation/:id | Get attestation proof package | | GET | /api/v1/compliance/soc2 | SOC 2 compliance report | | GET | /api/v1/export/bundle | Export state bundle |

Public (No Auth)

| Method | Path | Description | |---|---|---| | POST | /public/v1/verify/bundle | Verify a state bundle | | POST | /public/v1/proofs/verify | Verify an attestation proof | | GET | /public/v1/compliance/frameworks | List available frameworks | | GET | /health | Health check | | GET | /metrics | Prometheus metrics |

Key Exports

| Export | Description | |---|---| | createApp() | Application factory returning AppInstance | | AttestiaService | Core service orchestrating all subsystems | | TenantRegistry | Multi-tenant service registry | | loadConfig() | Load and validate env config via Zod | | ConfigSchema | Zod schema for environment variables | | parseApiKeys() | Parse key:role:tenant formatted API key string |

Ecosystem

This package is part of the Attestia monorepo with 13 sister packages:

@attestia/types | @attestia/ledger | @attestia/registrum | @attestia/vault | @attestia/treasury | @attestia/event-store | @attestia/verify | @attestia/proof | @attestia/reconciler | @attestia/chain-observer | @attestia/witness | @attestia/sdk | @attestia/demo

Docs

| Document | Description | |---|---| | Architecture | System architecture overview | | API Reference | Full API documentation | | Deployment Guide | Production deployment guide |

License

MIT