World ID for Developers: Implementation Guide
Learn how to implement World ID in your application. Detailed explanations for developers, from SDK usage to implementation patterns.
1. World ID Implementation Overview
By integrating World ID into your app, you can cryptographically guarantee that users are human and have only one account. This enables bot prevention, fraud prevention, and fair distribution.
What World ID Enables
Authentication
- • Sign in with World ID
- • Human verification
- • Uniqueness verification
Use Cases
- • Airdrop duplicate prevention
- • Voting systems
- • Premium feature gating
Verification Levels
Orb
Iris verified. Highest level of proof of personhood. One per person.
Device
Device verification. Available without Orb. Multiple devices allowed.
2. Implementation Use Cases
Airdrops
Distribute tokens or NFTs limited to once per person. Prevent Sybil attacks.
Voting & Surveys
Fair voting systems guaranteeing one vote per person. Ideal for DAO governance.
Bot Prevention
CAPTCHA alternative. Provides stronger proof of humanity.
Auth Gating
Restrict access to features for verified users only.
3. Getting Started
Register on Developer Portal
Create an account and register your app on the Worldcoin Developer Portal.
https://developer.worldcoin.orgGet Your App ID
When you register your app, a unique App ID is issued. Use this to initialize the SDK.
app_id: "app_staging_xxx..."Define Actions
Define the purpose of verification (Action). This prevents duplicate verification for the same Action.
action: "vote-proposal-1"4. SDK Options
IDKit (JavaScript/React)
Official SDK for web applications. Works with React, Next.js, Vue.js, and more.
npm install @worldcoin/idkitMobile SDKs
Native SDKs for iOS and Android. Integrate directly into mobile apps.
Smart Contract (Solidity)
Library for on-chain verification. Available on Ethereum, Optimism, Polygon, and more.
// Using world-id-starter template
import {IWorldID} from "./interfaces/IWorldID.sol";5. Implementation Flow
Basic Authentication Flow
User clicks "Sign in with World ID" button
IDKit displays QR code or deep link
User approves verification in World App
ZKP (zero-knowledge proof) is returned to app
Verify on backend or smart contract
Code Example (React)
import { IDKitWidget } from '@worldcoin/idkit'
function App() {
const handleVerify = async (proof) => {
// Send proof to backend for verification
const res = await fetch('/api/verify', {
method: 'POST',
body: JSON.stringify(proof),
})
// Handle verification result
}
return (
<IDKitWidget
app_id="app_xxx"
action="my-action"
onSuccess={handleVerify}
verification_level="orb" // or "device"
>
{({ open }) => (
<button onClick={open}>
Verify with World ID
</button>
)}
</IDKitWidget>
)
}6. Best Practices
✅ Recommended
- • Always verify on backend - Frontend-only verification is not secure
- • Design Actions properly - Use different Actions for different purposes
- • Choose verification_level - Select orb/device based on security requirements
- • Error handling - Consider UX for verification failures
- • Test in staging - Thorough testing before production
❌ Anti-Patterns
- • Completing verification only on frontend
- • Reusing the same Action for different purposes
- • Storing and reusing proofs
- • Exposing internal details in error messages
7. Resources & Documentation
Official Resources
Official Documentation
docs.world.org
Developer Portal
developer.worldcoin.org
GitHub
github.com/worldcoin
Discord (Developer Community)
discord.gg/worldcoin
Summary
Implementing World ID is relatively easy to start with the SDK.
- 1️⃣ Register your app on Developer Portal
- 2️⃣ Install SDK (IDKit, etc.)
- 3️⃣ Add widget to frontend
- 4️⃣ Verify proof on backend
See the official documentation for detailed implementation instructions.
Get bonus WLD with this invite code
Use this invite code to receive additional WLD.
Get World App6YQ47NH