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

@snowleopard-ai/client

v0.3.1

Published

TypeScript client library for Snow Leopard APIs - works in both Node.js and browsers

Readme

Snow Leopard SDK for TypeScript

TypeScript client library for Snow Leopard APIs.

Works in both Node.js and browser environments!

Installation

npm install @snowleopard-ai/client
# or
yarn add @snowleopard-ai/client
# or
pnpm add @snowleopard-ai/client

Quick Start

import { SnowLeopardClient } from '@snowleopard-ai/client';

// Initialize the client
const client = new SnowLeopardClient({
  apiKey: 'your-api-key'
});

// Query your data in natural language
const response = await client.retrieve({
  userQuery: 'How many users signed up last month?',
  datafileId: 'your-datafile-id',
});

console.log(response.data);

// Stream responses
for await (const chunk of client.response({
  userQuery: 'Show me top 10 customers',
  datafileId: 'your-datafile-id',
})) {
  console.log(chunk);
}

await client.close();

Getting Started

  1. Get your API key from https://auth.snowleopard.ai/account/api_keys

  2. Upload your datafiles at https://try.snowleopard.ai

  3. Set your API key:

    • Via environment variable: Node.js -

      export SNOWLEOPARD_API_KEY="your-api-key"

      Browser & Node.js - Pass it directly to the client:

      new SnowLeopardClient({ apiKey: 'your-api-key' })

    Note: In browser environments, you must pass the API key in the constructor options. Environment variables are only supported in Node.js.

Usage

Basic Usage

import { SnowLeopardClient } from '@snowleopard-ai/client';

const client = new SnowLeopardClient();

// Get data directly from a natural language query
const response = await client.retrieve({
  userQuery: "What's the total revenue?",
  datafileId: 'datafile-id',
});
console.log(response.data);

// Stream natural language summary of live data
for await (const chunk of client.response({
  userQuery: 'Show me top 10 customers',
  datafileId: 'datafile-id',
})) {
  console.log(chunk);
}

await client.close();

With Known Data

You can provide additional context with the knownData parameter:

const response = await client.retrieve({
  userQuery: 'Show sales for this region',
  knownData: { region: 'North America' },
  datafileId: 'datafile-id',
});

Configuration Options

const client = new SnowLeopardClient({
  apiKey: 'your-api-key',          // Optional if SNOWLEOPARD_API_KEY is set
  baseURL: 'https://api.snowleopard.ai',  // Optional, defaults to production
  timeout: {
    connect: 5000,    // Connection timeout in ms (default: 5000)
    read: 600000,     // Read timeout in ms (default: 600000)
    write: 10000      // Write timeout in ms (default: 10000)
  }
});

Error Handling

import { SnowLeopardClient } from '@snowleopard-ai/client';

const client = new SnowLeopardClient({ apiKey: 'your-api-key' });

try {
  const response = await client.retrieve({
    datafileId: 'datafile-id',
    userQuery: 'Your query here'
  });

  // Check response status
  if (response.responseStatus === 'SUCCESS') {
    console.log('Query successful:', response.data);
  } else {
    console.error('Query failed:', response.responseStatus);
  }
} catch (error) {
  console.error('API Error:', error);
}

Compatibility

This package is designed to work in both Node.js and modern browsers:

  • Node.js 20.0.0 or higher
  • Modern Browsers with ES2020 support:
    • Chrome 80+
    • Firefox 74+
    • Safari 13.1+
    • Edge 80+

Key Features for Browser Support

  • Uses native fetch API for HTTP requests (works in both environments)
  • Browser-safe environment variable handling
  • TypeScript definitions include DOM types
  • Zero external dependencies for production

API Reference

SnowLeopardClient

constructor(options?)

Create a new client instance.

  • options.apiKey?: string - API key (defaults to SNOWLEOPARD_API_KEY env var)
  • options.baseURL?: string - Base API URL (defaults to https://api.snowleopard.ai)
  • options.timeout?: TimeoutConfig - Timeout configuration

retrieve({datafileId: datafileId, userQuery: userQuery, knownData: knownData?})

Retrieve data from a datafile using a natural language query.

  • datafileId: string - The ID of the datafile to query
  • userQuery: string - Natural language query
  • knownData?: Record<string, any> - Optional known data
  • Returns: Promise<RetrieveResponseObjects>

response({datafileId: datafileId, userQuery: userQuery, knownData: knownData?})

Stream natural language summary responses from a datafile query.

  • datafileId: string - The ID of the datafile to query
  • userQuery: string - Natural language query
  • knownData?: Record<string, any> - Optional known data
  • Returns: AsyncGenerator<ResponseDataObjects>

close()

Close the HTTP client and cleanup resources.

  • Returns: Promise<void>

License

MIT License - see LICENSE file for details

Support

For issues and questions: