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

gettraceai

v0.1.0

Published

TraceAI Node.js SDK — log AI hiring decisions with tamper-evident audit trails

Readme

TraceAI Node.js SDK

Log every AI hiring decision with tamper-evident audit trails. Built for UK regulatory compliance (UK GDPR, Equality Act, ICO guidance).

Installation

npm install gettraceai

Quick Start (5 lines)

import { TraceAI } from 'gettraceai';

const trace = new TraceAI({ apiKey: 'sk_live_...' });

await trace.log({
  decisionType: 'cv_screening',
  inputs: { candidateId: 'c_abc123', cvText: 'Senior engineer...' },
  output: { score: 0.82, decision: 'shortlist' },
});

That's it. Every AI decision is now logged with a tamper-evident audit trail.

Full Example

import { TraceAI } from 'gettraceai';

const trace = new TraceAI({
  apiKey: 'sk_live_...',
  baseUrl: 'https://api.traceai.dev/v1', // optional, for self-hosted
  timeout: 10000, // milliseconds
  retries: 3,     // retry 5xx errors
  silent: true,   // don't crash your pipeline on errors
});

// Log a single decision
const result = await trace.log({
  decisionType: 'cv_screening',
  inputs: { candidateId: 'c_abc123', cvText: '...' },
  output: { score: 0.82, decision: 'shortlist', reasons: ['skills_match'] },
  model: { name: 'gpt-4o', version: '2025-03', provider: 'openai' },
  actor: { userId: 'recruiter_42', role: 'hiring_manager' },
  confidence: 0.82,
  metadata: { department: 'engineering', location: 'london' },
});
// result: { id: "d_...", hash: "...", status: "logged" }

// Fire-and-forget (non-blocking)
trace.logAsync({
  decisionType: 'cv_screening',
  inputs: { candidateId: 'c_def456' },
  output: { score: 0.45, decision: 'reject' },
});

// Batch log (up to 100 decisions)
await trace.logBatch([
  { decisionType: 'cv_screening', inputs: { candidateId: 'c_1' }, output: { decision: 'shortlist' } },
  { decisionType: 'cv_screening', inputs: { candidateId: 'c_2' }, output: { decision: 'reject' } },
]);

Error Handling

By default (silent: true), the SDK never crashes your pipeline. Errors are logged to stderr and methods return null.

Set silent: false for strict mode during development:

import { TraceAI, TraceAIError } from 'gettraceai';

const trace = new TraceAI({ apiKey: 'sk_live_...', silent: false });

try {
  await trace.log({
    decisionType: 'cv_screening',
    inputs: { candidateId: 'c_abc123' },
    output: { decision: 'shortlist' },
  });
} catch (err) {
  if (err instanceof TraceAIError) {
    console.error(err.statusCode);     // HTTP status code (if applicable)
    console.error(err.responseBody);   // Parsed response body (if applicable)
  }
}

API Reference

new TraceAI(options)

Create a client instance.

| Option | Type | Default | Description | |--------|------|---------|-------------| | apiKey | string | required | Your TraceAI API key | | baseUrl | string | https://api.traceai.dev/v1 | API base URL | | timeout | number | 10000 | Request timeout in milliseconds | | retries | number | 3 | Retries for 5xx/network errors | | silent | boolean | true | Suppress errors (return null instead of throwing) |

trace.log(options): Promise<LogResponse | null>

Log a single decision.

| Option | Type | Required | Description | |--------|------|----------|-------------| | decisionType | string | Yes | Type of decision (e.g. 'cv_screening') | | inputs | object | Yes | What the AI received | | output | object | Yes | What the AI decided | | model | object | No | Model name, version, provider | | actor | object | No | User ID, role, authority level | | confidence | number | No | Confidence score 0-1 | | humanOverride | object | No | Human override details | | metadata | object | No | Additional context |

trace.logAsync(options): void

Same parameters as log(), but fire-and-forget (does not await the result).

trace.logBatch(decisions): Promise<BatchResponse | null>

Log up to 100 decisions in a single request. Each decision object must include decisionType, inputs, and output.

License

MIT