@untools/zhuli
v0.1.1
Published
TypeScript SDK for the Zhu Li AI ops platform
Downloads
212
Readme
@untools/zhuli
Type-safe TypeScript SDK for Zhu Li.
Install
npm install @untools/zhuliQuick start
import { ZhuLiSDK } from "@untools/zhuli";
const zhuli = new ZhuLiSDK({
apiKey: process.env.ZHULI_API_KEY!,
baseUrl: "https://zhuli.aevr.space",
});
await zhuli.submitIssue({
title: "Checkout timeout",
description: "Payment hangs after card confirmation.",
severity: "high",
});
const issues = await zhuli.listIssues({ status: "open" });
console.log(issues.data.issues.length);API
submitIssue(payload)submitFeature(payload)submitCommit(payload)listIssues(query?)listFeatures(query?)listChangelog(query?)listInsights(query?)chat(message, options?)getPortalHosting()createPortalClient()
Public portal and embeds
import { ZhuLiSDK } from "@untools/zhuli";
import { ZhuLiPortalEmbed, ZhuLiPortalView } from "@untools/zhuli/react";
const zhuli = new ZhuLiSDK({
apiKey: process.env.ZHULI_API_KEY!,
});
const hosting = await zhuli.getPortalHosting();
console.log(hosting.urls.embed);
const portal = await zhuli.createPortalClient();
const data = await portal.getData({ view: "features" });
// Server or client rendering
<ZhuLiPortalView data={data} view="features" />;
// Lightweight iframe embed
<ZhuLiPortalEmbed portalId={hosting.portalId} view="overview" height={720} />;Available hosted views:
overviewissuesfeatureschangelogdocs
Portal helpers exported by the SDK:
ZhuLiPortalClientbuildHostedPortalUrl(...)buildHostedPortalUrls(...)buildPortalIframeCode(...)
Publish
From packages/sdk:
npm run clean
npm run build
npm run pack:check
npm publishThis package is configured with publishConfig.access=public.
