@farcaster/hub-nodejs

中文文档
0.18.0发布于 2026/10/25MITTypeScriptESM + CJS构建来源已验证近 30 天下载 7528

A lightweight, fast Typescript interface for Farcaster Hubs. Designed to work with Hubble and any other Hub that implements the Farcaster protocol.

原始使用文档
文档目录7 节
  1. Features
  2. Installation
  3. Quickstart
  4. Fetching Data from Hubs
  5. Documentation
  6. Contributing
  7. License

@farcaster/hub-nodejs

A lightweight, fast Typescript interface for Farcaster Hubs. Designed to work with Hubble and any other Hub that implements the Farcaster protocol.

Features

  • Call any Hub endpoint from a NodeJS environment.
  • Serializes and deserializes Farcaster protobufs into Javascript objects.
  • Has helpers to create and sign Farcaster messages.
  • Written entirely in TypeScript, with strict types for safety.

Read the documentation, see more examples or get started with the guide below.

Installation

Install @farcaster/hub-nodejs with the package manager of your choice

npm install @farcaster/hub-nodejs
yarn add @farcaster/hub-nodejs
pnpm install @farcaster/hub-nodejs

Quickstart

Fetching Data from Hubs

import { getSSLHubRpcClient } from '@farcaster/hub-nodejs';

client.$.waitForReady(Date.now() + 5000, async (e) => {
  if (e) {
    console.error(`Failed to connect to ${hubRpcEndpoint}:`, e);
    process.exit(1);
  } else {
    console.log(`Connected to ${hubRpcEndpoint}`);
    const castsResult = await client.getCastsByFid({ fid: 8928 });
    castsResult.map((casts) => casts.messages.map((cast) => console.log(cast.data?.castAddBody?.text)));
    client.close();
  }
});

Documentation

The HTTP API endpoints are documented here.

An OpenAPI spec is provided here.

Contributing

Please see our contributing guidelines before making a pull request.

License

MIT License

版本与发布记录

@farcaster/hub-nodejs 共发布 102 个版本,首次发布于 2023/03/17;过去 12 个月发布了 5 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.18.0latest2026/10/2520 天前
0.17.02026/07/303 个月前
0.16.02026/05/225 个月前
0.15.112026/05/076 个月前
0.15.102026/02/059 个月前
0.15.92025/10/131.1 年前

关于 @farcaster/hub-nodejs 的常见问题

@farcaster/hub-nodejs 是什么?

A lightweight, fast Typescript interface for Farcaster Hubs. Designed to work with Hubble and any other Hub that implements the Farcaster protocol.

如何安装 @farcaster/hub-nodejs?

在项目目录运行 npm install @farcaster/hub-nodejs,或使用 pnpm add / yarn add / bun add。

@farcaster/hub-nodejs 支持 TypeScript 吗?

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

@farcaster/hub-nodejs 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@farcaster/hub-nodejs 可以商用吗?

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

@farcaster/hub-nodejs 的下载量有多少?

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

@farcaster/hub-nodejs 还在维护吗?

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