### Install Dependencies
Source: https://docs.world.org/llms-full.txt
Install the necessary viem and inquirer packages.
```bash
npm install viem @inquirer/prompts
```
--------------------------------
### Configure IDKit and Handle Verification
Source: https://docs.world.org/world-id/idkit/react
Example showing the setup of IDKit components and an asynchronous verification handler that sends proof data to a backend API.
```javascript
preset={orbLegacy({ signal: "user-123" })}
environment="production"
handleVerify={async (result) => {
const response = await fetch("/api/verify-proof", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({ rp_id:
```
--------------------------------
### Install the Go module
Source: https://docs.world.org/world-id/idkit/go
Command to install the IDKit Go package via go get.
```bash
go get github.com/worldcoin/idkit/go/idkit@latest
```
--------------------------------
### Install Dependencies
Source: https://docs.world.org/llms-full.txt
Install the necessary packages for Wagmi integration and SIWE authentication.
```bash
pnpm add wagmi @tanstack/react-query siwe
```
--------------------------------
### Wallet output example
Source: https://docs.world.org/llms-full.txt
Example output showing the generated address and private key after running the wallet creation command.
```bash
Successfully created new keypair.
Address: 0xB815A0c4bC23930119324d4359dB65e27A846A2d
Private key: 0xcc1b30a6af68ea9a9917f1dda20c927704c5cdb2bbe0076901a8a0e40bf997c5
```
--------------------------------
### Install Foundry CLI
Source: https://docs.world.org/llms-full.txt
Downloads and installs the Foundry toolchain using the official installation script.
```bash
curl -L https://foundry.paradigm.xyz | bash
```
--------------------------------
### Install IDKit SDK
Source: https://docs.world.org/world-id/idkit/react
Installation commands for various package managers.
```bash
npm i @worldcoin/idkit
```
```bash
pnpm add @worldcoin/idkit
```
```bash
yarn add @worldcoin/idkit
```
--------------------------------
### Creating a session
Source: https://docs.world.org/world-id/4-0-migration
Example demonstrating the initialization of a session for recurring verifications.
```jsx
nullifierHashes]),_jsx(_components.span,{style:{color:`#1F2328`,"--shiki-dark":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#1F2328`,"--shiki-dark":`#9CDCFE`},children:`nullifierHash`}),_jsx(_components.span,{style:{color:`#1F2328`,"--shiki-dark":`#D4D4D4`},children:`]) `}),_jsx(_components.span,{style:{color:`#1F2328`,"--shiki-dark":`#9CDCFE`},children:`revert`}),_jsx(_components.span,{style:{color:`#8250DF`,"--shiki-dark":`#DCDCAA`},children:` DuplicateNullifier`}),_jsx(_components.span,{style:{color:`#1F2328`,"--shiki-dark":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,"--shiki-dark":`#9CDCFE`},children:`nullifierHash`}),_jsx(_components.span,{style:{color:`#1F2328`,"--shiki-dark":`#D4D4D4`},children:`);`})]})),
,_jsx(_components.span,{className:`line`}),
,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,"--shiki-dark":`#6A9955`},children:` // Verify Legacy Proof`})}),
,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,"--shiki-dark":`#9CDCFE`},children:` WorldIDRouter`}),_jsx(_components.span,{style:{color:`#1F2328`,"--shiki-dark":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,"--shiki-dark":`#DCDCAA`},children:`verify`}),_jsx(_components.span,{style:{color:`#1F2328`,"--shiki-dark":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,"--shiki-dark":`#D4D4D4`},children:`...`}),_jsx(_components.span,{style:{color:`#1F2328`,"--shiki-dark":`#D4D4D4`},children:`)`})]})),
,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,"--shiki-dark":`#D4D4D4`},children:`}`})}),
]
```
--------------------------------
### Install dependencies
Source: https://docs.world.org/llms-full.txt
Install the required packages for the server-side workflow and client-side React bindings.
```bash
# Server — human-in-the-loop + peer dependencies
npm install @worldcoin/human-in-the-loop ai workflow
# Client — React bindings + peer dependencies
npm install @worldcoin/human-in-the-loop-react @worldcoin/idkit ai react
```
--------------------------------
### Install MiniKit dependencies
Source: https://docs.world.org/llms-full.txt
Install the required MiniKit packages for your project.
```bash
pnpm add @worldcoin/minikit-js @worldcoin/minikit-react
```
--------------------------------
### Install AgentKit
Source: https://docs.world.org/agents/agent-kit/integrate
Install the AgentKit package via npm.
```bash
npm install @worldcoin/agentkit
```
--------------------------------
### Install project dependencies
Source: https://docs.world.org/llms-full.txt
Installs the necessary Node.js packages for the template application.
```bash
pnpm install
```
--------------------------------
### Install Mini Apps UI Kit
Source: https://docs.world.org/mini-apps/guidelines/app-guidelines
Use NPM to install the React-based UI component library for mini app development.
```bash
npm install @worldcoin/mini-apps-ui-kit-react
```
--------------------------------
### Install @worldcoin/idkit-core
Source: https://docs.world.org/world-id/idkit/javascript
Commands to install the IDKit Core SDK using npm or pnpm.
```APIDOC
## Installation
### npm
```bash
npm i @worldcoin/idkit-core
```
### pnpm
```bash
pnpm add @worldcoin/idkit-core
```
```
--------------------------------
### Install MiniKit-JS
Source: https://docs.world.org/llms-full.txt
Install the core library via package manager or include it via CDN for browser-based environments.
```bash
pnpm install @worldcoin/minikit-js
```
```html
```
--------------------------------
### Using selfieCheckLegacy Preset
Source: https://docs.world.org/world-id/idkit/javascript
Example of initializing the selfieCheckLegacy preset with a signal.
```javascript
.preset(selfieCheckLegacy({ signal: "user-123" }));
const connectorURI = request.connectorURI; // display to user (URL with code embedded)
const expiresAt = request.expiresAt; // drive a countdown
const completion = await request.pollUntilCompletion();
```
--------------------------------
### Swap Action URL Example
Source: https://docs.world.org/llms-full.txt
A sample URL generated for the Swap quick action.
```text
https://worldcoin.org/mini-app?app_id=app_6c5c5717c77abe83be8814c032c3a6f9&path=%2F%3FfromToken%3D0x2cFc85d8E48F8EAB294be644d9E25C3030863003
```
--------------------------------
### Social Share Preview URL Examples
Source: https://docs.world.org/mini-apps/growth/invites-viral
Examples of how mini-app URLs are structured for social sharing and how they map to og:image sources.
```text
world.org/mini-app?app_id=1234&path=/invite?code=abcd
```
```text
[your-miniapp-url]/invite?code=abcd
```
--------------------------------
### Migrating from QR / connect-URL
Source: https://docs.world.org/world-id/idkit/react
Example showing the import structure for the legacy IDKitRequestWidget.
```tsx
// Before — QR / connect-URL widget
import { IDKitRequestWidget,
```
--------------------------------
### MiniKit.install()
Source: https://docs.world.org/llms-full.txt
Initializes the MiniKit SDK at the start of the application to store device context, launch context, and user metadata.
```APIDOC
## MiniKit.install()
### Description
Manually initializes the MiniKit SDK. This should be called at the start of the application if not using the React MiniKitProvider.
### Signature
`MiniKit.install(): { success: boolean }`
### Returns
- **success** (boolean) - Indicates whether the initialization was successful.
```
--------------------------------
### Get Permissions Response JSON
Source: https://docs.world.org/mini-apps/commands/get-permissions
Example of a successful response object returned by the get permissions command.
```json
{
"executedWith": "minikit",
"data": {
"status": "success",
"version": 1,
"permissions": {
"notifications": true,
"contacts": false,
"microphone":
```
--------------------------------
### Download and Initialize simple-worldchain-node
Source: https://docs.world.org/llms-full.txt
Clone the repository and prepare the environment configuration file.
```bash
git clone https://github.com/worldcoin-foundation/simple-worldchain-node.git
cd simple-worldchain-node
cp .env.example .env
```
--------------------------------
### Recommended Session Flows
Source: https://docs.world.org/model-context-protocol/developer-portal
Example prompts for initializing team context or creating specific app types.
```text
Use the Developer Portal MCP to get my team context. If there is no app for this project, create one.
```
```text
Create a production external World ID app named Example, configure World ID, create an action called verify-account, and tell me which environment variables to add.
```
```text
Create a Mini App named Example, fill the non-image app store metadata, upload the logo, content card, and showcase images I provide, and submit it for review after confirming the final values with me.
```
--------------------------------
### Configure Mini App
Source: https://docs.world.org/model-context-protocol/developer-portal
Use this prompt to set up a new Mini App, including metadata and image assets, before submitting for review.
```text
Create a Mini App named Example, fill the non-image app store metadata, upload the logo, content card, and showcase images I provide, and submit it for review after confirming the final values with me.
```
--------------------------------
### Start Local Web Server
Source: https://docs.world.org/llms-full.txt
Command to launch the development server in the root directory of the template app.
```bash
pnpm dev
```
--------------------------------
### Initialize Project Directory
Source: https://docs.world.org/llms-full.txt
Create a new directory and initialize a Node.js project.
```bash
mkdir usdc-world-transfer
cd usdc-world-transfer
npm init -y
```
--------------------------------
### Create a new Mini App project
Source: https://docs.world.org/llms-full.txt
Use the official CLI tool to scaffold a new mini app project.
```bash
npx @worldcoin/create-mini-app@latest my-first-mini-app
```
--------------------------------
### compute_rp_signature_message example
Source: https://docs.world.org/world-id/idkit/signatures
Example of computing an RP signature message without an action.
```text
compute_rp_signature_message(
nonce = 0x008ae1aa597fa146ebd3aa2ceddf360668dea5e526567e92b0321816a4e895bd,
created_at = 1700000000,
expires_at =
```
--------------------------------
### Create a new Foundry project
Source: https://docs.world.org/llms-full.txt
Initializes a new project directory structure and navigates into it.
```bash
forge init hello-world-chain && cd hello-world-chain
```
--------------------------------
### hash_to_field examples
Source: https://docs.world.org/world-id/idkit/signatures
Examples of hashing various input types to field elements.
```text
input: "" (empty)
output: 0x00c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4
```
```text
input: "test_signal"
output: 0x00c1636e0a961a3045054c4d61374422c31a95846b8442f0927ad2ff1d6112ed
```
```text
input: [0x01, 0x02, 0x03]
output: 0x00f1885eda54b7a053318cd41e2093220dab15d65381b1157a3633a83bfd5c92
```
```text
input: "hello" (0x68656c6c6f)
output: 0x001c8aff950685c2ed4bc3174f3472287b56d9517b9c948127319a09a7a36dea
```
--------------------------------
### Sign Request and Response Handling in Go
Source: https://docs.world.org/world-id/idkit/integrate
Example of setting up a package and imports for handling World ID requests in a Go environment.
```go
package main
import
```
--------------------------------
### Install IDKit
Source: https://docs.world.org/world-id/idkit/integrate
Commands to install the required IDKit packages for different development environments.
```shellscript
npm i @worldcoin/idkit-core
```
```shellscript
npm i @worldcoin/idkit
```
--------------------------------
### Initialize RpContext in Swift
Source: https://docs.world.org/world-id/idkit/swift
Demonstrates how to import IDKit and initialize the RpContext with required backend parameters.
```swift
import IDKit
let rpContext = try RpContext(
rpId: "rp_xxxxx",
nonce: backend.nonce,
createdAt: backend.createdAt,
expiresAt: backend.expiresAt,
signature: backend.sig
)
let config =
```
--------------------------------
### Notification Request Example
Source: https://docs.world.org/api-reference/developer-portal/send-notification
Example JSON payload for sending a notification to specific wallet addresses.
```json
{
"app_id": "app_id",
"wallet_addresses": ["0x123", "0x456"],
"title": "title",
"message": "Hello ${username}, your transaction is complete!",
"mini_app_path": "mini_app_path"
}
```
--------------------------------
### Setup Providers
Source: https://docs.world.org/llms-full.txt
Wrap the application with the necessary providers for Wagmi, React Query, and MiniKit.
```tsx
"use client";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { MiniKitProvider } from "@worldcoin/minikit-js/minikit-provider";
import { WagmiProvider } from "wagmi";
import { config } from "./config";
const queryClient = new QueryClient();
export default function Providers({ children }: { children: React.ReactNode }) {
return (
{children}
);
}
```
--------------------------------
### Install IDKit Core
Source: https://docs.world.org/world-id/idkit/javascript
Installation commands for the IDKit Core package using common package managers.
```bash
npm i @worldcoin/idkit-core
```
```bash
pnpm add @worldcoin/idkit-core
```
```bash
yarn add @worldcoin/idkit-core
```
--------------------------------
### Configuring and Signing IDKit Requests
Source: https://docs.world.org/world-id/idkit/signatures
Demonstrates how to apply action and TTL configurations to an IDKit request, and how to initialize a persistent signer using an environment variable for high-throughput scenarios.
```go
idkit.WithAction("my-action"),
idkit.WithTTL(300), // optional, default 300s
)
// Or create a reusable signer for high-throughput backends
signer, err := idkit.NewSigner(os.Getenv("RP_SIGNING_KEY"))
sig, err := signer.SignRequest(idkit.WithAction("my-action"))
```
--------------------------------
### Install Sage Support Package
Source: https://docs.world.org/llms-full.txt
Install the required npm package to enable Sage Support functionality in your project.
```bash
npm install sage-support
```
--------------------------------
### Install IDKit React
Source: https://docs.world.org/world-id/idkit/react
Use these commands to install the IDKit React package using your preferred package manager.
```shellscript
npm i @worldcoin/idkit
```
```shellscript
pnpm add @worldcoin/idkit
```
--------------------------------
### Initialize Agent Book Verifier and Storage
Source: https://docs.world.org/agents/agent-kit/integrate
Setup the agent book verifier and in-memory storage instances for the agent.
```typescript
const agentBook = createAgentBookVerifier()
const storage = new InMemoryAgentKitStorage()
const hooks =
```
--------------------------------
### Sign Message Response Example
Source: https://docs.world.org/mini-apps/commands/sign-message
Example of the JSON response structure returned after a successful message signing operation.
```json
{
"executedWith": "minikit",
"data": {
"status": "success",
"version": 1,
"signature": "0xabcdef1234567890",
"address": "0x1234567890123456789012345678901234567890"
}
}
```
--------------------------------
### Suggested MCP Prompts
Source: https://docs.world.org/model-context-protocol/world-docs
Example prompts for interacting with the World Docs MCP server.
```text
Use the World Docs MCP to find the current MiniKit install steps and add them to this project.
```
```text
Search the World docs for World ID verification and explain which endpoint this app should call.
```
--------------------------------
### Initialize Wallet Client
Source: https://docs.world.org/llms-full.txt
Create a wallet client that switches between the World App provider and the browser's ethereum provider.
```tsx
import { MiniKit, getWorldAppProvider } from "@worldcoin/minikit-js";
import { createWalletClient, custom } from "viem";
import { worldchain } from "viem/chains";
const provider = MiniKit.isInWorldApp()
? getWorldAppProvider()
: window.ethereum;
const walletClient = createWalletClient({
chain: worldchain,
transport: custom(provider),
});
```
--------------------------------
### Install AgentKit Shopify Plugin via Claude Code
Source: https://docs.world.org/llms-full.txt
Use these commands within the Claude Code environment to install the necessary plugins for Shopify integration.
```bash
/plugin marketplace add worldcoin/agentkit-shopify-demo
/plugin install agentkit-shopify@worldcoin-agentkit
/reload-plugins
# Then ask Claude:
# "Help me purchase this product: https://humanrequired.shop/products/human-in-the-loop-hat"
```
--------------------------------
### GET /is-valid-root
Source: https://docs.world.org/mini-apps/guidelines/smart-contract-development-guidelines
Checks if a given root is valid.
```APIDOC
## GET /is-valid-root
### Description
Checks if a given root is valid.
### Method
GET
### Endpoint
/is-valid-root
```
--------------------------------
### Generate externalNullifierHash
Source: https://docs.world.org/world-id/reference/address-book
Example of generating an external nullifier hash.
```solidity
externalNullifier =
```
--------------------------------
### GET /status/{id}
Source: https://docs.world.org/world-id/sandbox/testing-selfie-check
Retrieves the status for a given ID.
```APIDOC
## GET /status/{id}
### Method
GET
### Endpoint
/status/{id}
### Parameters
#### Path Parameters
- **id** (string) - Required - The ID to check status for.
```
--------------------------------
### Request a Proof (Before and After)
Source: https://docs.world.org/llms-full.txt
Comparison of the legacy standalone implementation versus the new idkit-core flow requiring backend RP signatures.
```ts
import "@worldcoin/idkit-standalone";
IDKit.init({
app_id: "app_xxxxx",
action: "my-action",
signal: "user-123",
verification_level: "orb",
});
await IDKit.open();
```
```ts
import { IDKit, orbLegacy } from "@worldcoin/idkit-core";
const action = "my-action";
const signal = "user-123";
const rpContext = await fetch("/api/rp-signature", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({ action }),
}).then((r) => r.json());
const request = await IDKit.request({
app_id: "app_xxxxx",
action,
rp_context: {
rp_id: "rp_xxxxx",
nonce: rpContext.nonce,
created_at: rpContext.created_at,
expires_at: rpContext.expires_at,
signature: rpContext.sig,
},
allow_legacy_proofs: true,
environment: "production",
}).preset(orbLegacy({ signal }));
renderQrCode(request.connectorURI);
const completion = await request.pollUntilCompletion({
pollInterval: 2_000,
timeout: 120_000,
});
if (!completion.success) {
throw new Error(`World ID verification failed: ${completion.error}`);
}
await fetch("/api/verify-proof", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({ idkitResponse: completion.result }),
});
```