Skip to content

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

DocumentPurpose
TypeScript SDKFull Node.js / TypeScript SDK integration, model configuration, authentication, and method reference
Java SDKJava server-side integration, request objects, authentication, and call examples
OpenAPIOpenAPI 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:

Bash
npm install @lovrabet/sdk

We recommend syncing your model configuration first with the Rabetbase CLI:

Bash
rabetbase api pull

Typical call:

TypeScript
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:

MethodExampleNotes
dataset keyclient.models.dataset_<datasetCode>Stable and unique — ideal for generated code and Agents
aliasclient.models.ordersMore 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.

Bash
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}' --yes

For write operations, run with --dry-run first:

Bash
lovrabet data update --code <datasetCode> --params '{"id":123,"status":"completed"}' --dry-run

5. Authentication

ScenarioRecommended approach
Pages inside the platformWebAPI / user cookie or token
Server-side jobsAccessKey
Third-party systemsOpenAPI + AccessKey
CLI debuggingFollows 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.

基于飞书知识库同步生成,内容以飞书源文档为准