0.12.7 • Published 9 months ago

@farcaster/hub-nodejs v0.12.7

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

@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

0.12.7

9 months ago

0.12.6

9 months ago

0.12.5

9 months ago

0.12.4

10 months ago

0.12.3

10 months ago

0.12.2

11 months ago

0.11.20

1 year ago

0.11.21

1 year ago

0.11.22

12 months ago

0.11.23

12 months ago

0.11.24

12 months ago

0.12.0

11 months ago

0.12.1

11 months ago

0.11.19

1 year ago

0.11.15

1 year ago

0.11.16

1 year ago

0.11.17

1 year ago

0.11.18

1 year ago

0.11.13

1 year ago

0.11.14

1 year ago

0.11.12

1 year ago

0.11.11

1 year ago

0.11.10

1 year ago

0.11.9

1 year ago

0.11.8

1 year ago

0.11.7

1 year ago

0.11.6

1 year ago

0.11.5

1 year ago

0.11.4

1 year ago

0.11.2

1 year ago

0.11.3

1 year ago

0.11.1

1 year ago

0.11.0

1 year ago

0.10.24

1 year ago

0.10.22

1 year ago

0.10.23

1 year ago

0.10.21

1 year ago

0.10.20

2 years ago

0.8.4

2 years ago

0.10.9

2 years ago

0.10.18

2 years ago

0.10.19

2 years ago

0.10.14

2 years ago

0.10.1

2 years ago

0.10.15

2 years ago

0.10.2

2 years ago

0.10.16

2 years ago

0.10.3

2 years ago

0.10.17

2 years ago

0.10.4

2 years ago

0.10.10

2 years ago

0.10.5

2 years ago

0.10.11

2 years ago

0.10.6

2 years ago

0.10.12

2 years ago

0.10.7

2 years ago

0.10.13

2 years ago

0.10.8

2 years ago

0.10.0

2 years ago

0.9.0

2 years ago

0.8.3

2 years ago

0.9.1

2 years ago

0.8.2

2 years ago

0.8.1

2 years ago

0.8.0

2 years ago

0.7.4

2 years ago

0.7.3

2 years ago

0.7.2

2 years ago

0.7.1

2 years ago

0.7.0

2 years ago

0.6.3

2 years ago

0.6.2

2 years ago

0.6.1

2 years ago

0.6.0

2 years ago

0.5.1

2 years ago

0.5.0

2 years ago

0.4.1

2 years ago

0.4.0

2 years ago