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

@usewhisper/sdk

v1.0.1

Published

TypeScript SDK for Whisper Context API - Add reliable context to your AI agents

Readme

@usewhisper/sdk

Official TypeScript SDK for Whisper Context API - Give your AI agents perfect context.

Installation

npm install @usewhisper/sdk

Quick Start

import { WhisperContext } from '@usewhisper/sdk';

const whisper = new WhisperContext({ 
  apiKey: 'wctx_your_api_key_here'
});

// Create a project
const project = await whisper.createProject({
  name: 'my-docs',
  description: 'Documentation context'
});

// Ingest documents
await whisper.ingest(project.id, [
  {
    title: 'Authentication Guide',
    content: 'To authenticate users, use JWT tokens...',
    metadata: { category: 'auth' }
  }
]);

// Query context
const result = await whisper.query({
  project: 'my-docs',
  query: 'How do I authenticate users?',
  top_k: 5
});

console.log(result.context);

Authentication

Get your API key from the Whisper dashboard:

const whisper = new WhisperContext({
  apiKey: 'wctx_...',  // Your API key
  baseUrl: 'https://context.usewhisper.dev'  // Optional, defaults to production
});

Core Features

Context Query

const result = await whisper.query({
  project: 'my-docs',
  query: 'Your question here',
  top_k: 10,              // Number of results
  include_memories: true,  // Include conversational memory
  include_graph: true,     // Include knowledge graph
  hybrid: true,            // Hybrid vector + keyword search
  rerank: true            // Rerank results for better relevance
});

Project Management

// Create project
await whisper.createProject({ name: 'my-project' });

// List projects
const { projects } = await whisper.listProjects();

// Get project details
const project = await whisper.getProject(projectId);

// Delete project
await whisper.deleteProject(projectId);

Data Sources

Connect 15+ auto-sync sources:

// GitHub repository
await whisper.addSource(projectId, {
  name: 'GitHub Repo',
  connector_type: 'github',
  config: { 
    repo: 'owner/repo',
    token: 'ghp_...',
    branch: 'main'
  },
  sync_schedule: '0 */6 * * *'  // Sync every 6 hours
});

// Notion workspace
await whisper.addSource(projectId, {
  name: 'Notion Docs',
  connector_type: 'notion',
  config: { 
    token: 'secret_...',
    database_id: '...'
  }
});

// Sync source manually
await whisper.syncSource(sourceId);

Direct Ingestion

await whisper.ingest(projectId, [
  {
    title: 'Document Title',
    content: 'Document content...',
    metadata: { 
      author: 'John Doe',
      tags: ['api', 'docs']
    }
  }
]);

Conversational Memory

// Add memory
await whisper.addMemory({
  project: 'my-docs',
  content: 'User prefers dark mode',
  memory_type: 'factual',
  user_id: 'user123',
  importance: 0.8
});

// Search memories
const { memories } = await whisper.searchMemories({
  project: 'my-docs',
  query: 'user preferences',
  user_id: 'user123',
  top_k: 10
});

Supported Connectors

  • GitHub - Repositories, issues, PRs
  • GitLab - Projects, issues, MRs
  • Notion - Pages, databases
  • Confluence - Spaces, pages
  • Slack - Channels, messages
  • Discord - Channels, messages
  • URLs - Web pages
  • Sitemaps - Entire websites
  • PDFs - PDF documents
  • API Specs - OpenAPI/Swagger
  • Databases - PostgreSQL, MySQL
  • npm - Package documentation
  • PyPI - Package documentation
  • arXiv - Research papers
  • HuggingFace - Model docs

API Reference

WhisperContext

Constructor

new WhisperContext(config: {
  apiKey: string;
  baseUrl?: string;
})

Methods

Projects:

  • createProject(params) - Create a new project
  • listProjects() - List all projects
  • getProject(id) - Get project details
  • deleteProject(id) - Delete a project

Sources:

  • addSource(projectId, params) - Add a data source
  • listSources(projectId) - List project sources
  • syncSource(sourceId) - Manually sync a source
  • updateSource(sourceId, params) - Update source config
  • deleteSource(sourceId) - Delete a source

Context:

  • query(params) - Query context from your data
  • ingest(projectId, documents) - Directly ingest documents

Memory:

  • addMemory(params) - Add conversational memory
  • searchMemories(params) - Search memories
  • listMemories(params) - List all memories
  • updateMemory(id, params) - Update a memory
  • deleteMemory(id) - Delete a memory

API Keys:

  • createApiKey(params) - Create a new API key
  • listApiKeys() - List all API keys
  • deleteApiKey(id) - Delete an API key

Usage:

  • getUsage(days) - Get usage statistics

Error Handling

try {
  const result = await whisper.query({
    project: 'my-docs',
    query: 'test'
  });
} catch (error) {
  if (error.message.includes('401')) {
    console.error('Invalid API key');
  } else if (error.message.includes('404')) {
    console.error('Project not found');
  } else {
    console.error('Query failed:', error.message);
  }
}

TypeScript Support

Full TypeScript support with type definitions included:

import { WhisperContext, QueryParams, QueryResult } from '@usewhisper/sdk';

Links

License

MIT