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

@know-your-ai/core

v0.1.0

Published

Core library for Know Your AI SDK - AI model interception and monitoring

Readme

@know-your-ai/core

Core library for the Know Your AI SDK. This package provides the foundational components for AI monitoring and instrumentation.

Installation

This package is typically used through @know-your-ai/node. Direct installation is only needed for advanced use cases.

npm install @know-your-ai/core

Quick Start

Initialize the SDK with your API key obtained from the Know Your AI dashboard:

import * as KnowYourAI from '@know-your-ai/node';

KnowYourAI.init({
  apiKey: 'kya_your_api_key_here',
  integrations: [
    KnowYourAI.googleGenAIIntegration(),
  ],
});

// Your AI code will now be automatically monitored

Getting Your API Key

  1. Go to the Know Your AI dashboard
  2. Navigate to your Workspace > Products
  3. Select or create a Product
  4. Go to Settings > API Keys
  5. Create a new API key
  6. Copy the key (it will only be shown once!)

Configuration Options

KnowYourAI.init({
  // Required: Your API key from Know Your AI dashboard
  apiKey: 'kya_...',

  // Optional: Custom endpoint (defaults to Know Your AI backend)
  endpoint: 'https://api.knowyourai.dev/sdk/events',

  // Optional: Environment identifier
  environment: 'production', // 'development', 'staging', etc.

  // Optional: Control what data is captured
  recordInputs: true,  // Capture input messages
  recordOutputs: true, // Capture AI responses

  // Optional: Sampling rate (0.0 to 1.0)
  sampleRate: 1.0,

  // Optional: Enable debug logging
  debug: false,

  // Optional: Batch settings
  batchSize: 10,      // Events to batch before sending
  flushInterval: 5000, // Max time (ms) to wait before flushing

  // Required: Integrations to use
  integrations: [
    KnowYourAI.googleGenAIIntegration({
      recordInputs: true,
      recordOutputs: true,
    }),
  ],
});

What's Included

  • Client - Core client for managing integrations and capturing data
  • Integrations - Plugin system for adding AI provider support
  • Transports - Data transport implementations (HTTP, console, Know Your AI backend)
  • Types - TypeScript type definitions
  • Utilities - Helper functions and debug utilities

Available Transports

Know Your AI Transport (Default)

Automatically configured when using apiKey option.

HTTP Transport

For custom endpoints:

import { createHttpTransport } from '@know-your-ai/core';

const transport = createHttpTransport({
  endpoint: 'https://your-custom-endpoint.com/events',
  apiKey: 'your-custom-api-key',
});

Console Transport (Debugging)

import { createConsoleTransport } from '@know-your-ai/core';

const transport = createConsoleTransport();

License

MIT