Browse Developer Tooling

beta · sdk · 0.3.0

TypeScript first sandbox request

Clone the public repository, verify the selected SDK version, then install its generated package into the Project Backend:

Shell example
git clone https://github.com/q10242/MiniCenter.git minicenter-source
test "$(cat minicenter-source/sdks/typescript/VERSION)" = "0.3.0"
npm pack ./minicenter-source/sdks/typescript --pack-destination /tmp
npm install /tmp/minicenter-sdk-0.3.0.tgz
TypeScript example
import { MiniCenterClient } from "@minicenter/sdk";

const correlationId = process.env.MINICENTER_CORRELATION_ID;
if (!correlationId) throw new Error("MINICENTER_CORRELATION_ID is required");
const miniCenterUrl = process.env.MINICENTER_URL?.replace(/\/$/, "");
if (!miniCenterUrl) throw new Error("MINICENTER_URL is required");
const client = new MiniCenterClient({
  baseUrl: `${miniCenterUrl}/api/v1`,
  credential: process.env.MINICENTER_PROJECT_CREDENTIAL,
  correlationId: () => correlationId,
});
console.log(await client.request("GET", "/project-client"));
console.log(`HTTP 200 correlation_id=${correlationId}`);