API Reference

Read human verification data directly from Starknet. No API keys, no backend, no gas.

How it works

1. User verifies on HumanGate Portal → attestation is stored on Starknet

2. Your dApp reads the contract → isHuman(), isEligible(), hasConsumed()

All verification data lives on-chain. You read it for free using HumanGateChainReader from @humangate/sdk. No API keys, no backend calls, no gas costs.

Install

Terminal
npm install @humangate/sdk

Setup

humangate.ts
import { HumanGateChainReader } from "@humangate/sdk";

const reader = new HumanGateChainReader({
  rpcUrl: "https://rpc.starknet.lava.build",
  registryAddress: "0x07f66804a1556e31993afb4eddfb2c90b78f67785c92a5860a076edc38b17d26",
});

Methods

MethodReturnsDescription
isHuman(address, minLevel?)booleanIs this address a verified human? Checks all active providers.
getAttestation(address, providerId)AttestationViewFull attestation details: level, issued_at, expires_at, is_revoked.
isEligible(address, scopeHash, providerId)booleanCan this human perform a scoped action (airdrop, vote, etc.)?
hasConsumed(address, scopeHash)booleanHas the action already been consumed (double-claim check)?

AttestationView type

types.ts
interface AttestationView {
  provider_id: string;    // e.g. "worldcoin"
  level: number;          // 1 = device, 2 = orb
  issued_at: number;      // unix timestamp
  expires_at: number;     // unix timestamp (0 = never)
  is_revoked: boolean;
}

Example: Gate an airdrop

airdrop-check.ts
// Check if user is verified and eligible for your airdrop
const isHuman = await reader.isHuman(userAddress);

if (!isHuman) {
  // Redirect to HumanGate Portal to verify
  window.location.href = "https://humangate.xyz/portal";
  return;
}

const eligible = await reader.isEligible(userAddress, scopeHash, "worldcoin");
const consumed = await reader.hasConsumed(userAddress, scopeHash);

if (eligible && !consumed) {
  // User can claim — call your contract's claim function
}

Cairo integration

For smart contract integration (calling the registry from Cairo), see the Smart Contract docs.

Contract Address

HumanGateRegistry on Starknet Mainnet:

text
0x07f66804a1556e31993afb4eddfb2c90b78f67785c92a5860a076edc38b17d26

View on Starkscan →