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

@dimrev4/audit-core

v0.0.4

Published

OpenAPI client for @dimrev4/audit-core

Downloads

19

Readme

@dimrev4/audit-core SDK

TypeScript SDK for Audit Core API - OpenTelemetry-compliant tracing and audit logging client.

🚀 Features

  • 🕵️ Start, Update, and End Traces
  • 📝 Add Events to Traces
  • 🔐 Secure Access with API Key Authentication
  • 💪 100% TypeScript with full type safety
  • ⚡ Axios-based with interceptors support

📦 Installation

npm install @dimrev4/audit-core
# or
yarn add @dimrev4/audit-core
# or
pnpm add @dimrev4/audit-core

🔧 Quick Start

1. Setup

import { Configuration, TraceV1Api } from '@dimrev4/audit-core';

const config = new Configuration({
  basePath: 'https://api.yourdomain.com',
  apiKey: 'your-api-key',
});

const traceApi = new TraceV1Api(config);

2. Start a Trace

const startResponse = await traceApi.traceControllerStartTrace({
  name: 'CheckoutService.charge',
  kind: 'server',
  attributes: {
    'user.id': '12345',
    'order.id': 'order-abc',
  },
});

const { traceId, spanId } = startResponse.data;
console.log(`Trace started: ${traceId}, Span: ${spanId}`);

3. Add an Event

await traceApi.traceControllerAddEvent(traceId, {
  name: 'card.validated',
  attributes: {
    'card.type': 'visa',
  },
});

4. End a Trace

await traceApi.traceControllerEndTrace(traceId, {
  status: 'OK',
});

🏗️ API Overview

Trace (TraceV1Api)

  • POST /v1/traces/start - Start a new trace
  • POST /v1/traces/{traceId}/event - Add an event to a trace
  • POST /v1/traces/{traceId}/end - End a trace

🧪 Error Handling

import { AxiosError } from 'axios';

try {
  await traceApi.traceControllerStartTrace({ name: 'test-trace' });
} catch (error) {
  if (error instanceof AxiosError) {
    switch (error.response?.status) {
      case 400:
        console.error('Validation failed:', error.response.data.message);
        break;
      case 401:
        console.error('Unauthorized: Invalid API Key');
        break;
      case 404:
        console.error('Trace not found');
        break;
      default:
        console.error('API Error:', error.message);
    }
  }
}

⚙️ Advanced Configuration

Custom Axios Instance

import axios from 'axios';
import { Configuration, TraceV1Api } from '@dimrev4/audit-core';

const axiosInstance = axios.create({
  timeout: 15000,
});

const config = new Configuration({
  apiKey: process.env.AUDIT_API_KEY,
});
const traceApi = new TraceV1Api(config, undefined, axiosInstance);

🚨 Common Issues

| Issue | Solution | | ---------------------- | ------------------------------------- | | 401 Unauthorized | Check apiKey in Configuration | | 404 Not Found | Verify traceId is correct and active | | Validation Error (400) | Check request body against DTO schema |

🔗 Resources

  • API Docs: Available at /api endpoint (Swagger UI)
  • Repository: GitHub
  • Issues: GitHub Issues
  • License: Unlicense

🤝 Contributing

  1. Fork the repository
  2. Update OpenAPI spec for new features
  3. Run npm run generate to rebuild SDK
  4. Submit pull request with tests

Auto-generated from Audit Core API | Last Updated: Jan 2026