# kuber-client

> Javascript client library for kuber server

Latest version **4.0.2** (published 2026-03-20) · ISC license · 0 weekly downloads

## Install

```sh
npm install kuber-client
pnpm add kuber-client
yarn add kuber-client
bun add kuber-client
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: esm support; no vulnerabilities; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 4.0.2 |
| Published | 2026-03-20 |
| First published | 2022-12-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 223 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Sudip Bhattarai |
| Maintainers | sudip.np, reeshavacharya, sireto-io |
| Keywords | kuber, cardano-serialization-lib, cardano, plutus, payment, development |

## Links

- npm: https://www.npmjs.com/package/kuber-client
- Repository: https://github.com/sireto/kuber-client-js
- Homepage: https://github.com/sireto/kuber-jsclient#readme
- Issues: https://github.com/sireto/kuber-jsclient/issues
- npm.io page: https://npm.io/package/kuber-client

## Dependencies (3)

- [axios](https://npm.io/package/axios.md) ^1.9.0
- [libcardano](https://npm.io/package/libcardano.md) 3.0.4
- [libcardano-wallet](https://npm.io/package/libcardano-wallet.md) 3.0.2

## Recent versions

- 4.0.2 (latest) — 2026-03-20
- 4.0.1 — 2026-03-11
- 4.0.0 — 2026-03-11
- 3.3.6 — 2026-01-23
- 3.3.5 — 2025-08-28
- 3.3.4 — 2025-08-28
- 3.3.2 — 2025-08-18
- 3.3.1 — 2025-08-18
- 3.3.0 — 2025-08-08
- 3.2.0-rc6 — 2025-08-08
- 3.2.0-rc5 — 2025-08-08
- 3.2.0-rc4 — 2025-08-08
- 3.2.0-rc2 — 2025-07-17
- 3.2.0-rc1 — 2025-07-17
- 3.1.11-alpha — 2025-05-30
- … 24 more at https://npm.io/package/kuber-client/versions

## README

Kuber-Client
=====================
Library for interacting with cardano wallet and blockchain via `kuber-server`. 

Kuber-Client Provides Unified  interfce that works on web browsers, Node.js applications, and even with `kuber-hydra` server.

With kuber-client, you can:
- Query utxos, prototol parameters, time-slot information
- Make Ada payments
- Mint/burn Cardano native tokens and NFTs
- Interact with Plutus contracts
- Add metadata to transactions
- Participate in cardano governance
- Interact with Hydra side-chain


### Add as a Dependency

```
$ npm install kuber-client
```

### Run API Services

`kuber-client` requires corresponding API services to connect to the Cardano network and Hydra heads.

*   **Kuber API Service:** For standard Cardano transactions, an instance of the [Kuber API service](https://github.com/dQuadrant/kuber) must be running. This service exposes the necessary endpoints for building and submitting transactions to the blockchain.

*   **KuberHydra API Service:** For Hydra-related operations, an instance of the [KuberHydra API service](https://github.com/dQuadrant/kuber/tree/master/kuber-hydra) is required. It provides hydra as well as Layer1 APIs.

## Kuber Transaction Builder reference
[Docs : kuberide.com](https://kuberide.com/kuber/docs/tx-builder-reference)


## Examples

1. [Client Browser Example](#client-browser-example)
2. [Backend CLI Example](#backend-cli-example)
3. [Hydra Example](#hydra-example)

### 1. [Client] Browser Example

This example demonstrates how to use `kuber-client` in a browser environment with a CIP-30 compliant wallet like Nami or Eternl.

```js
import {KuberApiProvider} from "kuber-client";
import {BrowserCardanoExtension} from "kuber-client/browser";

