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

@nxtg/faultline-sdk

v0.5.0

Published

TypeScript SDK for Faultline — the only AI safety platform not owned by an AI lab.

Readme

@nxtg/faultline-sdk

TypeScript SDK for the Faultline Pro API — AI claim forensics and EU AI Act compliance reporting.

Install

npm install @nxtg/faultline-sdk

Quick start

import { FaultlineClient } from '@nxtg/faultline-sdk';

const client = new FaultlineClient({
  apiKey: process.env.FAULTLINE_API_KEY!,
  // baseUrl defaults to 'http://localhost:3000'
});

// Scan text for claim forensics
const result = await client.scan(
  'GPT-4 was released in March 2023 and scored in the 90th percentile on the bar exam.',
);
console.log(result.overallRisk);        // 'low' | 'medium' | 'high' | 'critical'
console.log(result.claims.length);      // number of extracted claims
console.log(result.complianceReport);   // EU AI Act compliance detail

// Create an API key (admin only)
const key = await client.createKey('CI pipeline', ['scan', 'report']);
console.log(key.key); // raw key value — store it now, cannot be retrieved again

All methods

Scan

// Scan a single text
const result: ScanResult = await client.scan(text, provider?);

// Scan multiple texts concurrently (1–10)
const batch: BatchScanResponse = await client.scanBatch(texts, provider?);

// Generate a PDF compliance report (returns ArrayBuffer)
const pdf: ArrayBuffer = await client.scanReport(text, provider?, projectName?);

Keys (admin only)

// Create a key — key.key is the raw value, shown only once
const key: ApiKey = await client.createKey(name, permissions?);

// List all keys (raw key value omitted)
const keys: ApiKey[] = await client.listKeys();

// Delete a key permanently
await client.deleteKey(id);

Usage

// Get per-day scan counts for the authenticated key
const usage: UsageResponse = await client.getUsage();
// usage.usage is a Record<string, number> keyed by YYYY-MM-DD

Dashboard (admin only)

const dashboard: DashboardResponse = await client.getDashboard();
dashboard.scans.today;              // total scans today
dashboard.riskDistribution.high;    // count of high-risk scans
dashboard.keyUsage;                 // per-key counts for today

Webhooks (admin only)

// Register a webhook — result.secret is shown only once
const webhook: Webhook = await client.createWebhook(url, events, secret?);

// List webhooks (secret omitted)
const webhooks: WebhookPublic[] = await client.listWebhooks();

// Delete a webhook
await client.deleteWebhook(id);

Error handling

All methods throw FaultlineError on non-2xx responses.

import { FaultlineClient, FaultlineError } from '@nxtg/faultline-sdk';

try {
  await client.scan('some text');
} catch (err) {
  if (err instanceof FaultlineError) {
    console.error(`API error ${err.status}:`, err.message);
    // err.body contains the raw response body
  }
}

Environment variable pattern

const client = new FaultlineClient({
  apiKey: process.env.FAULTLINE_API_KEY!,
  baseUrl: process.env.FAULTLINE_BASE_URL, // optional
});