JavaScript and TypeScript
The TypeScript client supports code that is written in TypeScript or JavaScript.
The v3 client is the current TypeScript client. If you have code written for the v2 client, you should migrate it to v3 as the v2 client is no longer maintained.
Installation
Section titled “Installation”This section details how install and configure the v3 TypeScript client.
Install the package
Section titled “Install the package”The v3 client package has a new name, weaviate-client. Use npm to install the TypeScript client library package:
npm install weaviate-clientImport the Client
Section titled “Import the Client”The v3 client uses ES Modules. Most of the sample code in the documentation also uses the ES Module style.
If your code requires CommonJS compatibility, use the CommonJS import style:
import weaviate from "weaviate-client";const weaviate = require("weaviate-client").default;TypeScript setup
Section titled “TypeScript setup”Edit your project's configuration files to make these changes:
- Add
"type": "module"topackage.json - Add the following code to
tsconfig.json
tsconfig.json file
{
"compilerOptions": {
"target": "ESNext",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"esModuleInterop": true,
"skipLibCheck": true,
"allowSyntheticDefaultImports": true,
"strict": true
},
"include": ["src/index.ts"] // this compiles only src/.index.ts, to compile all .ts files, use ["*.ts"]
}Get started
Section titled “Get started”The following code demonstrates how to:
- Connect to a local Weaviate instance.
- Create a new collection.
- Populate the database using batch import and vectorize the data.
- Perform a vector search.
import weaviate, { WeaviateClient, vectors } from 'weaviate-client';const client: WeaviateClient = await weaviate.connectToLocal();await client.collections.create({ name: 'Question', vectorizers: vectors.text2VecOllama({ // Configure the Ollama embedding integration apiEndpoint: 'http://ollama:11434', // If using Docker you might need: http://host.docker.internal:11434 model: 'nomic-embed-text', // The model to use }),});// Load dataasync function getJsonData() { const file = await fetch( 'https://raw.githubusercontent.com/weaviate-tutorials/quickstart/main/data/jeopardy_tiny.json' ); return file.json();}// Note: The TS client does not have a `batch` method yet// We use `insertMany` instead, which sends all of the data in one requestasync function importQuestions() { const questions = client.collections.use('Question'); const data = await getJsonData(); const result = await questions.data.insertMany(data); console.log('Insertion response: ', result);}await importQuestions();const questions = client.collections.use('Question');const result = await questions.query.nearText('biology', { limit: 2,});result.objects.forEach((item) => { console.log(JSON.stringify(item.properties, null, 2));});client.close(); // Close the client connectionAsynchronous usage
Section titled “Asynchronous usage”All client v3 methods, with the exception of collection.use(), use ES6 Promises with asynchronous code. This means you have to use .then() after function calls, or wrap your code async/await blocks.
When there is an asynchronous code error, a promise returns the specific error message. If you use async and await, a rejected promises acts like a thrown exception
Releases
Section titled “Releases”Go to the GitHub releases page to see the history of the TypeScript client library releases and change logs.
Click here for a table of Weaviate and corresponding client versions
This table lists recent Weaviate Database versions and corresponding client library versions.
| Weaviate Database ([GitHub][cWeaviate]) | First release date | Python ([GitHub][cPython]) | TypeScript/ JavaScript ([GitHub][cTypeScript]) | Go ([GitHub][cGo]) | Java ([GitHub][cJava]) | C# ([GitHub][cCSharp]) |
|---|---|---|---|---|---|---|
| 1.39.x | 2026-08-04 | 4.23.x | - | - | 6.3.1 | 1.2.0 |
| 1.38.x | 2026-06-05 | 4.22.x | 3.14.x | - | 6.3.0 | 1.2.0 |
| 1.37.x | 2026-04-16 | 4.21.x | 3.13.x | 5.7.3 | 6.2.0 | 1.1.1 |
| 1.36.x | 2026-02-24 | 4.20.x | 3.12.x | 5.7.x | 6.1.0 | 1.0.1 |
| 1.35.x | 2025-12-17 | 4.19.x | 3.11.x | 5.6.x | 6.0.0 | 1.0.0 |
Older releases
| Weaviate Database (GitHub) | First release date | Python (GitHub) | TypeScript/ JavaScript (GitHub) | Go (GitHub) | Java (GitHub) |
|---|---|---|---|---|---|
| 1.34.x | 2025-11-05 | 4.18.x | 3.10.x | 5.6.x | 6.0.0 |
| 1.33.x | 2025-09-25 | 4.17.x | 3.9.x | 5.5.x | 5.5.x |
| 1.32.x | 2025-07-14 | 4.16.x | 3.8.x | 5.3.x | 5.4.x |
| 1.31.x | 2025-05-30 | 4.15.x | 3.6.x | 5.2.x | 5.3.x |
| 1.30.x | 2025-04-03 | 4.12.x | 3.5.x | 5.1.x | 5.2.x |
| 1.29.x | 2025-02-17 | 4.11.x | 3.4.x | 5.0.x | 5.1.x |
| 1.28.x | 2024-12-11 | 4.10.x | 3.3.x | 4.16.x | 5.0.x |
| 1.27.x | 2024-10-16 | 4.9.x | 3.2.x | 4.16.x | 5.0.x 4.9.x |
| 1.26.x | 2024-07-22 | 4.7.x | 3.1.x | 4.15.x | 4.8.x |
| 1.25.x | 2024-05-10 | 4.6.x | 2.1.x | 4.13.x | 4.6.x |
| 1.24.x | 2024-02-27 | 4.5.x | 2.0.x | 4.10.x | 4.4.x |
| 1.23.x | 2023-12-18 | 3.26.x | 1.5.x | 4.10.x | 4.4.x |
| 1.22.x | 2023-10-27 | 3.25.x | 1.5.x | 4.10.x | 4.3.x |
| 1.21.x | 2023-08-17 | 3.22.x | 1.4.x | 4.9.x | 4.2.x |
| 1.20.x | 2023-07-06 | 3.22.x | 1.1.x | 4.7.x | 4.2.x |
| 1.19.x | 2023-05-04 | 3.17.x | 1.1.x1 | 4.7.x | 4.0.x |
| 1.18.x | 2023-03-07 | 3.13.x | 2.14.x | 4.6.x | 3.6.x |
| 1.17.x | 2022-12-20 | 3.9.x | 2.14.x | 4.5.x | 3.5.x |
| 1.16.x | 2022-10-31 | 3.8.x | 2.13.x | 4.4.x | 3.4.x |
| 1.15.x | 2022-09-07 | 3.6.x | 2.12.x | 4.3.x | 3.3.x |
| 1.14.x | 2022-07-07 | 3.6.x | 2.11.x | 4.2.x | 3.2.x |
| 1.13.x | 2022-05-03 | 3.4.x | 2.9.x | 4.0.x | 2.4.x |
| 1.12.x | 2022-04-05 | 3.4.x | 2.8.x | 3.0.x | 2.3.x |
| 1.11.x | 2022-03-14 | 3.2.x | 2.7.x | 2.6.x | 2.3.x |
| 1.10.x | 2022-01-27 | 3.1.x | 2.5.x | 2.4.x | 2.1.x |
| 1.9.x | 2021-12-10 | 3.1.x | 2.4.x | 2.4.x | 2.1.x |
| 1.8.x | 2021-11-30 | 3.1.x | 2.4.x | 2.3.x | 1.1.x |
| 1.7.x | 2021-09-01 | 3.1.x | 2.4.x | 2.3.x | 1.1.x |
| 1.6.x | 2021-08-11 | 2.4.x | 2.3.x | 2.2.x | 1.0.x |
| 1.5.x | 2021-07-13 | 2.2.x | 2.1.x | 2.1.x | 1.0.x |
| 1.4.x | 2021-06-09 | 2.2.x | 2.1.x | 2.1.x | 1.0.x |
| 1.3.x | 2021-04-23 | 2.2.x | 2.1.x | 2.1.x | 1.0.x |
| 1.2.x | 2021-03-15 | 2.2.x | 2.0.x | 1.1.x | - |
| 1.1.x | 2021-02-10 | 2.1.x | - | - | - |
| 1.0.x | 2021-01-14 | 2.0.x | - | - | - |
TypeScript client change
The TypeScript client replaced the JavaScript client on 2023-03-17.
Vectorizer API changes v3.8.0
Section titled “Vectorizer API changes v3.8.0”Starting with the Weaviate JS/TS client v3.8.0, there are multiple changes to the vectorizer configuration API when creating collections:
configure.vectorizerhas been replaced withconfigure.vectorsconfigure.multiVectorshas been added to enable users work with Multi-vectorsconfigure.vectorizer.nonehave been replaced withconfigure.vectors.selfProvided
JavaScript/TypeScript client v2 deprecation
Section titled “JavaScript/TypeScript client v2 deprecation”The Weaviate JavaScript/TypeScript client v2 has been deprecated and should no longer be used. If you need documentation for the v2 client, see the documentation archive. If you are migrating from the JavaScript/TypeScript v2 client to the v3 client, see this migration guide.
Code examples & further resources
Section titled “Code examples & further resources”Usage information for various operations and features can be found throughout the Weaviate documentation.
How-to: Configure Weaviate
Configure compression, backups, authentication, authorization, data replication and more.
How-to: Manage collections
Manage collections (CRUD), configure vectorizers and index parameters, set up multi-tenancy, and perform migrations.
How-to: Manage objects
Adding new objects, fetching existing ones, modifying them, and removing them from collections.
How-to: Query & search
From basic vector and hybrid searches to specialized image queries and performing data aggregations.
The Weaviate API reference pages for search and REST may also be useful starting points.
Questions and feedback
Section titled “Questions and feedback”Have a question or feedback? Here's how to reach us.