JavaScript Client Overview
Reference for @raisindb/client, the TypeScript SDK for browsers and Node.js.
Installation
npm install @raisindb/client
# Node.js only: the WebSocket implementation is an optional peer dependency
npm install ws
The package ships ESM and CommonJS builds with type definitions, plus subpath exports @raisindb/client/react, @raisindb/client/svelte and @raisindb/client/vue.
Quick start
import { RaisinClient } from '@raisindb/client';
const client = new RaisinClient('ws://localhost:8080', { repository: 'myapp' });
await client.connect();
await client.authenticate({ username: 'admin', password: 'password' });
const db = client.database('myapp');
const ws = db.workspace('content');
The client connects to ws://host/ws/{repository}. Pass a bare host and the repository option, or the full path (ws://localhost:8080/ws/myapp). Multi-tenant operators can address a tenant with ws://host/sys/{tenant}/{repository}.
For server-side code without WebSocket, RaisinClient.forSSR(httpUrl) returns an HTTP-only client; see Connection & Authentication.
Reference pages
- Connection & Authentication: connect, authenticate, sessions, options
- Node Operations: CRUD, tree operations, ordering, relationships
- Branches: fork, compare and merge branches;
onBranch()scoping - Events: real-time subscriptions
- Realtime Subscriptions & Inbox: path filter semantics, the inbox-bell pattern
- Chat & Conversations:
ConversationManager,ConversationStore, streaming - Framework Integrations: React, Svelte 5 and Vue 3 bindings
- Flows: workflow execution and streaming
- Functions: invoking server-side functions
- Uploads: file uploads and signed URLs
- Identity Authentication: end-user sign-in over HTTP
- Schema Management: NodeTypes, archetypes and element types