Skip to content

MindsDB's JavaScript SDK

The MindsDB SDK for JavaScript provides all of the MindsDB's native functionalities through MindsDB Server.

Installing JavaScript SDK

The JavaScript SDK can be installed with npm or yarn:

npm install mindsdb-js-sdk


yarn add mindsdb-js-sdk

Also, you can install it from source:

git clone
cd mindsdb_js_sdk
npm install

Usage example

The following example covers the basic flow: connect to MindsDB Server, train new model, make predictions.

import MindsDB from 'mindsdb-js-sdk';

const connected = await;
if (!connected) return;

// lists of predictors and datasources
const predictorsList = MindsDB.dataSources();
const predictors = MindsDB.predictors();

// get datasource
const rentalsDatasource = await MindsDB.DataSource({name: 'home_rentals'}).load();

// get predictor
const rentalsPredictor = await MindsDB.Predictor({name: 'home_rentals'}).load();

// query
const result = rentalsPredictor.queryPredict({'initial)|_price': 2000, 'sqft': 500});