@farseerdev/farseer-client

中文文档
1.29.0发布于 2026/11/10ISCTypeScriptCommonJS近 30 天下载 4703

Typescript client for farseer

原始使用文档

@farseerdev/farseer-client

TypeScript client for the Farseer API. Farseer Apps use it to read and write models, run imports and exports, and work with files.

Documentation: https://client-docs.farseer.io

Install

npm install farseer-client@npm:@farseerdev/farseer-client

This installs the package under the name farseer-client, which is how Farseer Apps import it. A Farseer App folder created with the Farseer CLI already has it.

The xlsx dependency installs from cdn.sheetjs.com, not from npm. pnpm 11 refuses such a dependency by default (ERR_PNPM_EXOTIC_SUBDEP), so set blockExoticSubdeps to false. Networks that block cdn.sheetjs.com cannot install the package.

Use

import { FarseerClient, User, handleUnknownError } from 'farseer-client';

async function main() {
    const client = new FarseerClient();
    const users: User[] = await client.users.list();
}

main().catch(handleUnknownError);

handleUnknownError prints the status and body of a failed request, and ends the script.

Inside a Farseer App, the client reads its settings from the environment variables TENANT_ID, FARSEER_URL and FARSEER_API_KEY. Anywhere else, pass them in:

const client = new FarseerClient('<tenant ID>', '<API key>', 'https://<your-company>.farseer.io');

An API key belongs to a service user: in Farseer, open Users & groups, choose Create service user, and copy the key it shows. The tenant ID is the tenant's name, as listed under Switch Tenants in the user menu.

版本与发布记录

@farseerdev/farseer-client 共发布 54 个版本,首次发布于 2026/10/13;过去 12 个月发布了 54 个版本。

版本发布日期距今
1.29.0latest2026/11/104 天前
1.28.12026/11/104 天前
1.28.02026/11/104 天前
1.27.02026/11/104 天前
1.25.02026/10/2915 天前
1.26.02026/10/2915 天前

关于 @farseerdev/farseer-client 的常见问题

@farseerdev/farseer-client 是什么?

Typescript client for farseer

如何安装 @farseerdev/farseer-client?

在项目目录运行 npm install @farseerdev/farseer-client,或使用 pnpm add / yarn add / bun add。

@farseerdev/farseer-client 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@farseerdev/farseer-client 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@farseerdev/farseer-client 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18.17。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@farseerdev/farseer-client 可以商用吗?

@farseerdev/farseer-client 使用 ISC 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@farseerdev/farseer-client 的下载量有多少?

根据 npm 官方下载统计,@farseerdev/farseer-client 在 2026/10/15 – 2026/11/13 这 30 天内被下载 4,703 次,日均约 157 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@farseerdev/farseer-client 还在维护吗?

最新版本 1.29.0 发布于 2026/11/10(4 天前);至今共发布 54 个版本,其中过去 12 个月发布了 54 个;首次发布于 2026/10/13。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。