# @eternaltwin/oauth-client-http

> Oauth client for Eternaltwin and Twinoid.

Latest version **0.17.2** (published 2026-10-22) · 0 weekly downloads

## Install

```sh
npm install @eternaltwin/oauth-client-http
pnpm add @eternaltwin/oauth-client-http
yarn add @eternaltwin/oauth-client-http
bun add @eternaltwin/oauth-client-http
```

## Health

**Score 60/100 (C)** — status: active.

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

Warnings: low downloads; no types; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.17.2 |
| Published | 2026-10-22 |
| First published | 2024-01-06 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | ESM |
| Node | >=14.13.1 |
| Dependencies | 12 |
| Unpacked size | 29.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | demurgos, biosha |

## Links

- npm: https://www.npmjs.com/package/@eternaltwin/oauth-client-http
- Repository: https://gitlab.com:eternaltwin/etwin
- Homepage: https://gitlab.com/eternaltwin/etwin
- npm.io page: https://npm.io/package/@eternaltwin/oauth-client-http

## Dependencies (12)

- [jws](https://npm.io/package/jws.md) ^4.0.1
- [kryo](https://npm.io/package/kryo.md) ^0.16.1
- [tslib](https://npm.io/package/tslib.md) ^2.8.1
- [kryo-json](https://npm.io/package/kryo-json.md) ^0.16.1
- [@types/jws](https://npm.io/package/@types/jws.md) ^3.2.11
- [superagent](https://npm.io/package/superagent.md) ^10.3.0
- [auth-header](https://npm.io/package/auth-header.md) ^1.0.0
- [jsonwebtoken](https://npm.io/package/jsonwebtoken.md) ^9.0.3
- [@eternaltwin/core](https://npm.io/package/@eternaltwin/core.md) 0.17.2
- [@types/superagent](https://npm.io/package/@types/superagent.md) ^8.1.10
- [@types/auth-header](https://npm.io/package/@types/auth-header.md) ^1.0.6
- [@types/jsonwebtoken](https://npm.io/package/@types/jsonwebtoken.md) ^9.0.10

## Recent versions

- 0.17.2 (latest) — 2026-10-22
- 0.17.1 — 2026-10-21
- 0.16.4 — 2025-02-17
- 0.16.1 — 2024-11-17
- 0.16.0 — 2024-11-15
- 0.15.0 — 2024-09-24
- 0.14.4 — 2024-09-16
- 0.14.2 — 2024-04-25
- 0.14.0 — 2024-04-21
- 0.13.0 — 2024-01-06

## README

# HTTP-based Oauth client service

**Work in progress**: HTTP-base Oauth Client implementation. Currently tailored for Twinoid but intended to support both Twinoid and Eternaltwin.

## CJWT

**Compressed JSON Web Token** is the format used for the OAuth state string.
This format is used to bypass the length limit imposed by some providers: Twinoid restricts the `state` length to 255 characters.

The compressed JWT is computed as `brotli(json([header, payload, signature]))`.

This format was chosen because it yielded the shortest output for the following JWT. See the table for comparisons:

```
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyZnAiOiJUT0RPIiwiYSI6eyJ0eXBlIjoiTGluayIsInVzZXJfaWQiOiJjNzI1YzQzNC0wM2ZhLTRlY2MtYmQ3Zi1iOTllMDAyZTljZWUifSwiaWF0IjoxNjAzNDU4NjYyLCJhcyI6InR3aW5vaWQuY29tIiwiZXhwIjoxNjAzNDU5NTYyfQ.uJXsgU0wPYRYDg_3NzbOEHMWlOQ6r4hk6-0lh8s40X8
```

| Encoding                  | Compression | Length  |
|---------------------------|-------------|---------|
| `jwt`                     | None        | **263** |
| `bson([hdr, pload, sig])` | None        | 225     |
| `jwt`                     | Deflate     | 223     |
| `bson([hdr, pload, sig])` | Deflate     | 225     |
| `jwt`                     | Brotli      | 212     |
| `json([hdr, pload, sig])` | None        | 212     |
| `json([hdr, pload, sig])` | Gzip        | 197     |
| `json([hdr, pload, sig])` | Deflate     | 185     |
| `json([hdr, pload, sig])` | Brotli      | **179** |

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