SDK and Runtime CLI Guide
You can call Instant API through the TypeScript SDK, the Java OpenSDK, OpenAPI, or the Runtime CLI. Use an SDK for business development, the CLI for debugging and automation, and OpenAPI for third-party systems and other language environments.
1. Official Reference Documentation
| Document | Purpose |
|---|---|
| TypeScript SDK | Full Node.js / TypeScript SDK integration, model configuration, authentication, and method reference |
| Java SDK | Java server-side integration, request objects, authentication, and call examples |
| OpenAPI | OpenAPI authentication, signing, paths, request bodies, and the full API reference |
2. TypeScript SDK
Only minimal examples are shown here. For full installation, configuration, authentication, typing, and error handling, see TypeScript SDK.
Install:
npm install @lovrabet/sdkWe recommend syncing your model configuration first with the Rabetbase CLI:
rabetbase api pullTypical call:
import { registerModels, createClient } from "@lovrabet/sdk";
import "./api/api";
const client = createClient({
accessKey: process.env.LOVRABET_ACCESS_KEY,
});
const orders = await client.models.orders.filter({
where: { status: { $eq: "pending" } },
currentPage: 1,
pageSize: 20,
});There are two ways to access a model:
| Method | Example | Notes |
|---|---|---|
| dataset key | client.models.dataset_<datasetCode> | Stable and unique — ideal for generated code and Agents |
| alias | client.models.orders | More readable; depends on the alias in the model configuration |
3. Java OpenSDK
The Java OpenSDK fits enterprise backend services, batch jobs, and system integration. The current Java docs center on LovrabetSDKClient and LovrabetRequest, covering dataset listing, single-record reads, creates, updates, and more.
For detailed Java SDK integration, see Java SDK. The Instant API docs only cover capability boundaries and the calling model — they don't duplicate the full Java SDK reference.
4. Runtime CLI
The Runtime CLI suits debugging, automation scripts, and Agent tool execution.
lovrabet data filter --code <datasetCode> --params '{"where":{"status":{"$eq":"active"}},"currentPage":1,"pageSize":20}'
lovrabet data getOne --code <datasetCode> --params '{"id":123}'
lovrabet data aggregate --code <datasetCode> --params '{"aggregate":[{"field":"id","type":"COUNT","alias":"cnt"}],"groupBy":["status"]}'
lovrabet data create --code <datasetCode> --params '{"name":"test"}'
lovrabet data update --code <datasetCode> --params '{"id":123,"status":"completed"}'
lovrabet data delete --code <datasetCode> --params '{"id":123}' --yesFor write operations, run with --dry-run first:
lovrabet data update --code <datasetCode> --params '{"id":123,"status":"completed"}' --dry-run5. Authentication
| Scenario | Recommended approach |
|---|---|
| Pages inside the platform | WebAPI / user cookie or token |
| Server-side jobs | AccessKey |
| Third-party systems | OpenAPI + AccessKey |
| CLI debugging | Follows the current lovrabet CLI configuration and login state |
For exact configuration, defer to the TypeScript SDK, Java SDK, and OpenAPI docs. The Instant API docs only explain capability boundaries and the calling model.