Documentation menu
Client drivers

TypeScript & JavaScript

A portable first-party HTTP client with generated request and response validation.

On this page

Use the source-delivered client

The TS client has no runtime package dependency. Download the four files together and pin their provenance. The ESM JavaScript bundle is compiled from those same files for JavaScript consumers. No npm publication or package name is implied.

Download client.ts

Download contracts.ts

Download schemas.ts

Download validator.ts

Download JavaScript ESM bundle

Connect from a trusted application

loadTokenFromYourSecretProvider is your host application function, not a Qirava export. It supplies the current 64-character hexadecimal owner credential. Do not embed this credential into a public static site.

Remote connections require HTTPS. Explicit loopback HTTP is permitted for local development. A host-injected transport supports local Unix sockets and must honor AbortSignal. Redirects are refused. LB failover and cluster routing remain a separate adapter delivery gate.

typescript
import { QiravaClient } from './client';

const client = new QiravaClient({
  url: 'https://database.example.test',
  token: () => loadTokenFromYourSecretProvider(),
  timeoutMs: 30_000,
});

const status = await client.status();

Execute a typed transaction

Both outgoing requests and incoming envelopes/results are validated. Intent is serialized before awaiting credential resolution. The response stream has a byte budget. Mutations are submitted once; preserve the request to resolve an uncertain result.

typescript
const request = {
  requestId: 'create-project-v1',
  operations: [{
    op: 'insert' as const,
    collection: 'projects',
    key: 'sdk-project',
    value: { title: 'Built with Qirava', status: 'active' },
  }],
};
const receipt = await client.execute(request);

Preserve exact numbers

The browser client rejects unsafe integer or decimal parsing instead of silently rounding stored values. Use the Rust or CLI lossless interface for documents outside the JavaScript numeric boundary. TypeScript types alone cannot validate data received from a remote server.

Rust and future drivers

Rust embeds the same engine directly. Python is planned as a subsequent driver and is not currently shipped. Future drivers must validate the same request/result schemas and preserve exact retry identity and numeric semantics.

Embedded Rust →

HTTP protocol →