0.0.9 • Published 8 months ago

@holonym-foundation/human-id-sdk v0.0.9

Weekly downloads
-
License
-
Repository
-
Last release
8 months ago

@holonym-foundation/human-id-sdk

A TypeScript SDK for integrating Human ID private verification flows with SBTs into your app.

Installation

npm install @holonym-foundation/human-id-sdk

Quick Start

import { initHumanID } from '@holonym-foundation/human-id-sdk'

// Initialize the SDK. This should be done client-side (e.g., in a useEffect) because it relies on the window object
const humanID = initHumanID()

// Request a KYC SBT
const result = await humanID.requestSBT('kyc')
console.log('SBT recipient:', result?.recipient)

Query SBTs

First, to make SBT queries, you must provide an RPC URL for Optimism.

import { setOptimismRpcUrl } from '@holonym-foundation/human-id-sdk'

setOptimismRpcUrl('YOUR_OPTIMISM_RPC_URL')

Query functions:

import {
  getPhoneSBTByAddress,
  getKycSBTByAddress,
  uncheckedGetMinimalPhoneSBTByAddress,
  uncheckedGetMinimalKycSBTByAddress
} from '@holonym-foundation/human-id-sdk'

const phoneSbt = await getPhoneSBTByAddress(address)
const kycSbt = await getKycSBTByAddress(address)

const minimalPhoneSbt = await uncheckedGetMinimalPhoneSBTByAddress(address)
const minimalKycSbt = await uncheckedGetMinimalKycSBTByAddress(address)
0.0.9

8 months ago

0.0.8

8 months ago

0.0.7

8 months ago

0.0.6

8 months ago

0.0.5

8 months ago

0.0.4

8 months ago

0.0.3

8 months ago

0.0.2

8 months ago

0.0.1

8 months ago