Skip to main content
npm version The TopK JavaScript library provides convenient access to the TopK API from Node.js environments with full TypeScript support.

Installation

Building with a coding agent

Using Claude Code, Cursor, Codex, or another coding agent? Install the TopK skill so the agent writes correct TopK code. It covers schema design, chunking, hybrid queries, multi-tenancy, and the common mistakes.

Prerequisites

Usage

Handling errors

The SDK throws plain Error objects. Check err.message to identify the error:

Retries

The client automatically retries transient errors (server unavailable, network failures) and LSN consistency timeouts. Retry behaviour can be configured via retryConfig:

Requirements

Node.js 18 or higher.