async function donate(amount) {
    const kuber = new KuberApiProvider('http://localhost:8081',"your-api-key");
    const providers = BrowserCardanoExtension.list();

    if (!providers) {
        alert('Wallet Not detected. Install a CIP-30 compatible wallet.');
        return;
    }

    let provider = providers[0];
    const wallet = await provider.enable();
    

    console.info("Using Browser Wallet", {
        name: provider.name,
        balance: (await wallet.getBalance()).multiAssetsUtf8()
    });

    return kuber.buildAndSignWithWallet(wallet,{
        outputs: [
            {
                address: "addr1v9f4au6ux739r5kttd4208qerumrsh6mrenvcvq82e0rpwca3u2u6",
                value: amount
            }
        ]
    }).then(tx => {
        return wallet.submitTx(tx.transaction.toBytes().toString("hex"));
    }).catch(e => {
        alert((e && e.message) || e);
    });
}

Promise.resolve(donate(5000000)); // or donate("5A")
Promise.resolve(donate(5000000)); // or donate("5A")
```

### 2. [Backend] CLI Example

This example shows how to use `kuber-client` in a Node.js environment to build a transaction.

```js
const { KuberApiProvider } = require("kuber-client");
const { CardanoKeyAsync } = require("libcardano");
const { ShelleyWallet, SimpleCip30Wallet } = require("libcardano-wallet");
const { readFileSync } = require("fs");
const { Network } = require("libcardano-wallet/cip30/types");

async function main() {
    const kuber = new KuberApiProvider('http://localhost:8081',process.env.KUBER_API_KEY);
    const testWalletSigningKey = await CardanoKeyAsync.fromCardanoCliJson(
        JSON.parse(readFileSync("payment.skey", 'utf-8'))
    );

    const shelleyWallet = new ShelleyWallet(testWalletSigningKey);
    const cip30Wallet = new SimpleCip30Wallet(kuber, kuber, shelleyWallet, Network.Testnet);

    const signedTx = await kuber.buildAndSignWithWallet(cip30Wallet,{
        outputs: [{
            address: "addr1v9f4au6ux739r5kttd4208qerumrsh6mrenvcvq82e0rpwca3u2u6",
            value: "2A"
        }],
    });

    await cip30Wallet.submitTx(signedTx.transaction.toBytes().toString("hex"));
    console.log("Transaction submitted:", signedTx);
}

Promise.resolve(main());

Promise.resolve(main());
```

### 3. Hydra Example

#### See full docs [here](https://dquadrant.github.io/kuber/hydra_docusaurus/docs/hydra-js-client/getting-started/)

This example demonstrates how to use `kuber-client` to interact with a Hydra head.

```js
const { KuberHydraApiProvider } = require("kuber-client");
const { CardanoKeyAsync } = require("libcardano");
const { ShelleyWallet, SimpleCip30Wallet } = require("libcardano-wallet");
const { readFileSync } = require("fs");

async function main() {

    const hydra = new KuberHydraApiProvider("http://localhost:8081");
    const testWalletSigningKey = await CardanoKeyAsync.fromCardanoCliJson(
        JSON.parse(readFileSync("example.sk", 'utf-8'))
    );

    const shelleyWallet = new ShelleyWallet(testWalletSigningKey);
    const cip30Wallet = new SimpleCip30Wallet(hydra, hydra, shelleyWallet, 1);

    const head = await hydra.queryHead();
    if (head.tag !== "Open") {
        throw new Error("Head is " + head.tag + ". Expected Open");
    }

    console.log("Hydra Balance", await cip30Wallet.getBalance());

    const signedTx = await hydra.buildAndSignWithWallet(cip30Wallet, {
        outputs: [{
            address: await cip30Wallet.getChangeAddress(),
            value: "2A"
        }],
        changeAddress: await cip30Wallet.getChangeAddress()
    });
    await cip30Wallet.submitTx(signedTx.transaction.toBytes().toString("hex"));
    console.log("Transaction submitted:", signedTx);
}

Promise.resolve(main());
```

---
_Source: https://npm.io/package/kuber-client · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
