# @decentralized-identity/ion-sdk

> TypeScript SDK for ION

Latest version **1.0.4** (published 2024-04-25) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @decentralized-identity/ion-sdk
pnpm add @decentralized-identity/ion-sdk
yarn add @decentralized-identity/ion-sdk
bun add @decentralized-identity/ion-sdk
```

## Health

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

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

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2024-04-25 |
| First published | 2020-09-26 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 5 |
| Unpacked size | 112.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 28 |
| Maintainers | shamilovtim, mistermoe, csuwildcat, henrytsai, symorton, ci_identity_foundation |

## Links

- npm: https://www.npmjs.com/package/@decentralized-identity/ion-sdk
- Repository: https://github.com/decentralized-identity/ion-sdk
- Homepage: https://github.com/decentralized-identity/ion-sdk#readme
- Issues: https://github.com/decentralized-identity/ion-sdk/issues
- npm.io page: https://npm.io/package/@decentralized-identity/ion-sdk

## Dependencies (5)

- [uri-js](https://npm.io/package/uri-js.md) ^4.4.1
- [canonicalize](https://npm.io/package/canonicalize.md) ^2.0.0
- [multiformats](https://npm.io/package/multiformats.md) ^12.1.3
- [@noble/ed25519](https://npm.io/package/@noble/ed25519.md) ^2.0.0
- [@noble/secp256k1](https://npm.io/package/@noble/secp256k1.md) ^2.0.0

## Recent versions

- 1.0.4 (latest) — 2024-04-25
- 1.0.2 — 2024-02-26
- 1.0.1 — 2023-06-20
- 1.0.0 — 2023-06-20
- 0.6.0 — 2022-10-12
- 0.5.0 — 2021-07-16
- 0.4.3 — 2021-07-13
- 0.4.2 — 2021-03-22
- 0.4.1 — 2020-11-17
- 0.4.0 — 2020-11-17
- 0.3.1 — 2020-11-04
- 0.3.0 — 2020-11-03
- 0.2.0 — 2020-09-26
- 0.1.0 — 2020-09-26

## README

# TypeScript/JavaScript SDK for `did:ion`
- This SDK allows you to create `did:ion` operations that are ready to be submitted to an ION node.
- You can also use the SDK to create long-form ION DIDs.
- This SDK is compatible with both node.js and browser.

Code Coverage

![Statements](https://img.shields.io/badge/statements-100%25-brightgreen.svg?style=flat) ![Branches](https://img.shields.io/badge/branches-100%25-brightgreen.svg?style=flat) ![Functions](https://img.shields.io/badge/functions-100%25-brightgreen.svg?style=flat) ![Lines](https://img.shields.io/badge/lines-100%25-brightgreen.svg?style=flat)

```
npm i @decentralized-identity/ion-sdk --save
```

## Additional Setup
This package depends on the [`@noble/ed25519`](https://github.com/paulmillr/noble-ed25519#usage) and [`@noble/secp256k1`](https://github.com/paulmillr/noble-secp256k1#usage) v2, thus additional steps are needed for some environments:

```ts
// node.js 18 and earlier, needs globalThis.crypto polyfill
import { webcrypto } from 'node:crypto';
// @ts-ignore
if (!globalThis.crypto) globalThis.crypto = webcrypto;

// React Native needs crypto.getRandomValues polyfill and sha256 for `@noble/secp256k1`
import 'react-native-get-random-values';
import { hmac } from '@noble/hashes/hmac';
import { sha256 } from '@noble/hashes/sha256';
secp.etc.hmacSha256Sync = (k, ...m) => hmac(sha256, k, secp.etc.concatBytes(...m));
secp.etc.hmacSha256Async = (k, ...m) => Promise.resolve(secp.etc.hmacSha256Sync(k, ...m));

// React Native needs crypto.getRandomValues polyfill and sha512 for `@noble/ed25519`
import 'react-native-get-random-values';
import { sha512 } from '@noble/hashes/sha512';
ed.etc.sha512Sync = (...m) => sha512(ed.etc.concatBytes(...m));
ed.etc.sha512Async = (...m) => Promise.resolve(ed.etc.sha512Sync(...m));
```

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