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

@cognipeer/cgate-sdk

v1.0.3

Published

TypeScript SDK for CognipeerAI Gateway - Multi-tenant AI services platform

Readme

CognipeerAI Gateway SDK

Official TypeScript/JavaScript SDK for CognipeerAI Gateway - A multi-tenant SaaS platform for AI and Agentic services.

npm version TypeScript License: MIT

Features

  • 🤖 Chat Completions - OpenAI-compatible chat API with streaming support
  • 📊 Embeddings - Text vectorization for semantic search
  • 🗄️ Vector Operations - Manage vector databases (Pinecone, Chroma, Qdrant, etc.)
  • 📁 File Management - Upload and manage files with markdown conversion
  • 🔍 Agent Tracing - Observability for agent executions
  • 🔒 Type-Safe - Full TypeScript support with comprehensive types
  • Modern - ESM and CommonJS support, works in Node.js and browsers

Installation

npm install @cognipeer/cgate-sdk
yarn add @cognipeer/cgate-sdk
pnpm add @cognipeer/cgate-sdk

Quick Start

import { CGateClient } from '@cognipeer/cgate-sdk';

// Initialize the client
const client = new CGateClient({
  apiKey: 'your-api-key',
  baseURL: 'https://api.cognipeer.com', // Optional, defaults to production
});

// Chat completion
const response = await client.chat.completions.create({
  model: 'gpt-4',
  messages: [
    { role: 'system', content: 'You are a helpful assistant.' },
    { role: 'user', content: 'Hello!' },
  ],
});

console.log(response.choices[0].message.content);

// Streaming chat
const stream = await client.chat.completions.create({
  model: 'gpt-4',
  messages: [{ role: 'user', content: 'Tell me a story' }],
  stream: true,
});

for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0]?.delta?.content || '');
}

// Create embeddings
const embeddings = await client.embeddings.create({
  model: 'text-embedding-3-small',
  input: 'Hello, world!',
});

console.log(embeddings.data[0].embedding);

// Vector operations
await client.vectors.upsert('my-provider', 'my-index', {
  vectors: [
    {
      id: 'vec1',
      values: [0.1, 0.2, 0.3],
      metadata: { text: 'Hello world' },
    },
  ],
});

const results = await client.vectors.query('my-provider', 'my-index', {
  query: {
    vector: [0.1, 0.2, 0.3],
    topK: 5,
  },
});

// File upload
const file = await client.files.upload('my-bucket', {
  fileName: 'document.pdf',
  data: 'data:application/pdf;base64,JVBERi0xLjQK...',
  convertToMarkdown: true,
});

Documentation

Full documentation is available at cognipeer.github.io/cgate-sdk

API Reference

Client Configuration

const client = new CGateClient({
  apiKey: string;          // Required: Your API token
  baseURL?: string;        // Optional: API base URL (default: https://api.cognipeer.com)
  timeout?: number;        // Optional: Request timeout in ms (default: 60000)
  maxRetries?: number;     // Optional: Max retry attempts (default: 3)
  fetch?: typeof fetch;    // Optional: Custom fetch implementation
});

Available Methods

Chat

  • client.chat.completions.create(params) - Create chat completion (streaming supported)

Embeddings

  • client.embeddings.create(params) - Create embeddings

Vectors

  • client.vectors.providers.list(query?) - List vector providers
  • client.vectors.providers.create(data) - Create vector provider
  • client.vectors.indexes.list(providerKey) - List indexes
  • client.vectors.indexes.create(providerKey, data) - Create index
  • client.vectors.indexes.get(providerKey, indexId) - Get index details
  • client.vectors.indexes.update(providerKey, indexId, data) - Update index
  • client.vectors.indexes.delete(providerKey, indexId) - Delete index
  • client.vectors.upsert(providerKey, indexId, data) - Upsert vectors
  • client.vectors.query(providerKey, indexId, query) - Query vectors
  • client.vectors.delete(providerKey, indexId, ids) - Delete vectors

Files

  • client.files.buckets.list() - List buckets
  • client.files.buckets.get(bucketKey) - Get bucket details
  • client.files.list(bucketKey, query?) - List files
  • client.files.upload(bucketKey, data) - Upload file

Tracing

  • client.tracing.ingest(data) - Ingest tracing session

Examples

Check out the examples directory for more detailed usage:

Contributing

We welcome contributions! Please see our Contributing Guide for details.

License

MIT © CognipeerAI

Support