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 instance pass the url option:

const db = new RushDB('RUSHDB_API_KEY', {
url: 'https://your-rushdb-instance.com/api/v1'
})

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