Worldcoin

Quick Start

Anonymous Actions

Anonymous Actions unlock a set of other use cases beyond verifying accounts (which is enabled by Sign In with World ID). With Anonymous Actions, you can verify a person is doing something only once, for a particular context.

  1. Create an action for your app in the Developer Portal. You must provide the following values:

    • Action: The stringified action to be taken by the user.
    • Max Verifications: For Cloud actions only. The number of times a user can take this action. A value of 0 indicates that unlimited verifications can take place.

    The "Description" field is shown to your user in the World app as they sign with their World ID, alongside your application logo. Make sure to fully describe the exact action the user is taking.

    An action scopes uniqueness for users, which means users will always generate the same ID (nullifier hash) when performing the same action. Cloud actions natively handle sybil-resistance with a limit set in the Developer Portal. For on-chain use cases, you can track this nullifier hash in your smart contract to implement sybil-resistance.

  2. Get started with one of our template repositories!

Cloud (API) VerificationOn-Chain Verification

If you'd rather not use our template repository, look at the Cloud Verification documentation.

Getting started with our Cloud template is easy:

  • Create a new repository based on our Cloud Verification template.
  • Rename .env.example to .env.local and input your App ID and Action Name.
  • Run pnpm i && pnpm dev to install dependencies and start the server.
  • Open http://localhost:3000 in your web browser to see the demo!

This example app uses Next.js and Vercel to host the app. It sends a request from its backend to our API's /verify endpoint to verify the proof returned from IDKit.

It's very important that you verify the proof on your backend, not your frontend. Otherwise, users can easily bypass your verification by manipulating state in the frontend.

Modify the /src/pages/api/verify.ts file to add code that runs in the backend after a user is verified. For example, you can add code to mark a user as verified in a database, or to send a user a reward.

Modify the onSuccess function in /src/pages/index.tsx to add code that runs in the frontend after a user is verified. For example, you can add code to show a success message to the user.\

And that's it! World ID is now fully implemented, and you can build the rest of your app around this template.