# ya-ts-client

> TypeScript generated API clients for various Yagna public APIs. Core library for Golem Network related libraries and SDKs

Latest version **1.1.3** (published 2024-07-01) · LGPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install ya-ts-client
pnpm add ya-ts-client
yarn add ya-ts-client
bun add ya-ts-client
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.3 |
| Published | 2024-07-01 |
| First published | 2020-08-13 |
| Weekly downloads | 0 |
| License | LGPL-3.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=18.0.0 |
| Dependencies | 0 |
| Unpacked size | 511 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | GolemFactory |
| Keywords | golem, network, distributed, computing, yagna, rest, api, client |

## Links

- npm: https://www.npmjs.com/package/ya-ts-client
- Repository: https://github.com/golemfactory/ya-ts-client
- Homepage: https://github.com/golemfactory/ya-ts-client#readme
- Issues: https://github.com/golemfactory/ya-ts-client/issues
- npm.io page: https://npm.io/package/ya-ts-client

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 1.1.3 (latest) — 2024-07-01
- 1.1.1-beta.2 (beta) — 2024-04-25
- 1.1.2 — 2024-06-18
- 1.1.1 — 2024-06-04
- 1.1.1-beta.1 — 2024-04-17
- 1.1.1-beta.0 — 2024-04-17
- 1.1.0 — 2024-04-02
- 1.0.0 — 2024-03-25
- 1.0.0-beta.5 — 2024-03-20
- 1.0.0-beta.4 — 2024-03-09
- 1.0.0-beta.3 — 2024-03-04
- 1.0.0-beta.2 — 2024-03-01
- 1.0.0-beta.1 — 2024-02-29
- 1.0.0-beta.0 — 2024-02-29
- 0.5.3 — 2022-04-20
- … 9 more at https://npm.io/package/ya-ts-client/versions

## README

# Yagna TS Client

The `ya-ts-client` package provides low level API bindings in form of collection TypeScript clients generated from
the [Yagna public API](https://github.com/golemfactory/ya-client) OpenApi specifications.

The primary and only purpose of this package is to provide that basic implementation. As a "core" library, it shouldn't need to be added as a dependency to any user code, only to other Golem Network related SDKs or libraries.

If you want to start building solutions using Golem Network, here are more suitable options:

- [Official JS SDK - @golem-sdk/golem-js](https://www.npmjs.com/package/@golem-sdk/golem-js) - which models the Decentralized Computation Marketplace logic
- [TaskExecutor - @golem-sdk/task-executor](https://www.npmjs.com/package/@golem-sdk/task-executor) - built on top of `@golem-sdk/golem-js` and provides a "task oriented" API for simple distributed computation scenarios

## Installation

```bash
npm install --save ya-ts-client
```

## Usage

The library exposes multiple API clients which are auto-generated from the official OpenApi specifications. The documentation of the generated API is [hosted on GitHub pages](https://golemfactory.github.io/ya-ts-client/).

### Working with API Clients

Here's just one example of how to use the `Payment` module's `ApiClient` to obtain the list of allocations.

```ts
import { PaymentApi } from "ya-ts-client";
// Or refer to the whole library:
//import * as YaTsClient from "ya-ts-client";

/**
 * Example of usage of the Payment API
 */
const payment = new PaymentApi.Client({
  BASE: "http://localhost:7465/payment-api/v1",
  HEADERS: {
    Authorization: "Bearer your-app-key",
  },
});

const allocations = await payment.requestor.getAllocations();
console.log("Allocated funds:", allocations);
```

## See also

- [Official Golem JS SDK repo](https://github.com/golemfactory/golem-js)
- [Documentation for JS Creators](https://docs.golem.network/docs/creators/javascript)

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