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

@gatewaystack/explicabl

v0.0.6

Published

**Explicabl** is GatewayStack’s **explainability & audit layer**. It emits a **structured JSON event for every request** flowing through the GatewayStack pipeline, enabling:

Readme

@gatewaystack/explicabl

Explicabl is GatewayStack’s explainability & audit layer.
It emits a structured JSON event for every request flowing through the GatewayStack pipeline, enabling:

  • request-level audit trails
  • debugging & developer visibility
  • future SIEM / OTEL / Cloud Logging sinks
  • full traceability across Identifiabl → Proxyabl → Explicabl

This is the MVP implementation, focused on being simple, predictable, and production-safe.


Features

  • Single structured JSON event per request
  • Includes HTTP metadata (method, path, status, latency), request ID, and context (identity, routing, limits)
  • Safe — logging failures never break responses
  • Zero dependencies beyond Express
  • Pluggable logger function with built-in console logger (createConsoleLogger)
  • Compatible with @gatewaystack/request-context, @gatewaystack/identifiabl, @gatewaystack/proxyabl

Installation

npm install @gatewaystack/explicabl

Quick Start

1. Create a logger

import { createConsoleLogger } from "@gatewaystack/explicabl";

const logger = createConsoleLogger({
  serviceName: "gateway-server",
  environment: process.env.NODE_ENV,
});

2. Add the middleware after you create request context

import { explicablLoggingMiddleware } from "@gatewaystack/explicabl";

app.use(explicablLoggingMiddleware(logger));

Explicabl will now emit one event for every request:

[explicabl] {"ts":"2025-01-01T00:00:00.000Z","kind":"gateway.request", ...}

API

createConsoleLogger(config)

Creates a logger that writes one JSON line per event to stdout.

const logger = createConsoleLogger({
  serviceName?: string;
  environment?: string;
});

explicablLoggingMiddleware(logger)

Express middleware that emits one ExplicablEvent after every response.

app.use(explicablLoggingMiddleware(logger));

explicablRouter(env)

Optional router that exposes:

  • /health endpoints
  • /webhooks/auth0 for ingesting Auth0 log events
app.use("/explicabl", explicablRouter(process.env));

Event Format (ExplicablEvent)

interface ExplicablEvent {
  ts: string;               // timestamp
  kind: "gateway.request";
  serviceName?: string;
  environment?: string;
  requestId?: string;

  http: {
    method: string;
    path: string;
    status: number;
    latencyMs?: number;
  };

  context?: unknown; // identity, authz, limits, routing...
}

Future versions will expand this with:

  • token usage
  • policy decisions
  • rate-limit metadata
  • model/tool routing info
  • richer sinks (OTEL, Cloud Logging, ClickHouse, etc.)

Testing

Explicabl ships with full unit tests:

  • logger enrichment
  • middleware events
  • error handling
  • context propagation

Run:

npm test

Roadmap

  • explicabl-core package with shared event schema (non-Express)
  • OTEL/trace/span support
  • Token usage + cost attribution
  • Policy explainability integration (Validatabl)
  • ClickHouse / BigQuery / Cloud Logging sinks
  • GatewayStack UI integration for audit trails
  • “Replay this request” developer tools

License

MIT © GatewayStack