TypeScript / JavaScript
npm install @tritonium/api-client@2.1.1
功能
完整的 TypeScript 支持,包含完整的类型定义 Node.js 18 或更高版本,无运行时依赖项 支持 Tree-shaking 的 ESM 和 CommonJS 构建
import { configureApiKey, AppsService, ReviewsService } from '@tritonium/api-client';
configureApiKey(process.env.TRITONIUM_API_KEY!);
const { apps = [] } = await AppsService.getApps();
if (apps.length === 0) throw new Error('Connect an app in the Tritonium dashboard first.');
const { reviews = [] } = await ReviewsService.getAppReviews(apps[0].app_uuid!, 20);