The `kubo-rpc-client` package provides a JavaScript client library for interacting with the Kubo RPC API, allowing developers to programmatically control and query an IPFS Kubo node. It enables functionalities such as adding and retrieving data, managing pins, and interacting with the IPFS swarm. Currently at version 6.1.0, the library maintains a regular release cadence, incorporating new features like `provide.stat` and `pin.update`, and ensuring interoperability with recent Kubo versions (e.g., Kubo 0.38). It differentiates itself as the official client for Kubo's HTTP RPC API, offering a direct interface to the underlying IPFS daemon's capabilities, contrasting with higher-level IPFS client libraries that might embed or abstract away the RPC communication. It supports both Node.js (Current and Active LTS versions) and browser environments, providing a consistent API across platforms.
npm install kubo-rpc-clientVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to initialize the Kubo RPC client, retrieve the IPFS node ID, add a string to IPFS, and then retrieve it by its Content ID (CID).
Ensure that your project's dependencies for `@libp2p/*` and `@multiformats/multiaddr` are updated to their latest compatible versions when upgrading to `kubo-rpc-client@6.0.0` or higher.
Always specify the correct `url` option to `create({ url: '...' })` if your Kubo node is not at the default address. Ensure your Kubo daemon is running and accessible from where your client code is executed.Configure your Kubo node with appropriate CORS headers (`ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["http://your-app-domain.com"]'`) or use a proxy server to route requests if cross-origin access is required.
Start your IPFS Kubo daemon (e.g., `ipfs daemon`) and ensure its API address matches the `url` option provided to `kubo-rpc-client.create()`.
Refactor your imports to use ES module syntax: `import { create } from 'kubo-rpc-client'`. If running in Node.js, ensure your environment supports ESM, or configure your project to transpile to CJS if necessary.Verify that the `create` call is not throwing an error and that `client` is indeed the object returned by `create`. Ensure you are using `await` with `client.add()` and other async operations, as they return Promises.
No dependency data recorded yet.