# rigelsdk

> sdk for rigel

Latest version **2.0.1** (published 2023-08-27) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install rigelsdk
pnpm add rigelsdk
yarn add rigelsdk
bun add rigelsdk
```

## 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 | 2.0.1 |
| Published | 2023-08-27 |
| First published | 2022-11-21 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 31.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | sdqri |
| Maintainers | sdqr |
| Keywords | rigel, image proxy, typescript, sdk, fast |

## Links

- npm: https://www.npmjs.com/package/rigelsdk
- npm.io page: https://npm.io/package/rigelsdk

## Dependencies (2)

- [jose](https://npm.io/package/jose.md) ^4.11.0
- [axios](https://npm.io/package/axios.md) ^1.3.2

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 2.0.1 (latest) — 2023-08-27
- 2.0.0 — 2023-08-26
- 1.7.0 — 2023-07-31
- 1.6.1 — 2023-02-19
- 1.5.1 — 2023-02-14
- 1.5.0 — 2023-02-14
- 1.4.0 — 2022-12-05
- 1.3.0 — 2022-12-03
- 1.2.2 — 2022-12-03
- 1.2.1 — 2022-12-03
- 1.2.0 — 2022-12-03
- 1.1.0 — 2022-11-29
- 1.0.0 — 2022-11-21

## README

<p align="center">
 <h2 align="center">rigelsdk</h2>
 <p align="center">Typescript SDK for <a href="[rigel](https://github.com/sdqri/rigel)">rigel</a></p>
  <p align="center">
  <a href="https://github.com/sdqri/rigelsdk/issues">
      <img alt="Issues" src="https://img.shields.io/github/issues/sdqri/rigelsdk?style=flat&color=336791" />
    </a>
    <a href="https://github.com/sdqri/rigelsdk/pulls">
      <img alt="GitHub pull requests" src="https://img.shields.io/github/issues-pr/sdqri/rigelsdk?style=flat&color=336791" />
    </a>
     <a href="https://github.com/sdqri/rigelsdk">
      <img alt="GitHub Downloads" src="https://img.shields.io/npm/dw/rigelsdk?style=flat&color=336791" />
    </a>
    <a href="https://github.com/sdqri/rigelsdk">
      <img alt="GitHub Total Downloads" src="https://img.shields.io/npm/dt/rigelsdk?color=336791&label=Total%20downloads" />
    </a>
 <a href="https://github.com/sdqri/rigelsdk">
      <img alt="GitHub release" src="https://img.shields.io/github/release/sdqri/rigelsdk.svg?style=flat&color=336791" />
    </a>
    <br />
  <a href="https://github.com/sdqri/rigelsdk/issues/new/choose">Report Bug</a> /
  <a href="https://github.com/sdqri/rigelsdk/issues/new/choose">Request Feature</a>
  </p>

# Getting started

## Installation

> Install with yarn or npm: `yarn` or `npm`:

```bash
# yarn
yarn add rigelsdk
```

```bash
# npm
npm i rigelsdk --save
```

### Import the lib with es6 or cjs

```mjs
// es6
import rigelsdk from 'rigelsdk';
```

```cjs
// cjs
const rigelsdk = require('rigelsdk');
```

### Usage examples

```cjs
#!/usr/bin/env node
const KEY = 'secretkey';
const SALT = 'secretsalt';
const BASE_URL = '<put rigel url here>'; //~http://localhost:8080/rigel

const rigelSDK = new rigelsdk.SDK(BASE_URL, KEY, SALT);

const proxyURL = await rigelSDK.proxyImage(
  'https://www.pakainfo.com/wp-content/uploads/2021/09/image-url-for-testing.jpg',
  new rigelsdk.Options({ Width: 100, Height: 100, Type: ImageType.WEBP }),
  Date.now() + 1000 * 60 * 60 * 24, // 1 day expiry
);

// Creating short url
const shortURL = await rigelSDK.tryShortURL(
  'https://www.pakainfo.com/wp-content/uploads/2021/09/image-url-for-testing.jpg',
  new rigelsdk.Options({ Width: 100, Height: 100, Type: ImageType.WEBP }),
  Date.now() + 1000 * 60 * 60 * 24, // 1 day expiry
);

// BatchedCache
const batchedCachedImageArgs: models.ProxyParams[] = [
  new models.ProxyParams({
    img: 'https://www.pakainfo.com/wp-content/uploads/2021/09/image-url-for-testing.jpg',
    options: new models.Options({
      Height: 100,
      Width: 100,
      Type: ImageType.WEBP,
    }),
  }),
  new models.ProxyParams({
    img: 'hhtps://img.freepik.com/premium-photo/baby-cat-british-shorthair_648604-47.jpg',
    options: new models.Options({
      Height: 100,
      Width: 100,
      Type: ImageType.WEBP,
    }),
  }),
];
const result: models.CacheImageResponse[] = await rigelSDK.batchedCacheImage(batchedCachedImageArgs, -1);
```

## 🤝 Contributing

Contributions, issues and feature requests are welcome!<br />Feel free to check [issues page](issues).

## Show your support

Give a ⭐️ if this project helped you!

## 📝 License

This SDK is distributed under the
[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0),
see LICENSE.txt for more information.

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