SDK & API Reference
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
| Class | Description |
|---|---|
| RushDB | Main client — entry point for all operations |
| DBRecord | Typed record class returned from queries |
| DBRecordInstance | Active record with instance methods (attach, detach, update, delete) |
| DBRecordsArrayInstance | Collection of records with bulk-operation methods |
| Model | Schema-bound model class for label-scoped operations |
| Relationship Patterns | Review and apply AI-suggested relationships |
| Transaction | ACID transaction handle |
| SearchQuery | Query builder types and interfaces |
| DBRecordTarget | Record reference type used in relationship calls |
| RelationTarget | Relationship target reference type |