Files
hub-monorepo/packages/hub-nodejs
Varun Srinivasan 57c540d520 chore: release new version of packages (#761)
* chore: changelog bump to app/hubble to prep for release

* chore: don't minor bump hubble and protobufs for client changes

* chore: bump versions for publishing
2023-03-26 18:17:47 -07:00
..

@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 { getInsecureHubRpcClient } from '@farcaster/hub-nodejs';

(async () => {
  const client = getInsecureHubRpcClient('127.0.0.1:2283');

  const castsResult = await client.getCastsByFid({ fid: 2 });

  castsResult.map((casts) => casts.messages.map((cast) => console.log(cast.data?.castAddBody?.text)));
})();

Contributing

Please see our contributing guidelines before making a pull request.

License

MIT License