2026-09-15 19:00:10 +08:00
2026-09-15 19:00:10 +08:00
2026-09-15 19:00:10 +08:00
2026-09-15 19:00:10 +08:00
2026-09-15 19:00:10 +08:00
2026-09-15 19:00:10 +08:00
2026-09-15 19:00:10 +08:00

React SDK

使用 TypeScript 开发的 React SDK,配套 backend-server。

开发

npm ci
npm run typecheck
npm run build

使用

本包尚未发布。先运行 npm run build,再在 React 项目中安装本地目录:

npm install /absolute/path/to/react-sdk
import { useHealth } from "@entroia/react-sdk";

export function ServerStatus() {
  const { data, error, loading } = useHealth("http://localhost:8000");
  if (loading) return <p>加载中</p>;
  if (error) return <p>{error.message}</p>;
  return <p>{data?.status}</p>;
}

非组件场景可以使用 createClient({ baseUrl }).health()。

S
Description
AdCloud React SDK for developer and coding agent integration: tracking and ad delivery
Readme 41 KiB
Languages
TypeScript 64.2%
JavaScript 35.8%