New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@farcaster/hub-nodejs

Package Overview
Dependencies
Maintainers
7
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@farcaster/hub-nodejs

A lightweight, fast Typescript interface for Farcaster Hubs. Designed to work with [Hubble](https://github.com/farcasterxyz/hubble/) and any other Hub that implements the [Farcaster protocol](https://github.com/farcasterxyz/protocol).

  • 0.12.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.4K
decreased by-20.97%
Maintainers
7
Weekly downloads
 
Created
Source

@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

FAQs

Package last updated on 30 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc