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

@honeyhive/logger

v0.1.13

Published

A JavaScript logger for HoneyHive that helps you track and monitor your AI applications

Readme

HoneyHive Logger

A JavaScript logger for HoneyHive that helps you track and monitor your AI applications.

Installation

npm install @honeyhive/logger

Usage

const { start, log, update } = require('@honeyhive/logger');

// Start a new session
const sessionId = await start({
    apiKey: "your-api-key",
    project: "your-project"
});

// Log an event
const eventId = await log({
    sessionId: sessionId,
    eventName: "model_inference",
    eventType: "model",
    inputs: { prompt: "Hello world" },
    outputs: { response: "Hi there!" }
});

// Update an event with additional data
await update({
    eventId: eventId, // Can also pass sessionId to update a session
    feedback: { rating: 5 },
    metrics: { latency: 100 }
});

API Reference

start(options)

Starts a new session with HoneyHive.

Parameters:

  • options (Object):
    • apiKey (string, optional): Your HoneyHive API key. Must be provided or set via HH_API_KEY env var.
    • project (string, optional): The project name. Must be provided or set via HH_PROJECT env var.
    • sessionName (string, optional): Optional tag to filter sessions on "v1", "au1i249c" (commit hash), etc. Defaults to project name.
    • source (string, optional): Environment where the code is running. Defaults to "dev" or HH_SOURCE env var.
    • config (Object, optional): Configuration details for the session like experiment versions, model names, etc.
    • inputs (Object, optional): Input parameters for the session.
    • metadata (Object, optional): Additional metadata for the session.
    • userProperties (Object, optional): User-defined properties for the session.
    • sessionId (string, optional): A valid UUIDv4 for the session to correlate with your logs. If not provided, one will be generated.
    • serverUrl (string, optional): HoneyHive API server URL. Defaults to "https://api.honeyhive.ai" or HH_API_URL env var.
    • verbose (boolean, optional): Print detailed error messages for debugging. Defaults to false.

Returns:

  • Promise<string>: The session ID (UUIDv4)

Example:

const sessionId = await start({
    apiKey: "your-api-key",
    project: "your-project",
    sessionName: "v1",
    source: "prod",
    config: {
        model: "gpt-4",
        temperature: 0.7
    }
});

log(options)

Logs an event to HoneyHive.

Parameters:

  • options (Object):
    • apiKey (string, optional): Your HoneyHive API key. Must be provided or set via HH_API_KEY env var.
    • project (string, optional): The project name. Must be provided or set via HH_PROJECT env var.
    • source (string, optional): Environment where the code is running. Defaults to "dev" or HH_SOURCE env var.
    • eventName (string): Name of the event being logged. Required.
    • eventType (string, optional): Type of event - "model", "tool", or "chain". Defaults to "tool".
    • config (Object, optional): Configuration details for the event like model name, vector index name, etc.
    • inputs (Object, optional): Input parameters for the event.
    • outputs (Object, optional): Output data from the event.
    • metadata (Object, optional): Additional metadata for the event.
    • sessionId (string): The ID of the session to log the event under. If not provided, a session is automatically created.
    • durationMs (number, optional): Duration of the event in milliseconds. If not provided, will be set to 10.
    • serverUrl (string, optional): HoneyHive API server URL. Defaults to "https://api.honeyhive.ai" or HH_API_URL env var.
    • verbose (boolean, optional): Print detailed error messages for debugging. Defaults to false.

Returns:

  • Promise<string>: The event ID (UUIDv4)

Example:

const eventId = await log({
    sessionId: "your-session-id",
    eventName: "model_inference",
    eventType: "model",
    config: {
        model: "gpt-4",
        temperature: 0.7
    },
    inputs: {
        prompt: "Hello world"
    },
    outputs: {
        response: "Hi there!"
    }
});

update(options)

Updates an event or session with additional data.

Parameters:

  • options (Object):
    • apiKey (string, optional): Your HoneyHive API key. Must be provided or set via HH_API_KEY env var.
    • eventId (string): The ID to update. This can be either:
      • A session_id returned from start()
      • An event_id returned from log()
    • metadata (Object, optional): Additional metadata for the event/session.
    • feedback (Object, optional): User feedback for the event/session.
    • metrics (Object, optional): Metrics computed for the event/session.
    • config (Object, optional): Configuration used in the event/session.
    • outputs (Object, optional): Output data from the event/session.
    • userProperties (Object, optional): User-defined properties for the event/session.
    • durationMs (number, optional): Duration of the event in milliseconds.
    • serverUrl (string, optional): HoneyHive API server URL. Defaults to "https://api.honeyhive.ai" or HH_API_URL env var.
    • verbose (boolean, optional): Print detailed error messages for debugging. Defaults to false.

Returns:

  • Promise<void>

Example:

// Update a session
await update({
    eventId: sessionId,
    metadata: {
        status: "completed"
    }
});

// Update an event
await update({
    eventId: eventId,
    feedback: {
        rating: 5,
        comment: "Great response!"
    },
    metrics: {
        latency: 100,
        tokens: 50
    }
});

Error Handling

The logger will throw errors for:

  • Invalid API keys
  • Network errors
  • Invalid parameters
  • Server errors

Each error includes detailed information about what went wrong and how to fix it. For example:

  • Missing required parameters
  • Invalid event types
  • API key or project not found
  • Network connectivity issues
  • Server-side errors

Documentation

For detailed documentation, please visit https://docs.honeyhive.ai

License

MIT License