Supported Runtimes and Environments
masterThe SDK provides TypeScript types and supports the following environments:
- Node.js: ESM and CJS (requires version
>= 18.0.0) - Deno
- Browser: via the
fetchAPI - Cloudflare Workers: OpenAPI only
repository·master·Indexed 19 days ago
https://github.com/qdrant/qdrant-jsA JavaScript/TypeScript SDK for the Qdrant vector search engine. It provides clients for both REST and gRPC protocols via the @qdrant/qdrant-js, @qdrant/js-client-rest, and @qdrant/js-client-grpc packages. The SDK supports Node.js (>= 18.0.0), Deno, Browser (via fetch API), and Cloudflare Workers.
The SDK provides TypeScript types and supports the following environments:
>= 18.0.0)fetch APITo use the Qdrant REST client in a Node.js project, install the @qdrant/js-client-rest package via npm.
npm install --save @qdrant/js-client-restThe SDK uses GitHub Actions with trusted publishing to publish to npm without needing an NPM_TOKEN.
In the npmjs.com settings for @qdrant/js-client-rest, @qdrant/js-client-grpc, and @qdrant/qdrant-js, configure the following under Settings → Trusted publishing → GitHub Actions:
| Field | Value |
|---|---|
| Organization or user | qdrant |
| Repository | qdrant-js |
| Workflow filename | release.yaml |
| Environment name | (empty) |
| Allowed actions | npm publish |
Workflow Requirements:
permissions: id-token: write.pnpm >= 11.1.x (earlier versions had OIDC exchange bugs).pnpm/action-setup is >= v6.0.6._authToken in .npmrc or set registry-url in actions/setup-node.repository.url in each package.json must match the actual repository URL.To update the REST client, navigate to the REST client directory and run the OpenAPI codegen script.
By default, the OpenAPI schema is pulled from the dev branch of the Qdrant repository. You can modify the source URL in packages/js-client-rest/package.json under config.openapi_schema_remote if you need to target a different branch (e.g., master).
Generated files include:
src/openapi/generated_schema.tssrc/openapi/generated_client_type.tssrc/openapi/genetated_api_client.tscd packages/js-client-rest
pnpm codegen:openapi-typescriptYou can install the lightweight REST client for Qdrant using your preferred package manager. The main package is @qdrant/js-client-rest.
pnpm i @qdrant/js-client-rest
# or
npm install @qdrant/js-client-rest
# or
yarn add @qdrant/js-client-restWhen releasing, you must update the version string across all relevant files (package.json, client-version.ts, CHANGELOG.md, etc.).
To find all files containing a specific version (e.g., 1.15.0), use:
grep -rn --exclude-dir=node_modules --exclude-dir=dist --exclude-dir=.git '1\.15\.0'To quickly edit all identified files using vi:
for i in $(grep -rn --exclude-dir=node_modules --exclude-dir=dist --exclude-dir=.git '1\.15\.0' | cut -d ':' -f1 | uniq); do vi $i;doneImportant files to update:
package.json (version and workspace dependencies)src/client-version.ts (PACKAGE_VERSION)CHANGELOG.md (New entries)scripts/integration-tests.sh (QDRANT_LATEST)examples/**/package.json (SDK version constraint)To use the SDK with a local instance of Qdrant, you can run the official Docker container mapping port 6333.
docker run -p 6333:6333 qdrant/qdrantYou can install the Qdrant JavaScript SDK using pnpm, npm, or yarn.
pnpm i @qdrant/qdrant-js
# or
npm install @qdrant/qdrant-js
# or
yarn add @qdrant/qdrant-jsTo connect to a managed Qdrant Cloud instance, initialize the QdrantClient with your specific Cloud url and your apiKey. You can obtain your API key from the Qdrant Cloud console.
import {QdrantClient} from '@qdrant/js-client-rest';
const client = new QdrantClient({
url: 'https://xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.us-east-0-1.aws.cloud.qdrant.io',
apiKey: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
});Releasing a new version of the Qdrant JS SDK involves generating new clients from the Qdrant server schemas (gRPC and REST), updating the SDK code to match the new API, updating version numbers across the monorepo, and publishing via GitHub Actions using trusted publishing.
pnpm 10Install dependencies:
pnpm installThe SDK provides two types of clients. The REST client is the default entry point and is recommended for initial development due to ease of debugging. The gRPC client is available via a subpath and is optimized for high-performance scenarios involving large data chunks.
import {QdrantClient} from '@qdrant/qdrant-js'; // REST client
import {QdrantClient} from '@qdrant/qdrant-js/grpc'; // gRPC client