Skip to main content

TypeScript / JavaScript SDK

The official TypeScript/JavaScript SDK for RushDB. Works in Node.js and browser environments.

Installation​

npm install @rushdb/javascript-sdk

Quick Start​

import RushDB from '@rushdb/javascript-sdk'

const db = new RushDB('RUSHDB_API_KEY')

// Store a record
await db.records.create({
label: 'User',
data: { name: 'Alice', role: 'engineer' }
})

// Query records
const { data } = await db.records.find({
labels: ['User'],
where: { role: 'engineer' },
limit: 10
})

To connect to a self-hosted engine, use direct mode with the engine's URL and token:

const db = new RushDB('ENGINE_TOKEN', {
direct: true,
engineUrl: 'http://127.0.0.1:3000'
})

See SDKs for what direct mode offers.

API Reference​

ClassDescription
RushDBMain client — entry point for all operations
DBRecordTyped record class returned from queries
DBRecordInstanceActive record with instance methods (attach, detach, update, delete)
DBRecordsArrayInstanceCollection of records with bulk-operation methods
ModelSchema-bound model class for label-scoped operations
Relationship PatternsReview and apply AI-suggested relationships
TransactionACID transaction handle
SearchQueryQuery builder types and interfaces
DBRecordTargetRecord reference type used in relationship calls
RelationTargetRelationship target reference type