Getting Started

Integrate human verification into your Starknet dApp in 5 minutes.

How It Works

1. User verifies on humangate.xyz/portal → attestation stored on Starknet

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

Users verify once on the HumanGate Portal. Your dApp just reads the result from the Starknet contract — no API keys, no backend, no gas.

Install

Terminal
npm install @humangate/sdk

Step 1: Check if user is human

Use HumanGateChainReader to read attestation data directly from the Starknet contract:

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

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

// Is this user a verified human?
const isHuman = await reader.isHuman(userAddress);

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

Step 2: Gate your action

For scoped actions (airdrops, votes), check eligibility and consumption:

airdrop.ts
// Can this user claim the airdrop?
const eligible = await reader.isEligible(userAddress, scopeHash, "worldcoin");

// Have they already claimed?
const consumed = await reader.hasConsumed(userAddress, scopeHash);

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

Step 3: Smart contract integration

For on-chain gating, call the HumanGateRegistry from your Cairo contract:

airdrop.cairo
let registry = IHumanGateDispatcher { contract_address: REGISTRY };

// Check eligibility (free read)
let eligible = registry.is_eligible(caller, scope_hash, provider_id);
assert(eligible, 'Not verified as human');

// Consume the action (prevents double-claim)
let consumed = registry.consume_action(caller, scope_hash, provider_id);
assert(consumed, 'Already used');

// Safe to proceed — distribute tokens

Verification Levels

LevelNameMethodUse Case
1DevicePhone verificationPolls, rate-limiting, community access.
2OrbBiometric verificationAirdrops, governance votes, financial operations.

Next Steps