# @aioha/aioha

> All-In-One Hive Authentication API

Latest version **1.8.5** (published 2026-04-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install @aioha/aioha
pnpm add @aioha/aioha
yarn add @aioha/aioha
bun add @aioha/aioha
```

## Health

**Score 65/100 (B)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.8.5 |
| Published | 2026-04-29 |
| First published | 2024-05-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 6 |
| Unpacked size | 830.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Author | techcoderx |
| Maintainers | techcoderx |
| Keywords | aioha, hive, blockchain, authentication |

## Links

- npm: https://www.npmjs.com/package/@aioha/aioha
- Repository: https://github.com/aioha-hive/aioha
- Homepage: https://aioha.dev
- Issues: https://github.com/aioha-hive/aioha/issues
- npm.io page: https://npm.io/package/@aioha/aioha

## Dependencies (6)

- [@hiveio/wax](https://npm.io/package/@hiveio/wax.md) ^2.0.1
- [@hiveio/dhive](https://npm.io/package/@hiveio/dhive.md) ^1.3.2
- [@noble/hashes](https://npm.io/package/@noble/hashes.md) ^2.0.1
- [@aioha/tx-digest](https://npm.io/package/@aioha/tx-digest.md) ^2.0.2
- [@metamask/providers](https://npm.io/package/@metamask/providers.md) ^22.1.1
- [@aioha/ledger-app-hive](https://npm.io/package/@aioha/ledger-app-hive.md) ^0.0.3

## Alternatives

- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads
- [escher-request](https://npm.io/package/escher-request.md) — 545 weekly downloads

## Recent versions

- 1.8.5 (latest) — 2026-04-29
- 1.8.4 — 2026-04-23
- 1.8.3 — 2026-04-23
- 1.8.2 — 2026-02-14
- 1.8.1 — 2026-01-29
- 1.8.0 — 2025-09-30
- 1.7.0 — 2025-07-21
- 1.6.1 — 2025-07-14
- 1.6.0 — 2025-05-03
- 1.6.0-beta.10 — 2025-04-28
- 1.6.0-beta.9 — 2025-04-26
- 1.6.0-beta.8 — 2025-04-25
- 1.6.0-beta.7 — 2025-04-21
- 1.6.0-beta.6 — 2025-04-18
- 1.6.0-beta.5 — 2025-04-18
- … 28 more at https://npm.io/package/@aioha/aioha/versions

## README

# Aioha

Aioha is an API that provides a common interface for working with different Hive login providers. This allows easier integration of Hive login and transacting on the network with fewer code.

This repository contains the core API designed for use in browser contexts.

## Supported Providers

* [Keychain](https://hive-keychain.com)
* [HiveAuth](https://hiveauth.com)
* [HiveSigner](https://hivesigner.com)
* [Ledger](https://hiveledger.io)
* [Peak Vault](https://vault.peakd.com)
* [MetaMask Snap](https://snaps.metamask.io/snap/npm/hiveio/metamask-snap)

## Frameworks Libraries

* Universal Web Components ([Ready Made UI](https://github.com/aioha-hive/lit-ui))
* Lit ([Provider](https://github.com/aioha-hive/providers/tree/main/lit), [Ready Made UI](https://github.com/aioha-hive/lit-ui))
* React ([Provider](https://github.com/aioha-hive/providers/tree/main/react), [Ready Made UI](https://github.com/aioha-hive/react-ui))
* Vue ([Provider](https://github.com/aioha-hive/providers/tree/main/vue))
* Svelte ([Provider](https://github.com/aioha-hive/providers/tree/main/svelte))

## Installation

```sh
pnpm i @aioha/aioha
```

## Usage Example

```js
import { initAioha, Asset, KeyTypes, Providers } from '@aioha/aioha'

// Instantiation
const aioha = initAioha({
  hiveauth: {
    name: 'Aioha',
    description: 'Aioha test app'
  },
  hivesigner: {
    app: 'ipfsuploader.app',
    callbackURL: window.location.origin + '/hivesigner.html',
    scope: ['login', 'vote']
  }
})

// Get registered providers
console.log(aioha.getProviders())

// Get current logged in user and provider name
if (aioha.isLoggedIn()) {
  console.log(aioha.getCurrentUser(), aioha.getCurrentProvider())
}

// Login with provider. Supported providers are listed above, as in Providers enum.
const login = await aioha.login(Providers.Keychain, 'hiveusername', {
  msg: 'Hello World',
  keyType: KeyTypes.Posting
})

// Transfer 1 HIVE using logged in provider
const xfer = await aioha.transfer('recipient', 1, Asset.HIVE, 'Transferred using Aioha with memo')

// Vote comment with 100% weight
const vote = await aioha.vote('author', 'permlink', 10000)

// Claim rewards
const rewardClaim = await aioha.claimRewards()
```

More usage details can be found on the Aioha documentation [here](https://aioha.dev/docs).

## Local storage reserved keys

Aioha uses certain keys in browser `localStorage` to store persistent logins, and in the case of HiveSigner provider, pass info from callback URL.

The following keys are reserved:

* General: `aiohaUsername`, `aiohaProvider`, `aiohaPubKey`, `aiohaOtherLogins`
* HiveAuth: `hiveauthToken`, `hiveauthKey`, `hiveauthExp`
* HiveSigner: `hivesignerTxId`, `hivesignerToken`, `hivesignerExpiry`, `hivesignerUsername`
* Ledger: `ledgerPath`
* MetaMask: `mmHiveSnapAccIdx`

## HiveSigner callback page

A callback page is required for HiveSigner provider. An example HTML with the code which parses the response data and stores them into `localStorage` has been included in `snippets/hivesigner.html` file.

## Build

```sh
pnpm run prepublish
```

`tsc` output can be found in `build` folder and the Webpack output can be found in `dist` folder with `bundle.js` being the entrypoint. All Webpack output files are to be served and will be loaded on-demand depending on the provider selected upon login.

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