diff --git a/.mintlify/AGENTS.md b/.mintlify/AGENTS.md index bec7365b..37a02c07 100644 --- a/.mintlify/AGENTS.md +++ b/.mintlify/AGENTS.md @@ -2,6 +2,9 @@ - Write all published pages, maintenance notes, commit messages, and PR descriptions in English. - Follow the existing MDX, navigation, branding, and terminology conventions. Register pages in `docs.json`; reuse existing snippets and components when they fit. +- Explain concepts in short paragraphs, setup in numbered steps, and guide choices with links or cards. Use tables when readers need to compare the same fields or look up values. Introduce each table with a short explanation of the comparison or decision it supports. +- State what an integration returns, what the developer must validate, and what the application must enforce. Replace vague phrases such as "trust layer" or "enforce eligibility" with the specific behavior needed at that point. +- Use World Money for wallet, payment, and Mini App flows hosted in that app. Use World ID app for identity verification, credential management, and proof requests. Preserve historical World App references and exact SDK names, fields, and URL schemes such as `window.WorldApp` and `worldapp://`. See the official [World Money](https://world.org/world-money) and [World ID app](https://world.org/world-id-app) descriptions. - Document durable product behavior, public contracts, and necessary integration setup. Keep implementation walkthroughs, operational runbooks, and PR history out of published pages. - Keep changes focused. Preserve coverage of the rest of the site when extending maintenance to IDP. Explain any necessary edits outside the affected product area. - Keep commit subjects and PR titles short. Follow the repository's PR template. If there is no template, use `Summary` with one to three bullets and `Testing` with commands and outcomes or `Not run`. @@ -11,6 +14,8 @@ Keep Agent Pass in `docs.json` as a tab with `hidden: true` and `searchable: true` during MCP testing. Preserve its complete groups and page list so direct links retain the internal sidebar. Keep the scoped Agent Pass tab rules in `tailwind.css`: Mintlify otherwise reveals the hidden tab when it is active. Keep the generated `agent-pass/` pages, their URLs, agent-only homepage link, and `seo.indexing: "all"` so they remain available to search and AI tools. Do not make the tab or promotional cards visible until the public launch is requested. Read [IDP maintenance](world-id-auth-maintenance.md) before changing generated pages. Use the manifest, source lock, and compatibility contract for current coverage and provenance. +The approved capabilities navigation adds a visible World ID integration comparison and `world-id/agent-pass.mdx` entry. Home's authentication capability links to that World ID comparison. Preserve these entry points while keeping the standalone Agent Pass tab hidden and searchable; they do not change the generated guide bodies or their release status. + - Keep `worldcoin/temporal-apps/apps/idpapi/mcp/guides/*.md` as the canonical guide text shared by the Auth browser documentation, MCP, and the generated Mintlify pages. Make content changes in those Markdown files, then regenerate. The landing page in `apps/idpportal/docs.html` is excluded from this migration. - Do not edit generated `agent-pass/*.mdx` bodies directly. Keep publishing metadata and approved adaptations in `.mintlify/world-id-auth-pages.json` and `scripts/sync-world-id-auth.mjs`. Record the source commit in `.mintlify/world-id-auth-source.json` through the generator. - Read relevant source diffs and the complete canonical guides. Preserve all sections, tables, examples, limitations, errors, and instructions when converting them to MDX. If code, canonical text, and generated pages disagree, identify the conflict for review and correct the source or converter. diff --git a/.mintlify/docs-capabilities-plan.md b/.mintlify/docs-capabilities-plan.md new file mode 100644 index 00000000..9de76207 --- /dev/null +++ b/.mintlify/docs-capabilities-plan.md @@ -0,0 +1,13 @@ +# Capabilities and navigation + +First phase of the approved documentation proposal. Keep the Agent Pass guide bodies and publisher unchanged. + +- [x] Reuse the Home landing cards to lead with capabilities and keep human/agent exports aligned. +- [x] Preserve the World ID explanation and credentials, then add four linked integration cards and an IDKit/World IdP comparison at the end of the overview. Add a World ID sidebar entry pointing to the existing Agent Pass guides. +- [x] Move Address Book ownership to World Chain, preserving the old route and updating consumers. +- [x] Group the complete World Chain and Mini Apps navigation under the native Others menu. +- [x] Check navigation coverage, redirects, links, MDX syntax and spelling within two minutes total. Browser QA and full builds are skipped. + +The hidden, searchable Agent Pass tab and its complete navigation stay in place. The approved World ID reference is a deliberate discovery entry, not a standalone tab launch. Keep existing CSS hiding that tab. + +Deliver this phase in a separate draft PR against main. Agent Pass reading improvements belong to the next phase. diff --git a/.mintlify/world-id-auth-maintenance.md b/.mintlify/world-id-auth-maintenance.md index b71666c2..b04eb35b 100644 --- a/.mintlify/world-id-auth-maintenance.md +++ b/.mintlify/world-id-auth-maintenance.md @@ -19,6 +19,10 @@ The JSON files above live in `.mintlify/`; script and workflow paths are relativ - Change product guidance in the canonical Markdown, then regenerate. Do not edit generated `agent-pass/*.mdx` bodies independently. - Preserve complete sections, tables, examples, errors, limitations, and agent instructions, including everything after `Agent instructions`. Auth's HTML may omit agent-only sections; its raw Markdown and MCP are the complete sources. - Use the manifest for renamed routes, old heading aliases, and approved layout adaptations. Keep existing public URLs useful when the source reorganizes or merges topics. Do not restore obsolete product guidance merely to retain an old route. +- The Quickstart's `quickstartLayout` adaptation renders linked icon cards, environment URLs as JSON, and IDKit guidance matching the World ID overview. The registration guide's `clientAuthenticationExamples` adaptation renders credential and JWT examples. Both retain the canonical text in the agent export and require review when their source structure changes. Keep these adaptations in the publisher and regenerate; do not edit the generated twins. +- The backend guide's `oidcExamples` adaptation uses native code groups for decoded request fields and tabs for polling responses and troubleshooting. JSON blocks show decoded values, not the form-encoded wire body. Preserve the endpoint, encoding instructions, and every response-handling rule alongside these examples; the agent export retains the canonical requests and tables. +- The identity guide's `credentialCards` adaptation uses the existing Proof of Human and Proof of Presence artwork with a passkey tile. Keep credential guarantees and baseline `acr` values from the canonical table. Passkeys authenticate account control and add no biometric uniqueness or Face Auth; preserve the original table in the agent export. +- The registration guide's `benefitPublishing` adaptation shortens the Catalog walkthrough while retaining the canonical reference for agents. Its screenshot, `images/agent-pass/catalog-submit-review.jpg`, was captured from the production portal on 2026-11-13. It shows the empty listing form and submission controls, cropped to exclude account details and credentials. Recapture it when that UI changes; do not substitute a Mini App submission image. - Preserve production and sandbox examples separately. Resolve production `{{issuer}}` to `https://auth.world.org`; keep documented sandbox values on `https://sandbox.auth.world.org`. - The public adaptation of `world-id-users.md` changes its introduction for public readers. It does not remove authorization from Auth's user guide or account tools. - Review Autopilot's IDP proposals against the canonical source and apply accepted content corrections there before publishing. The publisher transports that reviewed Markdown; independent edits to generated IDP pages will be overwritten. Autopilot can continue maintaining other product areas. @@ -54,6 +58,8 @@ Automatic synchronization is active only after the workflow is merged to `main`, Agent Pass stays in `docs.json` as a tab with `hidden: true` and `searchable: true` while its published content is tested through World Docs MCP. Keep the complete groups and page list so direct links retain the internal sidebar. Mintlify reveals hidden tabs when active, so scoped rules in `tailwind.css` also hide Agent Pass from desktop and mobile tab switchers. Keep these rules in place and promotional cards hidden until launch. Keep all generated pages and `seo.indexing: "all"`; do not add `noindex` or exclude `agent-pass/` from publication. Pages remain public at their existing URLs and can appear in search. Keep the homepage's agent-only link and technical MCP references for discovery. See [Mintlify hidden pages](https://www.mintlify.com/docs/organize/hidden-pages). +World ID Overview now compares IDKit and World IdP and links to the approved `world-id/agent-pass.mdx` entry. The Home authentication capability leads to this comparison. These visible discovery entries do not make the standalone Agent Pass tab visible or alter the generated guides. + The public documentation routes use `/agent-pass/`. Redirects in `docs.json` preserve the former `/world-id-auth/` HTML and raw Markdown page URLs and send both documentation roots to `/agent-pass/quickstart`. Keep the internal `world-id-auth` configuration and script filenames unchanged. Continue dual publication. Use the compatibility contract for the actual route/resource map, including the legacy `mcp-oauth` alias and trailing-slash variants. Keep Auth's existing routes on their production or sandbox hosts: diff --git a/.mintlify/world-id-auth-pages.json b/.mintlify/world-id-auth-pages.json index 402a4bbd..19a81463 100644 --- a/.mintlify/world-id-auth-pages.json +++ b/.mintlify/world-id-auth-pages.json @@ -10,6 +10,7 @@ "sidebarTitle": "Quickstart", "description": "Register an application, connect to the World ID issuer, and add step-up authentication.", "environmentNote": true, + "quickstartLayout": true, "anchorAliases": { "choose-your-integration": [ "how-it-works", @@ -22,11 +23,14 @@ "destination": "agent-pass/app-registration.mdx", "title": "Register your application", "sidebarTitle": "Register your application", + "clientAuthenticationExamples": true, + "benefitPublishing": true, "description": "Register and manage your World ID OIDC application, credentials, callbacks, and benefit listing." }, { "source": "oidc.md", "destination": "agent-pass/connect-your-backend.mdx", + "oidcExamples": true, "title": "Connect your backend", "sidebarTitle": "Connect your backend", "description": "Connect your backend to the World ID issuer with OpenID Connect (OIDC).", @@ -72,6 +76,7 @@ { "source": "id-token.md", "destination": "agent-pass/id-tokens-and-identity.mdx", + "credentialCards": true, "title": "ID tokens and identity", "sidebarTitle": "ID tokens and identity", "description": "Validate token claims, read UserInfo, and recognize accounts using the issuer and pairwise subject." diff --git a/.mintlify/world-id-auth-source.json b/.mintlify/world-id-auth-source.json index 84ea9608..5fb7c264 100644 --- a/.mintlify/world-id-auth-source.json +++ b/.mintlify/world-id-auth-source.json @@ -1,7 +1,7 @@ { "repository": "worldcoin/temporal-apps", "sourceDirectory": "apps/idpapi/mcp/guides", - "configSha256": "4e8b3a998e58efee93b7d618df31d9aa6622faeb2c2500f46e842e54f961f915", + "configSha256": "6c2e367a6aa3083bf2be9033e54df069b603f1905b5b26d6c0e7bc94cb9865ba", "sources": { "apps/idpapi/mcp/guides/getting-started.md": "562496424aed6fa2bc19bdde442eb2b9b4f370c974c92c2c4f11c35a4d9c0fb7", "apps/idpapi/mcp/guides/app-registration.md": "f96c7a898d5198dc39587d7720d1a907a1ad6813ed444f944b36ecc242dc96a3", @@ -15,11 +15,11 @@ "apps/idpapi/mcp/guides/testing.md": "defe6bf677aec7a6f0ab7ad1ad8cda60dc4c1f5122bbb7cd6c17e4731328932a" }, "outputs": { - "agent-pass/quickstart.mdx": "ff0a735471be230f6acf560ed0cf7401ad5d70e65f94a2ba62f41d330db6ac13", - "agent-pass/app-registration.mdx": "48fddef9720ba67ddfe02d61d4168ea13ac32ca061cae17bc0567a0b5b5c3f7b", - "agent-pass/connect-your-backend.mdx": "ff499c3d536bcbb8058696188c2ff406153522c3770f7374c6423bc085dc8966", + "agent-pass/quickstart.mdx": "870bbcae12fc69400ce13b557336fe3686f0e4425d5194766de9c8564bef34d6", + "agent-pass/app-registration.mdx": "b6a6020857e9df27fd1b257d987702a0d9e7dad20f7bb1a6668d9fd6337ade36", + "agent-pass/connect-your-backend.mdx": "6c9159afaf784862b01c6237848dcfd65d3efd85f1d7da081769418ec8e7f823", "agent-pass/connect-your-auth-server.mdx": "cddab629cdadbef4d154fa719b223954d16f69c241a0d87d21bf191ac2065d1a", - "agent-pass/id-tokens-and-identity.mdx": "e7c416ec0adf5273d1d2b62b9fc1e560e4e9468f15cff3775388311e2e0f777e", + "agent-pass/id-tokens-and-identity.mdx": "2f58eae9c7ee766105df16bebdb92940969aee67e7b09f980a1a6c57170c289e", "agent-pass/step-up.mdx": "3ee436eeb2a18353dc43de69d093e71a027a379f759475e77f6b659d843a7aa2", "agent-pass/human-in-the-loop.mdx": "deb04082440ad78c9f4ce74d55348768c3e946809d86fd305da439a18f29c923", "agent-pass/xaa.mdx": "d0174c6493980c150b2859cc57458da5672c9c40c3de25deb7b5392cc4010a2c", diff --git a/README.md b/README.md index 6cbc8417..73301569 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Source for the official World developer documentation, published at **[docs.worl - **World ID** (`world-id/`) — IDKit SDKs (JS, React, Swift, Kotlin, Go), Credentials, Selfie Check, on-chain verification, API reference. - **Agent Pass** (`agent-pass/`) — OIDC integration, identity, step-up authentication, agent delegation, user connections, and developer MCP tools. See [IDP maintenance](.mintlify/world-id-auth-maintenance.md) for source ownership and publishing. -- **Mini Apps** (`mini-apps/`) — building applications that run inside World App, including commands, sharing, growth, and the MiniKit reference. +- **Mini Apps** (`mini-apps/`) — building applications that run inside World Money, including commands, sharing, growth, and the MiniKit reference. - **World Chain** (`world-chain/`) — quick start, provider integrations, tokens, and developer reference for the chain. - **MCP servers** (`model-context-protocol/`) — World's Model Context Protocol integrations (developer portal, world-docs). - **OpenAPI specs** (`openapi/`) — machine-readable specs for the World ID and Developer Portal APIs. diff --git a/agent-pass/app-registration.mdx b/agent-pass/app-registration.mdx index 1b9d7fc7..41473722 100644 --- a/agent-pass/app-registration.mdx +++ b/agent-pass/app-registration.mdx @@ -49,6 +49,83 @@ for requests that omit both `acr_values` and an `acr` claim request. ## Client authentication {#client-authentication} + + +Authenticate at the token and device authorization endpoints with your registered +method. These examples show credential fragments only. Add the fields required +by your grant, such as `grant_type`, an authorization code and PKCE verifier, or +`device_code`, and use a form encoder for the request body. + +For Basic authentication, form-encode the client ID and secret separately, join +them with `:`, then Base64-encode that string as ``. The body +`client_id` shown below is optional; when supplied, it must match the Basic +credentials. For POST and JWT authentication, omit the `Authorization` header. +Replace every placeholder with the indicated encoded value. + +{/* cspell:disable */} + +```http title="client_secret_basic (portal default)" +Content-Type: application/x-www-form-urlencoded +Authorization: Basic + +client_id= +``` + +```http title="client_secret_post" +Content-Type: application/x-www-form-urlencoded + +client_id=&client_secret= +``` + +```http title="private_key_jwt" +Content-Type: application/x-www-form-urlencoded + +client_id=&client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Ajwt-bearer&client_assertion= +``` + +{/* cspell:enable */} + +For `private_key_jwt`, register the public JWKS in the portal and keep the private +key in your backend. Use a JWT library to sign the header and payload below as +a compact RS256 assertion. These are illustrative decoded values, not a signed +assertion or reusable credentials. + +```json title="JWT header" +{ + "alg": "RS256", + "kid": "" +} +``` + +`kid` selects a registered RSA key of 2048–8192 bits. Omit `kid` only when exactly +one key is registered. + +```json title="JWT payload" +{ + "iss": "", + "sub": "", + "aud": "https://auth.world.org", + "iat": 1790000000, + "exp": 1790000300, + "jti": "" +} +``` + +Set both `iss` and `sub` to your client ID. Use a single audience: the issuer shown +above or the exact endpoint being called. Generate current `iat` and `exp` values +for each request, with `exp` at most one hour after `iat`, and a unique `jti` of +at most 256 bytes. Expiration is strict; `iat` and optional `nbf` allow 30 seconds +of clock skew. + +Use a fresh assertion for every request, retry, and device poll, including after +`authorization_pending`. Assertions are single-use across endpoints. A rejected +assertion returns HTTP 400 `invalid_client`. +Keep request bodies, Authorization headers, and callback query strings out of logs. + + + + + Authenticate at the token and device authorization endpoints with the client's registered method: @@ -74,6 +151,8 @@ Use a fresh assertion for every request, retry, and device poll, including after assertion returns HTTP 400 `invalid_client`. Keep request bodies, Authorization headers, and callback query strings out of logs. + + ## Manage credentials and callbacks {#manage-credentials-and-callbacks} When rotating credentials, keep the old secret or key active until the new one works; @@ -132,6 +211,24 @@ and private keys outside agent conversations. The ## Publish a benefit listing {#publish-a-benefit-listing} + + +Open your app's **Catalog** tab in the [developer portal](https://auth.world.org/portal). + +1. Add a listing name, description, and HTTPS benefit URL, separate from your OIDC callback. +2. Add optional public **Instructions** explaining how to claim. Exclude credentials and tokens. +3. The owner selects **Submit for review**. + +![Catalog tab showing the benefit listing fields and Submit for review below Instructions](/images/agent-pass/catalog-submit-review.jpg) + +Only approved, published listings for active clients appear in `get_benefits`. +Updates can take one minute; changing Instructions requires another review. +Your app enforces eligibility, authorization, and redemption. + + + + + If your application offers a World ID benefit, create a Catalog listing for its OIDC client in the developer portal. Add a name, description, and HTTPS application URL. The optional **Instructions** (`instructions`) field can include steps to @@ -145,3 +242,5 @@ Agents use the instructions to understand the partner's preferred claiming flow, or start at the app URL if no instructions are supplied. Your application enforces eligibility, authorization, and redemption. The application URL is separate from the OIDC callback. + + diff --git a/agent-pass/connect-your-backend.mdx b/agent-pass/connect-your-backend.mdx index 0997589b..bae24044 100644 --- a/agent-pass/connect-your-backend.mdx +++ b/agent-pass/connect-your-backend.mdx @@ -47,6 +47,28 @@ PKCE verifier bound to each server-side attempt. The decoded authorization parameters are: + +`GET https://auth.world.org/api/v1/authorize`. + +Send these as URL-encoded query parameters. + + +```json title="Authorization parameters" +{ + "client_id": "", + "redirect_uri": "https://app.example/auth/world/callback", + "response_type": "code", + "scope": "openid", + "state": "", + "nonce": "", + "code_challenge": "", + "code_challenge_method": "S256" +} +``` + + + + ```text GET https://auth.world.org/api/v1/authorize client_id= @@ -58,6 +80,7 @@ nonce= code_challenge= code_challenge_method=S256 ``` + World IdP handles passkey or proof authentication and browser-session eligibility. At the callback, validate `state` and require the response's `iss` to match the @@ -68,6 +91,26 @@ after five minutes and can be redeemed once. For a client registered with `client_secret_post`, exchange the code with these decoded form fields: + +`POST https://auth.world.org/api/v1/token` with `Content-Type: application/x-www-form-urlencoded`. + +Form-encode these fields; do not send JSON. + + +```json title="Code exchange" +{ + "grant_type": "authorization_code", + "client_id": "", + "client_secret": "", + "code": "", + "redirect_uri": "https://app.example/auth/world/callback", + "code_verifier": "" +} +``` + + + + ```text POST https://auth.world.org/api/v1/token Content-Type: application/x-www-form-urlencoded @@ -79,6 +122,7 @@ code= redirect_uri=https://app.example/auth/world/callback code_verifier= ``` + URL-encode requests. For the portal default `client_secret_basic` or `private_key_jwt`, use the [registered method](/agent-pass/app-registration#client-authentication). @@ -139,6 +183,103 @@ validate one through a profile that advertises support for it. application session or grant before authorizing access. Apply your account, freshness, assurance, and permission checks before using the result. + + + + +HTTP 400. + +```json +{ + "error": "authorization_pending" +} +``` + +Keep waiting and poll again after the interval. + + + + +HTTP 400. + +```json +{ + "error": "slow_down" +} +``` + +Add five seconds to all later intervals. An early poll can return this before the grant is checked; it never extends the attempt's expiry. + + + + +```json +{ + "error": "access_denied" +} +``` + +Stop polling. + + + + +```json +{ + "error": "expired_token" +} +``` + +Stop polling. + + + + +```json +{ + "error": "invalid_grant" +} +``` + +Stop polling. + + + + +Any other OAuth error. + +Stop polling. + + + + +```http +HTTP/1.1 503 +``` + +Temporary unavailability, never approval. End this attempt. + + + + +```http +HTTP/1.1 429 +``` + +Per-network-address flood protection on back-channel endpoints, separate from the per-client limits. It can end the attempt; `Retry-After` does not override the stop rules. + + + + +No HTTP response. + +Back off before polling again. + + + + + + | Poll response | What to do | | -------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | HTTP 400 `authorization_pending` | Keep waiting and poll again after the interval. | @@ -147,6 +288,7 @@ validate one through a profile that advertises support for it. | HTTP 503 | Temporary unavailability, never approval. End this attempt. | | HTTP 429 | Per-network-address flood protection on back-channel endpoints, separate from the per-client limits. It can end the attempt; `Retry-After` does not override the stop rules. | | Connection timeout | Back off before polling again. | + Set each request's timeout within the attempt's remaining lifetime, and stop when the attempt expires. Do not automatically restart authorization in a loop @@ -154,6 +296,23 @@ after a failed attempt. For a client registered with `client_secret_post`, the decoded request fields are: + +`POST https://auth.world.org/api/v1/device_authorization` with `Content-Type: application/x-www-form-urlencoded`. + +Form-encode these fields; do not send JSON. + + +```json title="Device authorization" +{ + "client_id": "", + "client_secret": "", + "scope": "openid" +} +``` + + + + ```text POST https://auth.world.org/api/v1/device_authorization Content-Type: application/x-www-form-urlencoded @@ -162,9 +321,28 @@ client_id= client_secret= scope=openid ``` + After waiting the returned `interval`, the decoded poll form is: + +`POST https://auth.world.org/api/v1/token` with `Content-Type: application/x-www-form-urlencoded`. + +Form-encode these fields; do not send JSON. + + +```json title="Device token polling" +{ + "grant_type": "urn:ietf:params:oauth:grant-type:device_code", + "client_id": "", + "client_secret": "", + "device_code": "" +} +``` + + + + ```text POST https://auth.world.org/api/v1/token Content-Type: application/x-www-form-urlencoded @@ -174,6 +352,7 @@ client_id= client_secret= device_code= ``` + Use your form encoder. For other methods, use the [registered client authentication](/agent-pass/app-registration#client-authentication). @@ -274,6 +453,84 @@ through existing sessions. Match UserInfo `sub` to the ID token if you use UserI ## Troubleshooting {#troubleshooting} + + +Select an error to see what to check. OAuth failures provide `error` and +`error_description` in a JSON response or authorization error redirect. +Use `error` to choose how your application responds and `error_description` +to diagnose malformed parameters. + + + Descriptions never echo submitted values. Credential, grant, and service + errors use generic descriptions. Keep dependency failures distinguishable + from invalid authentication. + + + + + +`invalid_scope` + +Request `openid` for World ID authentication or `openid offline_access` for XAA delegation when discovery advertises it; `email` is also accepted. Remove other library scopes. + + + + +HTTP 400 `unsupported_grant_type` + +Use a grant type advertised by discovery. See [XAA availability](/agent-pass/xaa#requirements) for refresh and exchange. + + + + +Authorization `invalid_request` + +Check the active client, exact registered callback, state, nonce, S256 challenge, response mode, and supported prompt. Bad client/callback requests fail without redirecting to your callback. + +Client and callback mismatches use the same guidance. + + + + +`invalid_client` at token/device endpoint + +Check environment, registered auth method, credential encoding, and that methods are not mixed. For JWTs check audience, key, expiry, and a fresh JTI per request. Basic failures use HTTP 401; POST/JWT failures use HTTP 400. + + + + +`invalid_grant` + +Check expiry, single-use code, exact callback, PKCE verifier, and client binding. Do not blindly replay a possibly consumed code. + + + + +`login_required` / `interaction_required` + +A `prompt=none` request cannot complete silently. Start an interactive request when appropriate. + + + + +`account_not_eligible` / `client_registration_disabled` in portal + +Check participant Google-account eligibility and registration availability with the organizer/operator. These are not World ID proof failures. + + + + +HTTP 503 + +Treat as temporary unavailability, never invalid identity or successful approval. Use bounded requests; apply the device polling rules above. + + + + + + + + OAuth failures include a human-readable `error_description` alongside `error` in the JSON response or authorization error redirect. Use the description to diagnose malformed parameters, and use the `error` code to decide how your application responds. @@ -292,3 +549,5 @@ Keep dependency failures distinguishable from invalid authentication. | `login_required` / `interaction_required` | A `prompt=none` request cannot complete silently. Start an interactive request when appropriate. | | `account_not_eligible` / `client_registration_disabled` in portal | Check participant Google-account eligibility and registration availability with the organizer/operator. These are not World ID proof failures. | | HTTP 503 | Treat as temporary unavailability, never invalid identity or successful approval. Use bounded requests; apply the device polling rules above. | + + diff --git a/agent-pass/id-tokens-and-identity.mdx b/agent-pass/id-tokens-and-identity.mdx index 7467f928..9bd1ec50 100644 --- a/agent-pass/id-tokens-and-identity.mdx +++ b/agent-pass/id-tokens-and-identity.mdx @@ -16,12 +16,44 @@ Choose which verification your application accepts separately from how recently the person must authenticate. A World ID account can hold both Orb and Selfie Check credentials, plus passkeys for authentication. + +
+
+ + Proof of Human credential card +

Proof of Human

+

Iris-based verification at an Orb provides high assurance of unique humanness.

+

Baseline acr

+

https://world.org/oidc/acr/orb

+
+ + Passkey credential card +

Passkey

+

Authenticates control of the account with WebAuthn user verification. It adds no biometric uniqueness verification.

+

Baseline acr

+

The account's Orb or Selfie Check class, or no acr if it holds neither.

+
+ + Proof of Presence credential card +

Proof of Presence

+

Camera-based liveness and facial similarity checks provide a medium-assurance signal of humanness and uniqueness, with greater duplicate-account risk than Orb.

+

Baseline acr

+

https://world.org/oidc/acr/selfie

+
+
+
+
+ + + | Credential | What it establishes | Baseline `acr` | | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- | | Orb | Iris-based verification at an Orb provides high assurance of unique humanness. | `https://world.org/oidc/acr/orb` | | Selfie Check | Camera-based liveness and facial similarity checks provide a medium-assurance signal of humanness and uniqueness, with greater duplicate-account risk than Orb. | `https://world.org/oidc/acr/selfie` | | Passkey | Authenticates control of the account with WebAuthn user verification. It adds no biometric uniqueness verification. | The account's Orb or Selfie Check class, or no `acr` if it holds neither. | + + [Orb verification](https://docs.world.org/world-id/credentials/1) is suited to applications that need stronger resistance to duplicate accounts. [Selfie Check](https://docs.world.org/world-id/credentials/11) is available without diff --git a/agent-pass/quickstart.mdx b/agent-pass/quickstart.mdx index b9af6664..ebdd64aa 100644 --- a/agent-pass/quickstart.mdx +++ b/agent-pass/quickstart.mdx @@ -28,6 +28,33 @@ identifier. Your application owns its accounts, sessions, permissions, and actio [Set up your client](/agent-pass/app-registration), then follow the path for your application. An existing auth server can act as the OIDC client. + + + + Authenticate through a browser + + + Authenticate a CLI or client without a browser callback + + + Require recent or specific authentication before an action + + + Pause an agent workflow for a human checkpoint + + + Use World ID for your application's primary sign-in + + + Authorize access to your MCP server + + + Accept delegated access through an XAA-capable host + + + + + | Goal | Guide | | ---------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | | Authenticate through a browser | [Authorization Code Flow](/agent-pass/connect-your-backend#sign-in-through-the-browser) | @@ -37,6 +64,7 @@ for your application. An existing auth server can act as the OIDC client. | Use World ID for your application's primary sign-in | [Primary sign-in](/agent-pass/connect-your-backend#primary-sign-in) | | Authorize access to your MCP server | [MCP authorization](/agent-pass/connect-your-auth-server) | | Accept delegated access through an XAA-capable host | [Cross-App Access (XAA)](/agent-pass/xaa) | + Keep your existing sign-in and add step-up when your application needs World ID authentication before sensitive actions. The [Tokens and identity reference](/agent-pass/id-tokens-and-identity) @@ -49,11 +77,25 @@ Before launch, complete the checks in ## Environment values {#environment-values} + +Production URLs for your OIDC client and [developer portal](https://auth.world.org/portal): + +```json +{ + "issuer": "https://auth.world.org", + "discovery": "https://auth.world.org/.well-known/openid-configuration", + "developer_portal": "https://auth.world.org/portal" +} +``` + + + | Setting | Value | | ---------------- | --------------------------------------------- | | Issuer | `https://auth.world.org` | | Discovery | `https://auth.world.org/.well-known/openid-configuration` | | Developer portal | [Portal](https://auth.world.org/portal) | + Use registration, credentials, and discovery from the same environment. The [authentication profile](/agent-pass/connect-your-backend#configure-your-oidc-library) @@ -61,6 +103,26 @@ lists supported scopes, grants, signing algorithms, and client requirements. ## Other World ID integrations {#other-world-id-integrations} + +IDKit gives your application World ID proofs to verify. World IdP gives it +OpenID Connect ID tokens to validate. Keep their registrations, credentials, and +identifiers separate. + +- **Verify a World ID proof (IDKit):** verify the complete proof on your backend. + For a one-use action, atomically reject any `nullifier` already accepted for that + app and action. Check authentication freshness separately from + stored uniqueness results. Follow the + [IDKit setup and verification guide](https://docs.world.org/world-id/idkit/integrate). +- **Verify returning users (IDKit):** verify a new proof for the account's saved + `session_id` and reject reused `session_nullifier` values. Each check still + requires user interaction and a fresh proof. Manage + application login cookies and World IdP browser + sessions separately from proof sessions. Follow + the [session-proof guide](https://docs.world.org/world-id/idkit/session-proofs) + for registration, signed requests, verification, and replay checks. + + + These guides cover OIDC integration with World IdP. Use World IdP's registrations, credentials, and identifiers only for that flow; IDKit proof applications use their own. @@ -77,6 +139,7 @@ applications use their own. sessions separately from proof sessions. Follow the [session-proof guide](https://docs.world.org/world-id/idkit/session-proofs) for registration, signed requests, verification, and replay checks. + **Legacy Sign In with World ID is deprecated.** Use World IdP's OIDC flow for new sign-in integrations; legacy credentials and identities are not interchangeable diff --git a/docs.json b/docs.json index 72756824..0d3ab2a0 100644 --- a/docs.json +++ b/docs.json @@ -71,6 +71,12 @@ "world-id/overview" ] }, + { + "group": "Agent Pass", + "pages": [ + "world-id/agent-pass" + ] + }, { "group": "IDKit", "pages": [ @@ -169,171 +175,176 @@ ] }, { - "tab": "Mini Apps", - "groups": [ - { - "group": "Introduction", - "pages": [ - "mini-apps/index" - ] - }, + "tab": "Others", + "menu": [ { - "group": "Integrate", - "pages": [ - "mini-apps/quick-start/installing", - "mini-apps/quick-start/init", - "mini-apps/quick-start/commands", - "mini-apps/quick-start/responses", - "mini-apps/quick-start/testing", - "mini-apps/quick-start/app-store", + "item": "World Chain", + "groups": [ { - "group": "Guidelines", + "group": "About World Chain", "pages": [ - "mini-apps/guidelines/app-guidelines", - "mini-apps/guidelines/design-guidelines", - "mini-apps/guidelines/policy", - "mini-apps/guidelines/features-and-guidelines" + "world-chain/index", + "world-chain/quick-start/why", + "world-chain/quick-start/features", + "world-chain/quick-start/data" ] - } - ] - }, - { - "group": "Commands", - "pages": [ - "mini-apps/commands/verify", - "mini-apps/commands/pay", - "mini-apps/commands/wallet-auth", - "mini-apps/commands/send-transaction", - "mini-apps/commands/chat", - "mini-apps/commands/sign-message", - "mini-apps/commands/sign-typed-data", - "mini-apps/commands/share-contacts", - "mini-apps/commands/request-permission", - "mini-apps/commands/get-permissions", - "mini-apps/commands/how-to-send-notifications", - "mini-apps/commands/send-haptic-feedback", - "mini-apps/commands/share", - "mini-apps/commands/attestation", - "mini-apps/commands/close-miniapp" - ] - }, - { - "group": "Technical Reference", - "pages": [ - "mini-apps/reference/address-book", - "mini-apps/reference/usernames", - "mini-apps/reference/status-page", - "mini-apps/reference/payment-methods", - "mini-apps/reference/microphone", + }, + { + "group": "Using World Chain", + "pages": [ + "world-chain/quick-start/index", + "world-chain/quick-start/fund-wallet", + "world-chain/quick-start/info" + ] + }, { - "group": "Quick Actions", + "group": "Building on World Chain", "pages": [ - "mini-apps/sharing/quick-actions", - "mini-apps/sharing/add-money-qa", - "mini-apps/sharing/swap-qa", - "mini-apps/sharing/earn-wld-qa", - "mini-apps/sharing/dna-qa", - "mini-apps/sharing/sage-qa" + "world-chain/developers/deploy", + "world-chain/developers/template", + "world-chain/developers/world-chain-contracts", + "world-chain/developers/fees", + "world-chain/developers/evm-equivalence", + "world-chain/developers/grants" + ] + }, + { + "group": "Infrastructure Providers", + "pages": [ + "world-chain/providers/nodes", + "world-chain/providers/bridges", + "world-chain/providers/data", + "world-chain/providers/explorers", + "world-chain/providers/developer-tooling", + "world-chain/providers/oracles", + "world-chain/providers/paymasters", + "world-chain/providers/onramps" + ] + }, + { + "group": "Technical Reference", + "pages": [ + "world-chain/reference/address-book", + "world-chain/reference/useful-contracts", + "world-chain/reference/node-setup" + ] + }, + { + "group": "Tokens", + "pages": [ + "world-chain/tokens/bridging", + "world-chain/tokens/superchain-token", + "world-chain/tokens/usdc" + ] + }, + { + "group": "Further Reading", + "pages": [ + "world-chain/resources" ] } ] }, { - "group": "Migration", - "pages": [ - "mini-apps/migration/web-to-miniapp", - "mini-apps/migration/standalone-dapp", - "mini-apps/migration/minikit-v2" - ] - }, - { - "group": "Further Reading", - "pages": [ - "mini-apps/more/webview-spec", - "mini-apps/ecosystem/ecosystem", - "mini-apps/more/community-tools-perks", - "mini-apps/more/faq", + "item": "Mini Apps", + "groups": [ + { + "group": "Introduction", + "pages": [ + "mini-apps/index" + ] + }, + { + "group": "Integrate", + "pages": [ + "mini-apps/quick-start/installing", + "mini-apps/quick-start/init", + "mini-apps/quick-start/commands", + "mini-apps/quick-start/responses", + "mini-apps/quick-start/testing", + "mini-apps/quick-start/app-store", + { + "group": "Guidelines", + "pages": [ + "mini-apps/guidelines/app-guidelines", + "mini-apps/guidelines/design-guidelines", + "mini-apps/guidelines/policy", + "mini-apps/guidelines/features-and-guidelines" + ] + } + ] + }, + { + "group": "Commands", + "pages": [ + "mini-apps/commands/verify", + "mini-apps/commands/pay", + "mini-apps/commands/wallet-auth", + "mini-apps/commands/send-transaction", + "mini-apps/commands/chat", + "mini-apps/commands/sign-message", + "mini-apps/commands/sign-typed-data", + "mini-apps/commands/share-contacts", + "mini-apps/commands/request-permission", + "mini-apps/commands/get-permissions", + "mini-apps/commands/how-to-send-notifications", + "mini-apps/commands/send-haptic-feedback", + "mini-apps/commands/share", + "mini-apps/commands/attestation", + "mini-apps/commands/close-miniapp" + ] + }, { - "group": "Growth Playbook", + "group": "Technical Reference", "pages": [ - "mini-apps/growth/index", - "mini-apps/growth/invites-viral", - "mini-apps/growth/gamification", - "mini-apps/growth/notifications", - "mini-apps/growth/analytics" + "mini-apps/reference/usernames", + "mini-apps/reference/status-page", + "mini-apps/reference/payment-methods", + "mini-apps/reference/microphone", + { + "group": "Quick Actions", + "pages": [ + "mini-apps/sharing/quick-actions", + "mini-apps/sharing/add-money-qa", + "mini-apps/sharing/swap-qa", + "mini-apps/sharing/earn-wld-qa", + "mini-apps/sharing/dna-qa", + "mini-apps/sharing/sage-qa" + ] + } + ] + }, + { + "group": "Migration", + "pages": [ + "mini-apps/migration/web-to-miniapp", + "mini-apps/migration/standalone-dapp", + "mini-apps/migration/minikit-v2" + ] + }, + { + "group": "Further Reading", + "pages": [ + "mini-apps/more/webview-spec", + "mini-apps/ecosystem/ecosystem", + "mini-apps/more/community-tools-perks", + "mini-apps/more/faq", + { + "group": "Growth Playbook", + "pages": [ + "mini-apps/growth/index", + "mini-apps/growth/invites-viral", + "mini-apps/growth/gamification", + "mini-apps/growth/notifications", + "mini-apps/growth/analytics" + ] + } ] } ] } ] }, - { - "tab": "World Chain", - "groups": [ - { - "group": "About World Chain", - "pages": [ - "world-chain/index", - "world-chain/quick-start/why", - "world-chain/quick-start/features", - "world-chain/quick-start/data" - ] - }, - { - "group": "Using World Chain", - "pages": [ - "world-chain/quick-start/index", - "world-chain/quick-start/fund-wallet", - "world-chain/quick-start/info" - ] - }, - { - "group": "Building on World Chain", - "pages": [ - "world-chain/developers/deploy", - "world-chain/developers/template", - "world-chain/developers/world-chain-contracts", - "world-chain/developers/fees", - "world-chain/developers/evm-equivalence", - "world-chain/developers/grants" - ] - }, - { - "group": "Infrastructure Providers", - "pages": [ - "world-chain/providers/nodes", - "world-chain/providers/bridges", - "world-chain/providers/data", - "world-chain/providers/explorers", - "world-chain/providers/developer-tooling", - "world-chain/providers/oracles", - "world-chain/providers/paymasters", - "world-chain/providers/onramps" - ] - }, - { - "group": "Technical Reference", - "pages": [ - "world-chain/reference/useful-contracts", - "world-chain/reference/node-setup" - ] - }, - { - "group": "Tokens", - "pages": [ - "world-chain/tokens/bridging", - "world-chain/tokens/superchain-token", - "world-chain/tokens/usdc" - ] - }, - { - "group": "Further Reading", - "pages": [ - "world-chain/resources" - ] - } - ] - }, { "tab": "API Reference", "groups": [ @@ -778,7 +789,7 @@ }, { "source": "/reference/address-book", - "destination": "/world-id/reference/address-book" + "destination": "/world-chain/reference/address-book" }, { "source": "/reference/api", @@ -902,7 +913,7 @@ }, { "source": "/world-id/reference/address-book", - "destination": "/world-id/reference/contracts" + "destination": "/world-chain/reference/address-book" }, { "source": "/world-id/reference/contract-deployments", @@ -996,6 +1007,10 @@ "source": "/mini-apps/reference/errors", "destination": "/mini-apps/quick-start/installing" }, + { + "source": "/mini-apps/reference/address-book", + "destination": "/world-chain/reference/address-book" + }, { "source": "/world-id/further-reading/zero-knowledge-proofs", "destination": "/world-id/concepts" diff --git a/images/agent-pass/catalog-submit-review.jpg b/images/agent-pass/catalog-submit-review.jpg new file mode 100644 index 00000000..93d162ba Binary files /dev/null and b/images/agent-pass/catalog-submit-review.jpg differ diff --git a/images/docs/credentials/passkey.png b/images/docs/credentials/passkey.png new file mode 100644 index 00000000..a839be7c Binary files /dev/null and b/images/docs/credentials/passkey.png differ diff --git a/index.mdx b/index.mdx index 1586c9f0..8846d1c0 100644 --- a/index.mdx +++ b/index.mdx @@ -2,9 +2,9 @@ title: "World Developer Docs" sidebarTitle: "Home" mode: "custom" -description: "Build Mini Apps, integrate World ID, and deploy on World Chain with official developer documentation." +description: "Verify people, authenticate users and agents, create Mini Apps, and build on World Chain with official developer documentation." "og:image": "https://raw.githubusercontent.com/worldcoin/developer-docs/main/images/docs/docs-meta.png" -"og:description": "Build with World ID, Mini Apps, and World Chain." +"og:description": "Verify people, authenticate accounts, and build applications with World." "twitter:image": "https://raw.githubusercontent.com/worldcoin/developer-docs/main/images/docs/docs-meta.png" --- @@ -20,8 +20,9 @@ import { DeveloperStories } from "/snippets/developer-stories.jsx"; for="humans" block: Mintlify inlines a snippet's full source into the export when the component appears in exported content, and drops it when all usages are hidden (verified on a preview deploy). Keep the twin's links and copy in - sync when editing. Agent Pass is intentionally linked only in the agent twin - during MCP testing, before its visible launch. + sync when editing. Visible authentication links now lead through World ID's + integration choice. The direct Agent Pass reference stays in the agent twin; + its standalone tab remains hidden during MCP testing. */} @@ -30,39 +31,49 @@ import { DeveloperStories } from "/snippets/developer-stories.jsx";

World Developer Docs

- Integrate World ID and deploy on World Chain with official developer documentation. + Verify people, authenticate users and agents, and build applications with World.
- +
-
Integrate World ID
-
Anonymous Proof of Human for your website or app
+
Verify a human
+
Request and verify World ID proofs for your application's policy.
- + +
+ +
+
+
Authenticate users and agents
+
Add OIDC authentication and require recent authentication for sensitive actions.
+
+
+ +
-
Create a Mini App
-
Mini applications distributed in World App
+
Build inside World Money
+
Create a Mini App using MiniKit.
- +
-
World Chain
-
Build directly on World’s blockchain infrastructure
+
Build on World Chain
+
Deploy an application and query verified wallet addresses.
@@ -173,12 +184,14 @@ import { DeveloperStories } from "/snippets/developer-stories.jsx"; - Integrate World ID and deploy on World Chain with official developer documentation. + Verify people, authenticate users and agents, and build applications with World. + + - [Verify a human](/world-id/overview#choose-your-integration): Request and verify World ID proofs for your application's policy. + - [Authenticate users and agents](/world-id/overview#idkit-or-agent-pass): Add OIDC authentication and require recent authentication for sensitive actions. + - [Build inside World Money](/mini-apps/index): Create a Mini App using MiniKit. + - [Build on World Chain](/world-chain/index): Deploy an application and query verified wallet addresses. - - [Integrate World ID](/world-id/overview) — Anonymous Proof of Human for your website or app. - - [Create a Mini App](/mini-apps) — Mini applications distributed in World App. - - [Agent Pass](/agent-pass/quickstart) — Connect apps and agents with World ID authentication. - - [World Chain](/world-chain) — Build directly on World’s blockchain infrastructure. + Direct integration reference: [Agent Pass](/agent-pass/quickstart). **Developer stories** — how developers build trusted, human-centered apps with World: diff --git a/mini-apps/commands/how-to-send-notifications.mdx b/mini-apps/commands/how-to-send-notifications.mdx index 187b3b76..fd9b3461 100644 --- a/mini-apps/commands/how-to-send-notifications.mdx +++ b/mini-apps/commands/how-to-send-notifications.mdx @@ -85,7 +85,7 @@ Use the form to input addresses, and content details. Once you click the `Send` We currently have a limit of 40 notifications per 4 hours for unverified apps. This is to help you test your notification implementations. Currently you will need to create a new app if your app is verified as it will default to the verified app's metadata. In addition, you need -to enable notifications for your mini app inside of World App to receive them. +to enable notifications for your mini app inside of World Money to receive them. ## Useful links diff --git a/mini-apps/commands/pay.mdx b/mini-apps/commands/pay.mdx index 4815917a..c7f6189f 100644 --- a/mini-apps/commands/pay.mdx +++ b/mini-apps/commands/pay.mdx @@ -5,7 +5,7 @@ description: "Request a payment from the user" "twitter:image": "https://raw.githubusercontent.com/worldcoin/developer-docs/main/images/docs/docs-meta.png" --- -This command is an abstraction for a simple transfer. This shouldn't be used outside of World App. Pay supports WLD and all local stablecoins. +This command is an abstraction for a simple transfer. This shouldn't be used outside of World Money. Pay supports WLD and all local stablecoins. ## Basic Usage @@ -36,7 +36,7 @@ export async function sendPayment() { ], description: "Example payment", fallback: () => { - alert("Please complete the payment in World App to proceed."); + alert("Please complete the payment in World Money to proceed."); }, }; diff --git a/mini-apps/commands/send-transaction.mdx b/mini-apps/commands/send-transaction.mdx index dee6377f..89587b93 100644 --- a/mini-apps/commands/send-transaction.mdx +++ b/mini-apps/commands/send-transaction.mdx @@ -11,7 +11,7 @@ description: "Send one or more World Chain transactions using the unified MiniKi ## Permit2 Allowance Transfers (Recommended) -[Allowance transfers](https://docs.uniswap.org/contracts/permit2/reference/allowance-transfer#approve) are the recommended method for moving tokens in mini apps. World App automatically approves tokens to Permit2, so you can bundle the Permit2 approval and your contract call in a single `sendTransaction` for a better UX. +[Allowance transfers](https://docs.uniswap.org/contracts/permit2/reference/allowance-transfer#approve) are the recommended method for moving tokens in mini apps. World Money automatically approves tokens to Permit2, so you can bundle the Permit2 approval and your contract call in a single `sendTransaction` for a better UX. Expiration should always be set to 0 as the approval will be consumed in the same transaction. @@ -117,7 +117,7 @@ contract Swap { - World App automatically approves new ERC-20 tokens to the Permit2 contract. + World Money automatically approves new ERC-20 tokens to the Permit2 contract. Your contract only needs to call `permit2.transferFrom` — the token-level approval is already in place. @@ -158,7 +158,7 @@ type SendTransactionResponse = - If you are integrating through Wagmi, viem, or ethers with the World App + If you are integrating through Wagmi, viem, or ethers with the World Money EIP-1193 provider, the standard `eth_sendTransaction` call resolves to the MiniKit `userOpHash`, not a canonical transaction hash. Do not treat the returned value as a final transaction hash or pass it directly to @@ -237,7 +237,7 @@ for the full endpoint response shape. ## Fallback Behavior -By default we intend for mini apps to be useable outside of World App. Fallbacks generally will not be needed for this command and you should instead follow the [migration path outlined](/mini-apps/migration/minikit-v2). +By default we intend for mini apps to be useable outside of World Money. Fallbacks generally will not be needed for this command and you should instead follow the [migration path outlined](/mini-apps/migration/minikit-v2). ## Allowlisting Contracts and Tokens diff --git a/mini-apps/commands/share-contacts.mdx b/mini-apps/commands/share-contacts.mdx index db24bba5..07f78f9f 100644 --- a/mini-apps/commands/share-contacts.mdx +++ b/mini-apps/commands/share-contacts.mdx @@ -5,7 +5,7 @@ description: "Open the native contact picker using the unified MiniKit API." "twitter:image": "https://raw.githubusercontent.com/worldcoin/developer-docs/main/images/docs/docs-meta.png" --- -Use `MiniKit.shareContacts()` to open the World App contact picker. +Use `MiniKit.shareContacts()` to open the World Money contact picker. ## Basic Usage diff --git a/mini-apps/commands/wallet-auth.mdx b/mini-apps/commands/wallet-auth.mdx index f35bb740..55be350a 100644 --- a/mini-apps/commands/wallet-auth.mdx +++ b/mini-apps/commands/wallet-auth.mdx @@ -5,7 +5,7 @@ description: "Authenticate a user with Sign-In with Ethereum using the unified M "twitter:image": "https://raw.githubusercontent.com/worldcoin/developer-docs/main/images/docs/docs-meta.png" --- -Use `MiniKit.walletAuth()` to authenticate a user with Sign-In with Ethereum inside World App. +Use `MiniKit.walletAuth()` to authenticate a user with Sign-In with Ethereum inside World Money. This is the recommended authentication flow for mini apps. diff --git a/mini-apps/growth/gamification.mdx b/mini-apps/growth/gamification.mdx index 5f6a675a..d4640c72 100644 --- a/mini-apps/growth/gamification.mdx +++ b/mini-apps/growth/gamification.mdx @@ -89,7 +89,7 @@ Users hate leaving things 80% complete. Visual progress creates urgency to finis - Refresh weekly to prevent permanent dominance - Only show verified users to prevent gaming -**World App advantage**: World ID ensures fair competition with one-person-one-account guarantee. +**World Money advantage**: World ID ensures fair competition with one-person-one-account guarantee. ### 5. Variable Reward Systems diff --git a/mini-apps/growth/invites-viral.mdx b/mini-apps/growth/invites-viral.mdx index 01efed11..b4cb4798 100644 --- a/mini-apps/growth/invites-viral.mdx +++ b/mini-apps/growth/invites-viral.mdx @@ -30,7 +30,7 @@ Universal-link format `https://world.org/mini-app?app_id={app_id}&path={path}` -Deep-link (opens World App directly if installed) +Deep-link (opens World Money directly if installed) `worldapp://mini-app?app_id={app_id}&path={path}` @@ -142,14 +142,14 @@ export async function processReferral(data: { https://play.google.com/store/apps/details?id=com.worldcoin&referrer=app_id%3D{app_id}%26path%3D{path} ``` -World App prompts the install and then automatically forwards the user to your specified path. +World Money prompts the install and then automatically forwards the user to your specified path. ### Optimising Social-Share Previews -World app universal links will forward the og:image from your integration url. +World Money universal links will forward the og:image from your integration url. Eg. `world.org/mini-app?app_id=1234&path=/invite?code=abcd` will forward the og:image from `[your-miniapp-url]/invite?code=abcd`. -### Inside World App Discovery +### Inside World Money Discovery {#inside-world-app-discovery} - **Quick Actions**: Mini apps can hand off context to one another. Split distinct flows into focused apps that trigger each other with Quick Actions. diff --git a/mini-apps/growth/notifications.mdx b/mini-apps/growth/notifications.mdx index 9816a1d8..299951a6 100644 --- a/mini-apps/growth/notifications.mdx +++ b/mini-apps/growth/notifications.mdx @@ -4,7 +4,7 @@ title: Retention via Notifications "twitter:image": "https://raw.githubusercontent.com/worldcoin/developer-docs/main/images/docs/docs-meta.png" --- -Thoughtful, behavior‑based notifications keep users engaged long after they close your Mini App. Done right, they lift retention and even earn you a coveted **home‑screen badge** in World App. +Thoughtful, behavior‑based notifications keep users engaged long after they close your Mini App. Done right, they lift retention and even earn you a coveted **home‑screen badge** in World Money. ### 1 · Why They Matter @@ -77,7 +77,7 @@ Thoughtful, behavior‑based notifications keep users engaged long after they cl />
-Maintain ≥ 15 % opens to display this permanent badge—top‑of‑mind visibility every time users open World App. +Maintain ≥ 15 % opens to display this permanent badge—top‑of‑mind visibility every time users open World Money. ### 10 · Implementation Checklist diff --git a/mini-apps/guidelines/app-guidelines.mdx b/mini-apps/guidelines/app-guidelines.mdx index 33bae643..df647d0c 100644 --- a/mini-apps/guidelines/app-guidelines.mdx +++ b/mini-apps/guidelines/app-guidelines.mdx @@ -161,7 +161,7 @@ You should avoid displaying the user's wallet address, use their username instea World ID inherently allows anonymity between applications. We generally encourage developers to use their own Verify Command and verify the proof. However, we also offer a World ID -address book. This contract stores a mapping `addressVerifiedUntil` you can query to see if a World App +address book. This contract stores a mapping `addressVerifiedUntil` you can query to see if a World Money address is World ID Orb verified. ## UI Kit diff --git a/mini-apps/guidelines/policy.mdx b/mini-apps/guidelines/policy.mdx index 44be4278..afce991c 100644 --- a/mini-apps/guidelines/policy.mdx +++ b/mini-apps/guidelines/policy.mdx @@ -4,9 +4,9 @@ title: "App Review Guidelines" "twitter:image": "https://raw.githubusercontent.com/worldcoin/developer-docs/main/images/docs/docs-meta.png" --- -World App seeks to foster a diverse and flourishing ecosystem of applications while at the same time ensuring users stay safe, and privacy is maximized. These applications are displayed to users within World App, but users interact with these applications either within a web browser or as a platform native application. World App has sole discretion of determining how apps are presented to users within its platform. +World Money seeks to foster a diverse and flourishing ecosystem of applications while at the same time ensuring users stay safe, and privacy is maximized. These applications are displayed to users within World Money, but users interact with these applications either within a web browser or as a platform native application. World Money has sole discretion of determining how apps are presented to users within its platform. -These guidelines dictate the rules for apps which seek to be displayed to users from within World App. +These guidelines dictate the rules for apps which seek to be displayed to users from within World Money. ## MiniKit Integration @@ -57,7 +57,7 @@ Apps must comply with the below naming and description guidelines. ## Legal -Apps must comply with all legal requirements to be listed within World App. This includes the following: +Apps must comply with all legal requirements to be listed within World Money. This includes the following: - **Privacy:** - **Consent**: All apps that collect and store data from the user must request access and gain approval from the user before doing so @@ -96,14 +96,14 @@ Tools for Humanity will approve all submitted apps if it deems the following are The review team will provide a rationale for any rejections, to which the developer can re-submit after remediating any concerns. If the application continuously fails review for the same reason, it may take longer for subsequent reviews to occur. -Additionally, World App provides users the ability to report apps. If an app is in violation of the safety and legal guidelines or the review team deems the app should be removed for other reasons, the team has the sole discretion to remove an app from the platform. If an app is removed from the platform or an investigation is in progress, the development team will be alerted. +Additionally, World Money provides users the ability to report apps. If an app is in violation of the safety and legal guidelines or the review team deems the app should be removed for other reasons, the team has the sole discretion to remove an app from the platform. If an app is removed from the platform or an investigation is in progress, the development team will be alerted. ## Technical Requirements -- On Android and iOS, the World App Mini App should support operation under poor internet connections and handle temporary disconnections properly. -- The World App Mini App must be reliable, with no infinite loading during non-standard user actions. -- The World App Mini App must comply with the rules of both the Android and iOS app stores. -- The World App Mini App must not contain features that are unavailable on certain platforms. +- On Android and iOS, the World Money Mini App should support operation under poor internet connections and handle temporary disconnections properly. +- The World Money Mini App must be reliable, with no infinite loading during non-standard user actions. +- The World Money Mini App must comply with the rules of both the Android and iOS app stores. +- The World Money Mini App must not contain features that are unavailable on certain platforms. - User progress must synchronize seamlessly between different platform versions. ## User Support diff --git a/mini-apps/guidelines/smart-contract-development-guidelines.mdx b/mini-apps/guidelines/smart-contract-development-guidelines.mdx index 467d6ca9..a5dd8fbd 100644 --- a/mini-apps/guidelines/smart-contract-development-guidelines.mdx +++ b/mini-apps/guidelines/smart-contract-development-guidelines.mdx @@ -2,7 +2,7 @@ title: "Smart Contract Development Guidelines" --- -These guidelines define the minimum requirements for developing smart contracts for deployment & use within the World App Mini App Store. They are designed to protect users from malicious or negligent behaviors, especially in contracts that custody user funds. +These guidelines define the minimum requirements for developing smart contracts for deployment & use within the World Money Mini App Store. They are designed to protect users from malicious or negligent behaviors, especially in contracts that custody user funds. ## Applicability diff --git a/mini-apps/index.mdx b/mini-apps/index.mdx index 30d8261d..ac76dcba 100644 --- a/mini-apps/index.mdx +++ b/mini-apps/index.mdx @@ -1,18 +1,22 @@ --- title: "What are Mini Apps?" -description: "Learn what Mini Apps are and how to build native-like apps in World App with MiniKit, distribution and monetization." +description: "Learn what Mini Apps are and how to build native-like apps in World Money with MiniKit, distribution and monetization." "og:image": "https://raw.githubusercontent.com/worldcoin/developer-docs/main/images/docs/mini-apps-meta.png" "og:description": "What Mini Apps are and how to build them with MiniKit." "twitter:image": "https://raw.githubusercontent.com/worldcoin/developer-docs/main/images/docs/mini-apps-meta.png" --- -Mini apps enable third-party developers to create native-like applications within World App. +Mini apps enable third-party developers to create native-like applications within World Money. Best for small and medium sized developers who want access to a distribution channel of millions of users. -Build with flexible smart contracts and leverage World ID and the World Wallet for seamless user experiences. +Build with smart contracts, World ID, and the wallet in World Money. + +World Money provides wallets and payments. The separate +[World ID app](https://world.org/world-id-app) manages identity credentials, +proofs, and authentication, and also hosts identity Mini Apps. ## How it Works -Mini apps are web applications running inside World App via webview. Using the MiniKit SDK, these applications can become +Mini apps are web applications running inside World Money via webview. Using the MiniKit SDK, these applications can become native-like and interact with the World ecosystem. ## Quick links @@ -26,10 +30,10 @@ native-like and interact with the World ecosystem. Statistics about the Mini Apps ecosystem. - Check the current status of World App. + Check the current status of World Money. diff --git a/mini-apps/migration/standalone-dapp.mdx b/mini-apps/migration/standalone-dapp.mdx index c4a2485d..2ce12cd1 100644 --- a/mini-apps/migration/standalone-dapp.mdx +++ b/mini-apps/migration/standalone-dapp.mdx @@ -1,11 +1,11 @@ --- title: "Upgrade to a Standalone Web App" -description: "Convert your mini app into a standalone web app that works both inside World App and in any browser." +description: "Convert your mini app into a standalone web app that works both inside World Money and in any browser." "og:image": "https://raw.githubusercontent.com/worldcoin/developer-docs/main/images/docs/docs-meta.png" "twitter:image": "https://raw.githubusercontent.com/worldcoin/developer-docs/main/images/docs/docs-meta.png" --- -MiniKit commands auto-detect the environment. Outside World App, they fall back to Wagmi. +MiniKit commands auto-detect the environment. Outside World Money, they fall back to Wagmi. | Feature | Effort | Details | |---|---|---| @@ -93,7 +93,7 @@ No changes. [IDKit](https://docs.worldcoin.org/world-id/quick-start) is independ ```tsx const result = await MiniKit.walletAuth({ nonce, statement: "Sign in" }); -// result.executedWith === "minikit" (World App) or "wagmi" (web) +// result.executedWith === "minikit" (World Money) or "wagmi" (web) ``` ### Backend Verification @@ -110,7 +110,7 @@ const { isValid, siweMessageData } = await verifySiweMessage(payload, nonce); `MiniKit.sendTransaction()` works automatically. World Chain only (chainId 480). -- **World App**: native bridge, atomic batching, returns `userOpHash` +- **World Money**: native bridge, atomic batching, returns `userOpHash` - **Web (single tx)**: sent directly via Wagmi - **Web (multiple txs)**: executed sequentially — each requires wallet confirmation and is not atomic @@ -125,12 +125,12 @@ const result = await MiniKit.sendTransaction({ ### Receipts -Branch on `result.executedWith` — World App returns a UserOperation hash, web returns a standard tx hash: +Branch on `result.executedWith` — World Money returns a UserOperation hash, web returns a standard tx hash: ```tsx import { useUserOperationReceipt } from "@worldcoin/minikit-react"; -// For World App: poll for the UserOperation receipt +// For World Money: poll for the UserOperation receipt const { poll } = useUserOperationReceipt({ client }); if (result.executedWith === "minikit") { diff --git a/mini-apps/migration/web-to-miniapp.mdx b/mini-apps/migration/web-to-miniapp.mdx index 41db4c18..8a9cb0c0 100644 --- a/mini-apps/migration/web-to-miniapp.mdx +++ b/mini-apps/migration/web-to-miniapp.mdx @@ -1,11 +1,11 @@ --- title: "Migrate a Web App to Mini App" -description: "Convert an existing Next.js web app to work as a World App mini app." +description: "Convert an existing Next.js web app to work as a World Money mini app." "og:image": "https://raw.githubusercontent.com/worldcoin/developer-docs/main/images/docs/docs-meta.png" "twitter:image": "https://raw.githubusercontent.com/worldcoin/developer-docs/main/images/docs/docs-meta.png" --- -Convert an existing Next.js web app that uses viem to work as a World App mini app. +Convert an existing Next.js web app that uses viem to work as a World Money mini app. ## Ask an agent Add this skill and ask your agent to convert your web app to a mini app using the steps outlined in this guide. @@ -55,7 +55,7 @@ import Providers from "./providers"; ## 4. Wallet Connection -Use `getWorldAppProvider()` inside World App, fall back to `window.ethereum` for browsers. +Use `getWorldAppProvider()` inside World Money, fall back to `window.ethereum` for browsers. ```tsx import { MiniKit, getWorldAppProvider } from "@worldcoin/minikit-js"; @@ -81,7 +81,7 @@ Existing `writeContract` / `readContract` calls work unchanged. ## 5. Bundle Approve + Contract Calls -World App resets approvals to 0 after each transaction. A separate `approve()` tx followed by `transferFrom()` in the next tx will fail. +World Money resets approvals to 0 after each transaction. A separate `approve()` tx followed by `transferFrom()` in the next tx will fail. Bundle them in one call: @@ -112,7 +112,7 @@ await MiniKit.sendTransaction({ }); ``` -World App executes these atomically. On web, they execute sequentially — each requires a separate wallet confirmation and is not atomic. +World Money executes these atomically. On web, they execute sequentially — each requires a separate wallet confirmation and is not atomic. ## 6. Handle userOpHash Receipts diff --git a/mini-apps/more/faq.mdx b/mini-apps/more/faq.mdx index 61d3ec99..8a8a5aeb 100644 --- a/mini-apps/more/faq.mdx +++ b/mini-apps/more/faq.mdx @@ -6,8 +6,8 @@ title: "FAQ" ## Who covers gas fees for transactions? -World App sponsors gas fees for most transactions on Worldchain, subject to transaction minimums and restrictions. -When someone verifies their identity with World ID and uses the World App, their transactions on Worldchain are automatically covered by the network. +World Money sponsors gas fees for most transactions on Worldchain, subject to transaction minimums and restrictions. +When someone verifies their identity with World ID and uses World Money, their transactions on Worldchain are automatically covered by the network. This means users don't need to hold or spend ETH to interact with mini apps, send tokens, or perform on-chain actions. The sponsorship is handled behind the scenes with a paymaster contract that pays the gas fees whenever a verified user initiates a transaction. @@ -19,19 +19,19 @@ Yes. After development, submit your Mini App for review through the [Developer P The [Send Transaction command](/mini-apps/commands/send-transaction) is designed to execute on-chain transactions from the Mini App. When developers invoke this command, they supply a `chainId` and one or more `transactions` containing the target contract address, optional encoded function call (`data`), and optional value. -For security, World App requires that any smart contract or token interactions are pre-approved (whitelisted) in the Developer Portal to prevent unauthorized transfers. -For ERC-20 token transfers, standard `approve()` calls work, but Permit2 is recommended. World App automatically approves tokens to the Permit2 contract, so you can bundle the Permit2 approval and your contract call in a single transaction for a better UX. +For security, World Money requires that any smart contract or token interactions are pre-approved (whitelisted) in the Developer Portal to prevent unauthorized transfers. +For ERC-20 token transfers, standard `approve()` calls work, but Permit2 is recommended. World Money automatically approves tokens to the Permit2 contract, so you can bundle the Permit2 approval and your contract call in a single transaction for a better UX. ## How does Sign Message command work? The [Sign Message command](/mini-apps/commands/sign-message) prompts the user to cryptographically sign an arbitrary message using -their wallet's private key. When you call the command (for example, `await MiniKit.signMessage({ message: "Hello" })`), World App generates a standardized payload that may include a nonce, timestamp, and other context to prevent replay attacks. +their wallet's private key. When you call the command (for example, `await MiniKit.signMessage({ message: "Hello" })`), World Money generates a standardized payload that may include a nonce, timestamp, and other context to prevent replay attacks. The user's wallet then signs this message using ECDSA, producing a signature that proves the user controls the wallet, all without exposing the private key. This signed message can be sent back to your backend for verification, ensuring the integrity of user actions and serving as secure off-chain authorization for various operations. ## Can I use the simulator to test transactions on mini apps? -No, mini app needs to be developed on mainnet (we don't support testnet). Gas is covered in the World App, so there's only deployment costs for you to develop on mainnet. Deploy "test" contracts to mainnet, and then redeploy "prod" mainnet contracts. +No, mini app needs to be developed on mainnet (we don't support testnet). Gas is covered in World Money, so there's only deployment costs for you to develop on mainnet. Deploy "test" contracts to mainnet, and then redeploy "prod" mainnet contracts. ## How do I debug send transaction failed simulation? @@ -43,7 +43,7 @@ Check the [Prod QA App](https://world.org/ecosystem/app_dfbe55706a640c82dce839bb ## How do I test my mini app on mobile? -Remember that minikit ONLY works inside World App, so in order to test your mini app commands you must open it in World App +To test native MiniKit commands on your phone, open your Mini App inside World Money. To test your Mini App directly on your phone, expose your app publicly using ngrok or any other tunneling service. After the URL is generated, go to the [Developer Portal](https://developer.worldcoin.org/) to configure it. diff --git a/mini-apps/more/webview-spec.mdx b/mini-apps/more/webview-spec.mdx index 372350e0..9eb21f73 100644 --- a/mini-apps/more/webview-spec.mdx +++ b/mini-apps/more/webview-spec.mdx @@ -5,7 +5,7 @@ title: "Webview Specifications" --- -The widget is opened within the World App via a WebView. This means providers can tailor their solutions by considering the specific features and restrictions of these platforms. +The widget is opened inside World Money in a WebView. This means providers can tailor their solutions by considering the specific features and restrictions of these platforms. ### **Capabilities:** diff --git a/mini-apps/quick-start/app-store.mdx b/mini-apps/quick-start/app-store.mdx index b28b17e3..a3098de5 100644 --- a/mini-apps/quick-start/app-store.mdx +++ b/mini-apps/quick-start/app-store.mdx @@ -1,6 +1,6 @@ --- title: "Mini App Store" -description: "Submit your Mini App for review and distribution in World App; follow guidelines and resolve rejections." +description: "Submit your Mini App for review and distribution in World Money; follow guidelines and resolve rejections." "og:image": "https://raw.githubusercontent.com/worldcoin/developer-docs/main/images/docs/docs-meta.png" "twitter:image": "https://raw.githubusercontent.com/worldcoin/developer-docs/main/images/docs/docs-meta.png" --- @@ -8,7 +8,7 @@ description: "Submit your Mini App for review and distribution in World App; fol To ensure a consistent user experience, apps will be rejected unless they follow our [guidelines](/mini-apps/guidelines/app-guidelines). Once your mini app is ready to be published, you can submit it for review inside of the Developer Portal. -Once approved, your mini app will be available to all World App users to discover in the Mini Apps. +Once approved, your mini app will be available to all World Money users to discover in the Mini Apps. ![Submit an App](/images/docs/mini-apps/quick-start/submit-app.png) diff --git a/mini-apps/quick-start/commands.mdx b/mini-apps/quick-start/commands.mdx index e45e0ec2..a94391da 100644 --- a/mini-apps/quick-start/commands.mdx +++ b/mini-apps/quick-start/commands.mdx @@ -25,7 +25,7 @@ Try our preview mini app to get a sense of how commands work. */} - Scan the QR code below with your phone (you must have World App installed). + Scan the QR code below with your phone (you must have World Money installed).
- Open [https://world.org/mini-app?app_id=app_dfbe55706a640c82dce839bb0ecae74d](https://world.org/mini-app?app_id=app_dfbe55706a640c82dce839bb0ecae74d) on a phone with World App installed (the docs page renders this link as a QR code). + Open [https://world.org/mini-app?app_id=app_dfbe55706a640c82dce839bb0ecae74d](https://world.org/mini-app?app_id=app_dfbe55706a640c82dce839bb0ecae74d) on a phone with World Money installed (the docs page renders this link as a QR code). @@ -51,7 +51,7 @@ Try our preview mini app to get a sense of how commands work. - + @@ -71,7 +71,7 @@ Try our preview mini app to get a sense of how commands work. - + diff --git a/mini-apps/quick-start/init.mdx b/mini-apps/quick-start/init.mdx index 0208eec1..ef2a84cd 100644 --- a/mini-apps/quick-start/init.mdx +++ b/mini-apps/quick-start/init.mdx @@ -4,7 +4,7 @@ title: Initialization "twitter:image": "https://raw.githubusercontent.com/worldcoin/developer-docs/main/images/docs/docs-meta.png" --- -When your mini app initializes inside World App, MiniKit stores device context, launch context, and basic user metadata on the client. +When your mini app initializes inside World Money, MiniKit stores device context, launch context, and basic user metadata on the client. If you are using React, `MiniKitProvider` will perform the initialization for you. @@ -87,7 +87,7 @@ Notes: ## Launch Location -MiniKit normalizes the raw World App launch origin into: +MiniKit normalizes the raw World Money launch origin into: @@ -113,9 +113,9 @@ MiniKit normalizes the raw World App launch origin into: -## Raw World App Object +## Raw `window.WorldApp` object {#raw-world-app-object} -If you need the untransformed World App payload, read `window.WorldApp` directly. +If you need the untransformed World Money payload, read `window.WorldApp` directly. diff --git a/mini-apps/quick-start/installing.mdx b/mini-apps/quick-start/installing.mdx index e5d68849..8737d4fa 100644 --- a/mini-apps/quick-start/installing.mdx +++ b/mini-apps/quick-start/installing.mdx @@ -5,7 +5,13 @@ description: "Create a Mini App with the official template or install MiniKit-JS "twitter:image": "https://raw.githubusercontent.com/worldcoin/developer-docs/main/images/docs/docs-meta.png" --- -[MiniKit-JS](https://github.com/worldcoin/minikit-js) is our official SDK for creating mini apps that work with World App. +[MiniKit-JS](https://github.com/worldcoin/minikit-js) is our official SDK for creating mini apps that work with World Money. + + + SDK and protocol identifiers retain legacy names such as `window.WorldApp`, + `getWorldAppProvider()`, and `worldapp://`. Keep these names unchanged in code + and links. + ## Quick Start @@ -85,7 +91,7 @@ export default function RootLayout({ ``` 2. Check if MiniKit is installed. -`MiniKit.isInstalled()` will only return true if the mini app is opened and initialized inside the World App. This is useful to distinguish between a user opening your app in the browser or in the World App. +`MiniKit.isInstalled()` returns true when the Mini App is open and initialized inside World Money. Use it to distinguish the native host from a regular browser. ```tsx import { MiniKit } from "@worldcoin/minikit-js"; diff --git a/mini-apps/quick-start/responses.mdx b/mini-apps/quick-start/responses.mdx index d314aab7..3c68ad6a 100644 --- a/mini-apps/quick-start/responses.mdx +++ b/mini-apps/quick-start/responses.mdx @@ -9,7 +9,7 @@ Modern MiniKit commands are async methods on `MiniKit`. They resolve to a result ## Async Command Results -Use `executedWith` to understand whether the command ran through World App, Wagmi, or a custom fallback. +Use `executedWith` to understand whether the command ran through World Money, Wagmi, or a custom fallback. ```tsx import { MiniKit } from "@worldcoin/minikit-js"; diff --git a/mini-apps/quick-start/testing.mdx b/mini-apps/quick-start/testing.mdx index 24dc3d49..c652e01a 100644 --- a/mini-apps/quick-start/testing.mdx +++ b/mini-apps/quick-start/testing.mdx @@ -33,7 +33,7 @@ Your app id is in the developer portal in the format `app_xxxxxxxxxx`. 1. Build the URL with your App ID from the developer portal. 2. Scan the QR (or open the URL) with your phone’s camera. - 3. Confirm the prompt in World App. + 3. Confirm the prompt in World Money. ### Tips diff --git a/mini-apps/reference/microphone.mdx b/mini-apps/reference/microphone.mdx index 82a3867b..444feaa0 100644 --- a/mini-apps/reference/microphone.mdx +++ b/mini-apps/reference/microphone.mdx @@ -5,19 +5,20 @@ title: Microphone --- -Microphone is only available from World App 2.8.85 and MiniKit 1.9.6. +Microphone support requires MiniKit 1.9.6 or later. It was introduced in World App +2.8.85, before the app was renamed World Money. Microphone uses the standard web api [Navigator.mediaDevices](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/mediaDevices). These two conditions must be met in order to use the microphone: - The user must grant permission to your mini app to use the microphone. -- The user must grant permission to World App to use the microphone. +- The user must grant permission to World Money to use the microphone. ## Using the microphone Request permission from the user to enable microphone for your mini app with the [request permission command](/mini-apps/commands/request-permission). -- If you receive a `world_app_permission_not_enabled` or `permission_disabled` error code, you must prompt the user to enable microphone for World App first. +- If you receive a `world_app_permission_not_enabled` or `permission_disabled` error code, you must prompt the user to enable microphone for World Money first. This can be done by simply trying to start recording. -- The microphone will automatically be turned off if the user closes your mini app or World App. +- The microphone will automatically be turned off if the user closes your mini app or World Money. ```tsx const [isMicOn, setIsMicOn] = useState(false); @@ -49,4 +50,4 @@ This can be done by simply trying to start recording. ## Debugging - If you receive a `DomException Error`, it's most likely because the user hasn't granted permission to your mini app to use the microphone. -- If the microphone turns off after a few seconds it's because the user has not granted permission to your mini app to use the microphone. \ No newline at end of file +- If the microphone turns off after a few seconds it's because the user has not granted permission to your mini app to use the microphone. diff --git a/mini-apps/reference/usernames.mdx b/mini-apps/reference/usernames.mdx index 1eb566c5..f9387629 100644 --- a/mini-apps/reference/usernames.mdx +++ b/mini-apps/reference/usernames.mdx @@ -6,7 +6,7 @@ title: Usernames ## Introduction -Usernames are ENS-compatible identifiers for every World App user, ensuring consistency and easy recognition. +Usernames are ENS-compatible identifiers for every World Money user, ensuring consistency and easy recognition. For example, when displaying transaction history, show the username instead of the wallet address to make it more user-friendly and private. The usernames service is public, docs can be found [here](https://usernames.worldcoin.org/docs). This will be mostly useful for more advanced use cases. diff --git a/mini-apps/sharing/add-money-qa.mdx b/mini-apps/sharing/add-money-qa.mdx index 1876cb64..cc734eac 100644 --- a/mini-apps/sharing/add-money-qa.mdx +++ b/mini-apps/sharing/add-money-qa.mdx @@ -4,7 +4,7 @@ title: "Add Money" "twitter:image": "https://raw.githubusercontent.com/worldcoin/developer-docs/main/images/docs/docs-meta.png" --- -Add money to your World Wallet directly from exchanges like Binance and Coinbase. Deposit, withdraw, and swap tokens across multiple exchanges and chains effortlessly. +Add money to your wallet in World Money directly from exchanges like Binance and Coinbase. Deposit, withdraw, and swap tokens across multiple exchanges and chains effortlessly.
- Address of the recipient World Wallet user. + Wallet address of the recipient in World Money. Token contract address to deposit (supports USDC or WLD). diff --git a/mini-apps/sharing/quick-actions.mdx b/mini-apps/sharing/quick-actions.mdx index a013ff5b..37ca9eb7 100644 --- a/mini-apps/sharing/quick-actions.mdx +++ b/mini-apps/sharing/quick-actions.mdx @@ -10,8 +10,7 @@ A Quick Action is a universal deeplink defined by a schema that navigates to a s In short, you should create a quick action to link to another mini app. -If a user clicks on your link and has World App installed, it will automatically open the mini app inside of World -App to the specified path. Otherwise, it will direct them to the app store and prompt them to install World App. +If a user clicks on your link and has World Money installed, it will automatically open the mini app inside World Money to the specified path. Otherwise, it will direct them to the app store and prompt them to install World Money. ### **Benefits of Quick Actions** diff --git a/mini-apps/sharing/sage-qa.mdx b/mini-apps/sharing/sage-qa.mdx index 0ba8aaf6..59ae693b 100644 --- a/mini-apps/sharing/sage-qa.mdx +++ b/mini-apps/sharing/sage-qa.mdx @@ -174,7 +174,7 @@ Other props allow you to customize both the aesthetic and behavior of the Sage S You can also integrate Sage Support directly into your World Mini App by using a Support Link. This allows your users to access Sage's AI-powered support without requiring you to install any additional packages or components. -The Support Link is a quick action URL that opens the Sage Support chat interface directly within the World App. When users click on this link, they'll be able to ask questions and get support related to your Mini App. +The Support Link is a quick action URL that opens the Sage Support chat interface directly within World Money. When users click on this link, they'll be able to ask questions and get support related to your Mini App. This link is particularly useful for developers to use Sage as their Mini App's native Support link, available under **Worldcoin Developer > Mini App > Configuration > App Store > Support > Link** diff --git a/mini-apps/sharing/world-chat-qa.mdx b/mini-apps/sharing/world-chat-qa.mdx index 22acd9fa..e5e940ba 100644 --- a/mini-apps/sharing/world-chat-qa.mdx +++ b/mini-apps/sharing/world-chat-qa.mdx @@ -2,7 +2,7 @@ title: "World Chat" --- -World Chat is a messaging platform in the World App ecosystem. +World Chat is a messaging platform in the World Money ecosystem. Quick Actions let you link to specific chat features. Url follows the schema below. @@ -17,7 +17,7 @@ https://worldcoin.org/mini-app?app_id=app_e293fcd0565f45ca296aa317212d8741 The username of the recipient you want to chat with. You can resolve a username using the user's [wallet - address](/mini-apps/reference/address-book). + address](/world-chain/reference/address-book). Predefined message text to include in the draft chat. diff --git a/model-context-protocol/developer-portal.mdx b/model-context-protocol/developer-portal.mdx index 962f6f2c..803c1a70 100644 --- a/model-context-protocol/developer-portal.mdx +++ b/model-context-protocol/developer-portal.mdx @@ -90,7 +90,7 @@ Replace `api_...` with the API key you copied from the Developer Portal. | --- | --- | | `get_team_context` | List your team's apps and status. | | `get_app_config` | Fetch app, World ID, Mini App, and app store configuration. | -| `create_app` | Create an external World ID app or Mini App. | +| `create_app` | Create an external World ID application or Mini App. | | `configure_world_id` | Create a managed World ID 4.0 relying party for an app. | | `get_world_id_signing_key` | Fetch the current signer address. Private keys are not returned. | | `rotate_world_id_signing_key` | Generate or set a new World ID signing key. The private key is returned once. | @@ -108,10 +108,10 @@ Start every session by asking the assistant to inspect the team: Use the Developer Portal MCP to get my team context. If there is no app for this project, create one. ``` -For an external World ID app: +For an external World ID application: ```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. +Create a production external World ID application named Example, configure World ID, create an action called verify-account, and tell me which environment variables to add. ``` For a Mini App: diff --git a/openapi/developer-portal.json b/openapi/developer-portal.json index bc10a79a..df13b989 100644 --- a/openapi/developer-portal.json +++ b/openapi/developer-portal.json @@ -331,7 +331,7 @@ "type": "string", "pattern": "^0x[a-fA-F0-9]{64}$" }, - "description": "The MiniKit `userOpHash` returned by `MiniKit.sendTransaction()` or `eth_sendTransaction` through the World App provider." + "description": "The MiniKit `userOpHash` returned by `MiniKit.sendTransaction()` or `eth_sendTransaction` through the World Money provider." } ], "responses": { @@ -578,7 +578,7 @@ } }, "426": { - "description": "Rejected by an app-version/client gate. Expects an approved client (e.g. World App); required header(s) aren't publicly documented.", + "description": "Rejected by an app-version/client gate. Expects an approved client (e.g. World Money); required header(s) aren't publicly documented.", "content": { "application/json": { "example": { @@ -1345,7 +1345,7 @@ }, "mini_app_path": { "type": "string", - "description": "Deeplink to open when the user taps the notification: a WorldApp/World ID mini app deeplink (`worldapp://mini-app?app_id=...` or `worldid://mini-app?app_id=...`, where `app_id` must match the request's `app_id`), a Deep Face Universal Link (`https://world.org/verify?t=deepface`), or a Deep Face deeplink (`worldapp://verify?t=deepface`, `worldid://verify?t=deepface`, `worldidstg://verify?t=deepface`)." + "description": "Deeplink to open when the user taps the notification: a Mini App deeplink (`worldapp://mini-app?app_id=...` or `worldid://mini-app?app_id=...`, where `app_id` must match the request's `app_id`), a Deep Face Universal Link (`https://world.org/verify?t=deepface`), or a Deep Face deeplink (`worldapp://verify?t=deepface`, `worldid://verify?t=deepface`, `worldidstg://verify?t=deepface`)." }, "app_id": { "type": "string" @@ -1379,7 +1379,7 @@ }, "mini_app_path": { "type": "string", - "description": "Deeplink to open when the user taps the notification: a WorldApp/World ID mini app deeplink (`worldapp://mini-app?app_id=...` or `worldid://mini-app?app_id=...`, where `app_id` must match the request's `app_id`), a Deep Face Universal Link (`https://world.org/verify?t=deepface`), or a Deep Face deeplink (`worldapp://verify?t=deepface`, `worldid://verify?t=deepface`, `worldidstg://verify?t=deepface`)." + "description": "Deeplink to open when the user taps the notification: a Mini App deeplink (`worldapp://mini-app?app_id=...` or `worldid://mini-app?app_id=...`, where `app_id` must match the request's `app_id`), a Deep Face Universal Link (`https://world.org/verify?t=deepface`), or a Deep Face deeplink (`worldapp://verify?t=deepface`, `worldid://verify?t=deepface`, `worldidstg://verify?t=deepface`)." }, "app_id": { "type": "string" @@ -1674,7 +1674,7 @@ "IntegrityBundle": { "type": "object", "required": ["version", "signature_format", "timestamp", "signature", "jwt"], - "description": "World ID App integrity attestation. Selfie Check responses with `issuer_schema_id: 11` require version 2, which covers the disclosed `sybil_score`.", + "description": "World ID app integrity attestation. Selfie Check responses with `issuer_schema_id: 11` require version 2, which covers the disclosed `sybil_score`.", "properties": { "version": { "type": "integer", @@ -1763,7 +1763,7 @@ }, "user_presence_completed": { "type": "boolean", - "description": "Whether World App completed the requested user-presence check. IDKit includes this field only when `require_user_presence` was true in the request." + "description": "Whether the World ID app completed the requested user-presence check. IDKit includes this field only when `require_user_presence` was true in the request." } } }, @@ -1808,7 +1808,7 @@ }, "user_presence_completed": { "type": "boolean", - "description": "Whether World App completed the requested user-presence check. IDKit includes this field only when `require_user_presence` was true in the request." + "description": "Whether the World ID app completed the requested user-presence check. IDKit includes this field only when `require_user_presence` was true in the request." } } }, @@ -1852,7 +1852,7 @@ }, "user_presence_completed": { "type": "boolean", - "description": "Whether World App completed the requested user-presence check. IDKit includes this field only when `require_user_presence` was true in the request." + "description": "Whether the World ID app completed the requested user-presence check. IDKit includes this field only when `require_user_presence` was true in the request." } } }, diff --git a/scripts/sync-world-id-auth.mjs b/scripts/sync-world-id-auth.mjs index 643886d7..baaba9c5 100644 --- a/scripts/sync-world-id-auth.mjs +++ b/scripts/sync-world-id-auth.mjs @@ -4,6 +4,12 @@ import { createHash } from "node:crypto"; import { lstat, mkdir, readFile, realpath, writeFile } from "node:fs/promises"; import path from "node:path"; import { fileURLToPath, pathToFileURL } from "node:url"; +import { renderQuickstartLayout } from "./world-id-auth-quickstart.mjs"; +import { renderClientAuthentication } from "./world-id-auth-client-auth.mjs"; +import { renderOidcExamples } from "./world-id-auth-oidc.mjs"; +import { renderOidcTroubleshooting } from "./world-id-auth-troubleshooting.mjs"; +import { renderCredentialCards } from "./world-id-auth-credentials.mjs"; +import { renderBenefitPublishing } from "./world-id-auth-benefits.mjs"; const repositoryRoot = fileURLToPath(new URL("../", import.meta.url)); const manifestPath = new URL("../.mintlify/world-id-auth-pages.json", import.meta.url); @@ -77,6 +83,17 @@ function validateConfig(config) { if ((page.source === "world-id-users.md") !== Boolean(page.publicUserGuide)) { throw new Error("The authenticated user guide requires its explicitly approved public adaptation"); } + for (const [flag, source, destination] of [ + ["quickstartLayout", "getting-started.md", "agent-pass/quickstart.mdx"], + ["clientAuthenticationExamples", "app-registration.md", "agent-pass/app-registration.mdx"], + ["oidcExamples", "oidc.md", "agent-pass/connect-your-backend.mdx"], + ["credentialCards", "id-token.md", "agent-pass/id-tokens-and-identity.mdx"], + ["benefitPublishing", "app-registration.md", "agent-pass/app-registration.mdx"], + ]) { + if (page[flag] !== undefined && (typeof page[flag] !== "boolean" || page.source !== source || page.destination !== destination)) { + throw new Error(`The ${flag} adaptation is limited to ${source}`); + } + } if (page.section !== undefined && (typeof page.section !== "string" || !page.section.trim() || typeof page.sectionEnd !== "string" || !page.sectionEnd.trim())) { throw new Error("A derived guide requires its exact section heading and next-section boundary"); } @@ -209,6 +226,14 @@ export function renderGuide(markdown, page, config) { if (!image.test(content)) throw new Error("The federation illustration changed; review its Mermaid adaptation"); content = content.replace(image, federationDiagram); } + if (page.quickstartLayout) content = renderQuickstartLayout(content); + if (page.clientAuthenticationExamples) content = renderClientAuthentication(content); + if (page.oidcExamples) { + content = renderOidcExamples(content); + content = renderOidcTroubleshooting(content); + } + if (page.credentialCards) content = renderCredentialCards(content); + if (page.benefitPublishing) content = renderBenefitPublishing(content); for (const alias of [...(page.introAliases ?? [])].reverse()) { if (ids.has(alias)) continue; content = `\n\n${content}`; diff --git a/scripts/sync-world-id-auth.test.mjs b/scripts/sync-world-id-auth.test.mjs index 781f1895..b6ff4251 100644 --- a/scripts/sync-world-id-auth.test.mjs +++ b/scripts/sync-world-id-auth.test.mjs @@ -5,6 +5,11 @@ import path from "node:path"; import test from "node:test"; import { renderGuide, syncGuides } from "./sync-world-id-auth.mjs"; +import { renderQuickstartLayout } from "./world-id-auth-quickstart.mjs"; +import { renderClientAuthentication } from "./world-id-auth-client-auth.mjs"; +import { renderOidcExamples } from "./world-id-auth-oidc.mjs"; +import { renderOidcTroubleshooting } from "./world-id-auth-troubleshooting.mjs"; +import { renderCredentialCards } from "./world-id-auth-credentials.mjs"; const page = { source: "getting-started.md", @@ -356,3 +361,442 @@ test("the compatibility contract keeps legacy Auth routes and protected MCP reso assert.equal(contract.markdownEquivalent.docsPath, "/agent-pass/build-with-a-coding-agent.md"); assert.equal(contract.legacyHtmlPolicy.includeTrailingSlash, true); }); + +const quickstartChoices = [ + ["Authenticate through a browser", "Authorization Code Flow", "/agent-pass/connect-your-backend#sign-in-through-the-browser"], + ["Authenticate a CLI or client without a browser callback", "Device Authorization Grant", "/agent-pass/connect-your-backend#sign-in-a-headless-agent-device-flow"], + ["Require recent or specific authentication before an action", "Step-up authentication", "/agent-pass/step-up"], + ["Pause an agent workflow for a human checkpoint", "Human checkpoints", "/agent-pass/step-up#human-checkpoints"], + ["Use World ID for your application's primary sign-in", "Primary sign-in", "/agent-pass/connect-your-backend#primary-sign-in"], + ["Authorize access to your MCP server", "MCP authorization", "/agent-pass/connect-your-auth-server"], + ["Accept delegated access through an XAA-capable host", "Cross-App Access (XAA)", "/agent-pass/xaa"], +]; +const quickstartTable = [ + "| Goal | Guide |", + "| --- | --- |", + ...quickstartChoices.map(([goal, title, href]) => `| ${goal} | [${title}](${href}) |`), +].join("\n"); +const environmentTable = [ + "| Setting | Value |", + "| --- | --- |", + "| Issuer | `https://auth.world.org` |", + "| Discovery | `https://auth.world.org/.well-known/openid-configuration` |", + "| Developer portal | [Portal](https://auth.world.org/portal) |", +].join("\n"); +const otherIntegrations = `These guides cover OIDC integration with World IdP. Use World IdP's +registrations, credentials, and identifiers only for that flow; IDKit proof +applications use their own. + +- **IDKit uniqueness:** use a nullifier scoped to the application and action for + one-use eligibility. Verify the proof on your backend and atomically reject a + previously consumed nullifier. Check authentication freshness separately from + stored uniqueness results. Follow the + [IDKit setup and verification guide](https://docs.world.org/world-id/idkit/integrate). +- **IDKit sessions:** use repeated proofs of the saved \`session_id\` for account + continuity. Each check still requires user interaction and a fresh proof. + Use \`session_nullifier\` to identify a proof for replay checks. Manage + application login cookies and World IdP browser + sessions separately from proof sessions. Follow + the [session-proof guide](https://docs.world.org/world-id/idkit/session-proofs) + for registration, signed requests, verification, and replay checks. + +**Legacy Sign In with World ID is deprecated.** Use World IdP's OIDC flow for +new sign-in integrations; legacy credentials and identities are not interchangeable +with World IdP's. + +Apply the selected product's credential, environment, request-expiry, and replay +rules. Validate the resulting assurance and check business permissions in your application. +OIDC authentication remains repeatable. For one-use benefits, enforce your own rule with +atomic consumption in the +[appropriate identity scope](/agent-pass/id-tokens-and-identity#store-and-match-sub).`; +const quickstartContent = [ + "World IdP returns a signed authentication result and a sector-scoped account identifier.", + '', + '', + "## Choose your integration {#choose-your-integration}", + "[Set up your client](/agent-pass/app-registration), then follow the path for your application.", + quickstartTable, + "Keep your existing sign-in and add step-up when your application needs World ID authentication before sensitive actions.", + "## Environment values {#environment-values}", + environmentTable, + "Use registration, credentials, and discovery from the same environment.", + "## Other World ID integrations {#other-world-id-integrations}", + otherIntegrations, + "## Get help from a coding agent {#get-help-from-a-coding-agent}", + "Keep the final coding-agent setup link.", +].join("\n\n"); + +function visibilityParts(content, audience) { + return [...content.matchAll(new RegExp(`([\\s\\S]*?)<\\/Visibility>`, "g"))] + .map((match) => match[1]).join("\n"); +} + +test("quickstart cards and environment examples keep canonical agent tables, links, and anchors", () => { + const rendered = renderQuickstartLayout(quickstartContent); + const human = visibilityParts(rendered, "humans"); + const agents = visibilityParts(rendered, "agents"); + assert.equal([...human.matchAll(/`).length - 1, 1); + } + assert.equal(rendered.split("{#choose-your-integration}").length - 1, 1); + assert.equal(rendered.split("{#environment-values}").length - 1, 1); + assert.ok(rendered.includes("Keep the final coding-agent setup link.")); + assert.ok(rendered.includes("Use registration, credentials, and discovery from the same environment.")); + assert.ok(human.includes("https://docs.world.org/world-id/idkit/integrate")); + assert.ok(human.includes("https://docs.world.org/world-id/idkit/session-proofs")); + assert.ok(human.includes("atomically reject any `nullifier`")); + assert.ok(human.includes("reject reused `session_nullifier` values")); + assert.ok(human.includes("requires user interaction and a fresh proof.")); + assert.equal(rendered.split("**Legacy Sign In with World ID is deprecated.**").length - 1, 1); + assert.doesNotMatch(rendered, /^import /m); +}); + +test("quickstart adaptation rejects missing choices and changed reviewed identity guidance", () => { + const missingChoice = quickstartContent.replace(/^\| Authenticate a CLI[^\n]+\n/m, ""); + assert.throws(() => renderQuickstartLayout(missingChoice), /quickstart|integration|table|row|card/i); + const missingEnvironment = quickstartContent.replace(/^\| Discovery[^\n]+\n/m, ""); + assert.throws(() => renderQuickstartLayout(missingEnvironment), /quickstart|environment|table|row/i); + const changedClaim = quickstartContent.replace("Each check still requires user interaction and a fresh proof.", "Repeated checks need no user interaction."); + assert.throws(() => renderQuickstartLayout(changedClaim), /quickstart|IDKit|integration|source|review/i); +}); + +const clientAuthentication = `Authenticate at the token and device authorization endpoints with the client's +registered method: + +| Method | How to send credentials | +| -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| \`client_secret_basic\` (portal default) | Form-encode the client ID and secret and send them in the Authorization header as Basic credentials. An optional body \`client_id\` must match. | +| \`client_secret_post\` | Send \`client_id\` and \`client_secret\` in the form body, without an Authorization header. | +| \`private_key_jwt\` | Send \`client_id\`, \`client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer\`, and \`client_assertion\` in the form body, without an Authorization header. | + +For \`private_key_jwt\`, register the public JWKS in the portal and keep the private +key in your backend. The assertion is a compact RS256 JWT: + +- \`kid\` selects a registered RSA key (2048–8192 bits). It may be omitted when + exactly one key is registered. +- \`iss\` and \`sub\` are both the client ID. +- The single \`aud\` is \`https://auth.world.org\` or the exact endpoint being called. +- Include \`iat\`, \`exp\` (at most one hour after \`iat\`), and a unique \`jti\` of at + most 256 bytes. Expiration is strict; \`iat\` and optional \`nbf\` allow 30 seconds + of clock skew. + +Use a fresh assertion for every request, retry, and device poll, including after +\`authorization_pending\`. Assertions are single-use across endpoints. A rejected +assertion returns HTTP 400 \`invalid_client\`. +Keep request bodies, Authorization headers, and callback query strings out of logs.`; +const clientAuthenticationContent = [ + "## Register your application {#register-your-application}", + "Preserve the registration workflow.", + "## Client authentication {#client-authentication}", + clientAuthentication, + "## Manage credentials and callbacks {#manage-credentials-and-callbacks}", + "Keep rotation, sectors, and account-linking rules unchanged.", +].join("\n\n"); + +test("client authentication examples keep all methods and their complete canonical rules for agents", () => { + const rendered = renderClientAuthentication(clientAuthenticationContent); + const human = visibilityParts(rendered, "humans"); + const agents = visibilityParts(rendered, "agents"); + assert.match(human, /)/); + for (const method of ["client_secret_basic", "client_secret_post", "private_key_jwt"]) { + assert.ok(human.includes(method), `Missing method example: ${method}`); + } + assert.match(human, /form.encod/i); + assert.ok(human.includes("Authorization: Basic")); + assert.ok(human.includes("client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Ajwt-bearer")); + assert.ok(human.includes('```json title="JWT header"')); + assert.ok(human.includes('```json title="JWT payload"')); + assert.ok(agents.includes(clientAuthentication)); + for (const detail of ["2048–8192", "256 bytes", "30 seconds", "authorization_pending", "HTTP 400", "RS256"]) { + assert.ok(rendered.includes(detail), `Missing client authentication rule: ${detail}`); + } + assert.ok(rendered.includes("Preserve the registration workflow.")); + assert.ok(rendered.includes("Keep rotation, sectors, and account-linking rules unchanged.")); + assert.equal(rendered.split("{#client-authentication}").length - 1, 1); + assert.doesNotMatch(rendered, /^import /m); +}); + +test("client authentication adaptation fails when the reviewed methods or section boundary change", () => { + const missingMethod = clientAuthenticationContent.replace(/^\| `client_secret_post`[^\n]+\n/m, ""); + assert.throws(() => renderClientAuthentication(missingMethod), /client|auth|method|table|row/i); + const missingBoundary = clientAuthenticationContent.replace("## Manage credentials and callbacks {#manage-credentials-and-callbacks}", "## Renamed section {#renamed-section}"); + assert.throws(() => renderClientAuthentication(missingBoundary), /client|auth|section|boundar/i); +}); + +const oidcRequestBodies = [ + `GET https://auth.world.org/api/v1/authorize +client_id= +redirect_uri=https://app.example/auth/world/callback +response_type=code +scope=openid +state= +nonce= +code_challenge= +code_challenge_method=S256`, + `POST https://auth.world.org/api/v1/token +Content-Type: application/x-www-form-urlencoded + +grant_type=authorization_code +client_id= +client_secret= +code= +redirect_uri=https://app.example/auth/world/callback +code_verifier=`, + `POST https://auth.world.org/api/v1/device_authorization +Content-Type: application/x-www-form-urlencoded + +client_id= +client_secret= +scope=openid`, + `POST https://auth.world.org/api/v1/token +Content-Type: application/x-www-form-urlencoded + +grant_type=urn:ietf:params:oauth:grant-type:device_code +client_id= +client_secret= +device_code=`, +]; +const oidcRequestBlocks = oidcRequestBodies.map((body) => `\`\`\`text\n${body}\n\`\`\``); +const oidcPollRows = [ + ["HTTP 400 `authorization_pending`", "Keep waiting and poll again after the interval."], + ["HTTP 400 `slow_down`", "Add five seconds to all later intervals. An early poll can return this before the grant is checked; it never extends the attempt's expiry."], + ["`access_denied`, `expired_token`, `invalid_grant`, other OAuth error", "Stop polling."], + ["HTTP 503", "Temporary unavailability, never approval. End this attempt."], + ["HTTP 429", "Per-network-address flood protection on back-channel endpoints, separate from the per-client limits. It can end the attempt; `Retry-After` does not override the stop rules."], + ["Connection timeout", "Back off before polling again."], +]; +const oidcPollTable = [ + "| Poll response | What to do |", + "| --- | --- |", + ...oidcPollRows.map(([response, action]) => `| ${response} | ${action} |`), +].join("\n"); +const oidcExamplesContent = [ + '', + "## Authorization Code Flow {#authorization-code-flow}", + "The decoded authorization parameters are:", + oidcRequestBlocks[0], + "At the callback, validate state and the response issuer before redeeming the code.", + "For a client registered with `client_secret_post`, exchange the code with these decoded form fields:", + oidcRequestBlocks[1], + "URL-encode requests. Use your registered method and validate the result.", + '', + "## Device Authorization Grant {#device-authorization-grant}", + "### Device flow {#device-flow}", + "Keep the device code private and bind the validated result to the intended grant.", + oidcPollTable, + "Set each request's timeout within the attempt's remaining lifetime, and stop\nwhen the attempt expires. Do not automatically restart authorization in a loop\nafter a failed attempt.", + "For a client registered with `client_secret_post`, the decoded request fields are:", + oidcRequestBlocks[2], + "After waiting the returned `interval`, the decoded poll form is:", + oidcRequestBlocks[3], + "Use your form encoder. For other methods, use the registered client authentication.", + "### Expiry and rate limits {#expiry-and-rate-limits}", + "Keep all expiry, rate-limit, token-validation, and account-binding guidance.", +].join("\n\n"); + +test("OIDC request examples show decoded JSON while preserving every wire parameter and original agent block", () => { + const rendered = renderOidcExamples(oidcExamplesContent); + const human = visibilityParts(rendered, "humans"); + const agents = visibilityParts(rendered, "agents"); + const groups = [...human.matchAll(/]*)?>([\s\S]*?)<\/CodeGroup>/g)]; + assert.equal(groups.length, 4); + const expectedParameters = [ + { client_id: "", redirect_uri: "https://app.example/auth/world/callback", response_type: "code", scope: "openid", state: "", nonce: "", code_challenge: "", code_challenge_method: "S256" }, + { grant_type: "authorization_code", client_id: "", client_secret: "", code: "", redirect_uri: "https://app.example/auth/world/callback", code_verifier: "" }, + { client_id: "", client_secret: "", scope: "openid" }, + { grant_type: "urn:ietf:params:oauth:grant-type:device_code", client_id: "", client_secret: "", device_code: "" }, + ]; + for (const [index, group] of groups.entries()) { + const json = group[1].match(/```json[^\n]*\n([\s\S]*?)\n```/); + assert.ok(json, `Missing decoded JSON parameters for request ${index + 1}`); + assert.deepEqual(JSON.parse(json[1]), expectedParameters[index]); + assert.ok(agents.includes(oidcRequestBlocks[index]), `Original request ${index + 1} must remain available to agents`); + assert.ok(!human.includes(oidcRequestBlocks[index])); + } + for (const endpoint of ["GET https://auth.world.org/api/v1/authorize", "POST https://auth.world.org/api/v1/token", "POST https://auth.world.org/api/v1/device_authorization"]) { + assert.ok(human.includes(endpoint), `Missing request endpoint: ${endpoint}`); + } + assert.ok(human.includes("application/x-www-form-urlencoded")); + assert.equal(human.split("Content-Type: application/x-www-form-urlencoded").length - 1, 3); + assert.match(human, /URL.encod/i); + assert.match(human, /form.encod|form encoder/i); + assert.match(human, /not[^.\n]*JSON|JSON[^.\n]*not|decoded parameter/i); + assert.ok(rendered.includes("At the callback, validate state and the response issuer before redeeming the code.")); + assert.ok(rendered.includes("Keep all expiry, rate-limit, token-validation, and account-binding guidance.")); +}); + +test("device polling tabs preserve waits, terminal stops, and the complete canonical response table", () => { + const rendered = renderOidcExamples(oidcExamplesContent); + const human = visibilityParts(rendered, "humans"); + const agents = visibilityParts(rendered, "agents"); + assert.equal([...human.matchAll(/').length - 1, 1); +}); + +test("OIDC example adaptation fails closed when request fields or polling rules drift", () => { + const missingField = oidcExamplesContent.replace("code_verifier=\n", ""); + assert.throws(() => renderOidcExamples(missingField), /OIDC|request|parameter|field|review/i); + const changedValue = oidcExamplesContent.replace("code_challenge_method=S256", "code_challenge_method=plain"); + assert.throws(() => renderOidcExamples(changedValue), /OIDC|request|parameter|field|review/i); + const changedEncoding = oidcExamplesContent.replace("Content-Type: application/x-www-form-urlencoded", "Content-Type: application/json"); + assert.throws(() => renderOidcExamples(changedEncoding), /OIDC|request|content.type|review/i); + const missingResponse = oidcExamplesContent.replace(/^\| HTTP 503[^\n]+\n/m, ""); + assert.throws(() => renderOidcExamples(missingResponse), /OIDC|poll|response|row|review/i); + const changedStop = oidcExamplesContent.replace("Stop polling.", "Retry indefinitely."); + assert.throws(() => renderOidcExamples(changedStop), /OIDC|poll|response|action|review/i); +}); + +const oidcTroubleshootingContent = [ + "## Troubleshooting {#troubleshooting}", + "", + "OAuth failures include a human-readable `error_description` alongside `error` in", + "the JSON response or authorization error redirect. Use the description to diagnose", + "malformed parameters, and use the `error` code to decide how your application responds.", + "Descriptions never echo submitted values. A client or callback mismatch returns", + "an error without redirecting to your callback, using the same guidance for either mismatch.", + "Credential, grant, and service errors use deliberately generic descriptions.", + "Keep dependency failures distinguishable from invalid authentication.", + "", + "| Symptom | Check |", + "| ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |", + "| `invalid_scope` | Request `openid` for World ID authentication or `openid offline_access` for XAA delegation when discovery advertises it; `email` is also accepted. Remove other library scopes. |", + "| HTTP 400 `unsupported_grant_type` | Use a grant type advertised by discovery. See [XAA availability](/agent-pass/xaa#requirements) for refresh and exchange. |", + "| Authorization `invalid_request` | Check the active client, exact registered callback, state, nonce, S256 challenge, response mode, and supported prompt. Bad client/callback requests fail without redirecting to your callback. |", + "| `invalid_client` at token/device endpoint | Check environment, registered auth method, credential encoding, and that methods are not mixed. For JWTs check audience, key, expiry, and a fresh JTI per request. Basic failures use HTTP 401; POST/JWT failures use HTTP 400. |", + "| `invalid_grant` | Check expiry, single-use code, exact callback, PKCE verifier, and client binding. Do not blindly replay a possibly consumed code. |", + "| `login_required` / `interaction_required` | A `prompt=none` request cannot complete silently. Start an interactive request when appropriate. |", + "| `account_not_eligible` / `client_registration_disabled` in portal | Check participant Google-account eligibility and registration availability with the organizer/operator. These are not World ID proof failures. |", + "| HTTP 503 | Treat as temporary unavailability, never invalid identity or successful approval. Use bounded requests; apply the device polling rules above. |", +].join("\n"); + +test("OIDC troubleshooting tabs retain every symptom and check with the complete original agent guidance", () => { + const prefix = "Keep the full browser and device instructions.\n\n"; + const rendered = renderOidcTroubleshooting(prefix + oidcTroubleshootingContent); + const human = visibilityParts(rendered, "humans"); + const agents = visibilityParts(rendered, "agents"); + assert.equal([...human.matchAll(/`), `Missing troubleshooting tab: ${title}`); + } + const originalBody = oidcTroubleshootingContent.slice("## Troubleshooting {#troubleshooting}".length).trim(); + assert.ok(agents.includes(originalBody)); + const rows = originalBody.split("\n").filter((line) => line.startsWith("| ")).slice(2); + for (const row of rows) { + const [symptom, check] = row.split("|").slice(1, -1).map((cell) => cell.trim()); + assert.ok(human.includes(symptom), `Missing original symptom: ${symptom}`); + assert.ok(human.includes(check), `Missing original action: ${check}`); + } + assert.ok(human.includes("Descriptions never echo submitted values.")); + assert.match(human, /Credential, grant, and service\s+errors use generic descriptions\./); + assert.match(human, /Keep dependency failures distinguishable\s+from invalid authentication\./); + assert.ok(human.includes("Client and callback mismatches use the same guidance.")); + assert.ok(rendered.startsWith(prefix)); + assert.equal(rendered.split("{#troubleshooting}").length - 1, 1); +}); + +test("OIDC troubleshooting adaptation rejects changed contracts, extra rows, and duplicate sections", () => { + const changedAction = oidcTroubleshootingContent.replace("Treat as temporary unavailability, never invalid identity or successful approval.", "Treat an outage as approval."); + assert.notEqual(changedAction, oidcTroubleshootingContent); + assert.throws(() => renderOidcTroubleshooting(changedAction), /OIDC|troubleshooting|changed|review/i); + const extraRow = oidcTroubleshootingContent + "\n| New error | Unreviewed action. |"; + assert.throws(() => renderOidcTroubleshooting(extraRow), /OIDC|troubleshooting|changed|review/i); + const duplicate = oidcTroubleshootingContent + "\n\n## Troubleshooting {#troubleshooting}\n"; + assert.throws(() => renderOidcTroubleshooting(duplicate), /OIDC|troubleshooting|section/i); +}); + +const credentialCardsContent = [ + "## Credentials and authentication classes {#credentials-and-authentication-classes}", + "", + "Choose which verification your application accepts separately from how recently", + "the person must authenticate. A World ID account can hold both Orb and Selfie", + "Check credentials, plus passkeys for authentication.", + "", + "| Credential | What it establishes | Baseline `acr` |", + "| ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |", + "| Orb | Iris-based verification at an Orb provides high assurance of unique humanness. | `https://world.org/oidc/acr/orb` |", + "| Selfie Check | Camera-based liveness and facial similarity checks provide a medium-assurance signal of humanness and uniqueness, with greater duplicate-account risk than Orb. | `https://world.org/oidc/acr/selfie` |", + "| Passkey | Authenticates control of the account with WebAuthn user verification. It adds no biometric uniqueness verification. | The account's Orb or Selfie Check class, or no `acr` if it holds neither. |", + "", + "[Orb verification](https://docs.world.org/world-id/credentials/1) is suited to", + "applications that need stronger resistance to duplicate accounts.", + "[Selfie Check](https://docs.world.org/world-id/credentials/11) is available without", + "an Orb visit. It does not provide a strict one-person-one-account guarantee.", + "Choose according to the consequences of accepting a duplicate account.", + "", + "**Face Auth adds a face check during authentication with an existing credential.**", + "`https://world.org/oidc/acr/orb-face` adds a completed face check to an Orb proof;", + "`https://world.org/oidc/acr/selfie-face` adds it to a Selfie Check proof. A Selfie", + "Check credential by itself does not mean a face check occurred during this login.", + "A passkey cannot satisfy either `-face` class.", + "", + "Use `acr` for the achieved class, `amr` for the authentication method, and", + "`auth_time` for freshness. An account's verification type does not imply a fresh", + "biometric check. See [Assurance values](#assurance-values)", + "for the exact claims and [Accept Orb or Selfie Check](/agent-pass/step-up#accept-orb-or-selfie-check)", + "for requests that allow either credential.", + "", + "## Token response {#token-response}", + "", + "Keep token validation and response guidance unchanged.", +].join("\n"); + +test("credential cards distinguish Orb, passkey, and Selfie Check while retaining all canonical assurance rules", () => { + const rendered = renderCredentialCards(credentialCardsContent); + const human = visibilityParts(rendered, "humans"); + const agents = visibilityParts(rendered, "agents"); + const table = credentialCardsContent.match(/^\| Credential[^\n]+(?:\n\|[^\n]+)+/m)?.[0]; + assert.ok(table); + assert.ok(agents.includes(table)); + assert.ok(!human.includes(table)); + const humanImage = "/images/docs/credentials/proof-of-human.png"; + const passkeyImage = "/images/docs/credentials/passkey.png"; + const presenceImage = "/images/docs/credentials/proof-of-presence.png"; + assert.ok(human.includes(humanImage)); + assert.ok(human.includes(passkeyImage)); + assert.ok(human.includes(presenceImage)); + assert.equal((human.match(/]*>/g, "").replaceAll("'", "'"); + for (const row of table.split("\n").slice(2)) { + const [, description, acr] = row.split("|").slice(1, -1).map((cell) => cell.trim()); + assert.ok(readableHuman.includes(description), `Missing credential meaning: ${description}`); + assert.ok(readableHuman.includes(acr.replaceAll("`", "")), `Missing baseline class: ${acr}`); + } + assert.equal(rendered.split("**Face Auth adds a face check during authentication with an existing credential.**").length - 1, 1); + assert.ok(rendered.includes("A passkey cannot satisfy either `-face` class.")); + assert.ok(rendered.includes("Keep token validation and response guidance unchanged.")); + assert.equal(rendered.split("{#credentials-and-authentication-classes}").length - 1, 1); + const changedCredential = credentialCardsContent.replace("| Selfie Check |", "| Unreviewed credential |"); + assert.notEqual(changedCredential, credentialCardsContent); + assert.throws(() => renderCredentialCards(changedCredential), /credential|class|table|review|changed/i); +}); diff --git a/scripts/world-id-auth-benefits.mjs b/scripts/world-id-auth-benefits.mjs new file mode 100644 index 00000000..0a2e1db0 --- /dev/null +++ b/scripts/world-id-auth-benefits.mjs @@ -0,0 +1,34 @@ +// Short portal walkthrough for humans; retain the canonical reference for agents. +import { createHash } from "node:crypto"; + +const heading = "## Publish a benefit listing {#publish-a-benefit-listing}"; +const expectedSectionSha256 = "94e0a752601d7a7b5d4285b4ef9c348ca123baa35e1edb3192f4e445a6def680"; +const walkthrough = `Open your app's **Catalog** tab in the [developer portal](https://auth.world.org/portal). + +1. Add a listing name, description, and HTTPS benefit URL, separate from your OIDC callback. +2. Add optional public **Instructions** explaining how to claim. Exclude credentials and tokens. +3. The owner selects **Submit for review**. + +![Catalog tab showing the benefit listing fields and Submit for review below Instructions](/images/agent-pass/catalog-submit-review.jpg) + +Only approved, published listings for active clients appear in \`get_benefits\`. +Updates can take one minute; changing Instructions requires another review. +Your app enforces eligibility, authorization, and redemption.`; + +export function renderBenefitPublishing(content) { + if (content.split(heading).length !== 2) { + throw new Error("Benefit publishing requires exactly one canonical section"); + } + const start = content.indexOf(heading); + const original = content.slice(start); + const normalized = original.replace(/\s+/g, " ").trim(); + if (createHash("sha256").update(normalized).digest("hex") !== expectedSectionSha256) { + throw new Error("Canonical benefit publishing changed; review the portal walkthrough"); + } + const agentBody = original.slice(heading.length).trim(); + return content.slice(0, start) + [ + heading, "", + '', "", walkthrough, "", "", "", + '', "", agentBody, "", "", + ].join("\n"); +} diff --git a/scripts/world-id-auth-client-auth.mjs b/scripts/world-id-auth-client-auth.mjs new file mode 100644 index 00000000..a3ac6718 --- /dev/null +++ b/scripts/world-id-auth-client-auth.mjs @@ -0,0 +1,106 @@ +// Reviewed presentation of the canonical client-authentication section. +// Keep the complete source body available in Markdown exports for agents. +import { createHash } from "node:crypto"; + +const heading = "## Client authentication {#client-authentication}"; +const nextHeading = "## Manage credentials and callbacks {#manage-credentials-and-callbacks}"; +// Full rendered canonical section, with horizontal whitespace normalized. +// Any source contract change requires a deliberate presentation review. +const expectedSectionSha256 = "64ba37fd7e634d2449c7e62b8b9e37cfb7b158ab3ee6762917cd2cae5023a40b"; +const humanBody = [ + "Authenticate at the token and device authorization endpoints with your registered", + "method. These examples show credential fragments only. Add the fields required", + "by your grant, such as `grant_type`, an authorization code and PKCE verifier, or", + "`device_code`, and use a form encoder for the request body.", + "", + "For Basic authentication, form-encode the client ID and secret separately, join", + "them with `:`, then Base64-encode that string as ``. The body", + "`client_id` shown below is optional; when supplied, it must match the Basic", + "credentials. For POST and JWT authentication, omit the `Authorization` header.", + "Replace every placeholder with the indicated encoded value.", + "", + "{/* cspell:disable */}", + "", + "```http title=\"client_secret_basic (portal default)\"", + "Content-Type: application/x-www-form-urlencoded", + "Authorization: Basic ", + "", + "client_id=", + "```", + "", + "```http title=\"client_secret_post\"", + "Content-Type: application/x-www-form-urlencoded", + "", + "client_id=&client_secret=", + "```", + "", + "```http title=\"private_key_jwt\"", + "Content-Type: application/x-www-form-urlencoded", + "", + "client_id=&client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Ajwt-bearer&client_assertion=", + "```", + "", + "{/* cspell:enable */}", + "", + "For `private_key_jwt`, register the public JWKS in the portal and keep the private", + "key in your backend. Use a JWT library to sign the header and payload below as", + "a compact RS256 assertion. These are illustrative decoded values, not a signed", + "assertion or reusable credentials.", + "", + "```json title=\"JWT header\"", + "{", + " \"alg\": \"RS256\",", + " \"kid\": \"\"", + "}", + "```", + "", + "`kid` selects a registered RSA key of 2048–8192 bits. Omit `kid` only when exactly", + "one key is registered.", + "", + "```json title=\"JWT payload\"", + "{", + " \"iss\": \"\",", + " \"sub\": \"\",", + " \"aud\": \"https://auth.world.org\",", + " \"iat\": 1790000000,", + " \"exp\": 1790000300,", + " \"jti\": \"\"", + "}", + "```", + "", + "Set both `iss` and `sub` to your client ID. Use a single audience: the issuer shown", + "above or the exact endpoint being called. Generate current `iat` and `exp` values", + "for each request, with `exp` at most one hour after `iat`, and a unique `jti` of", + "at most 256 bytes. Expiration is strict; `iat` and optional `nbf` allow 30 seconds", + "of clock skew.", + "", + "Use a fresh assertion for every request, retry, and device poll, including after", + "`authorization_pending`. Assertions are single-use across endpoints. A rejected", + "assertion returns HTTP 400 `invalid_client`.", + "Keep request bodies, Authorization headers, and callback query strings out of logs.", +].join("\n"); + +export function renderClientAuthentication(content) { + const matches = [...content.matchAll(/^## Client authentication \{#client-authentication\}$/gm)]; + if (matches.length !== 1) { + throw new Error("Client authentication examples require exactly one canonical section"); + } + const start = matches[0].index; + const end = content.indexOf("\n## ", start + heading.length); + if (end < 0 || content.slice(end + 1).split("\n", 1)[0] !== nextHeading) { + throw new Error("Client authentication section boundary changed; review its examples"); + } + const original = content.slice(start, end); + const normalized = original.replace(/[ \t]+/g, " ").trim(); + const actual = createHash("sha256").update(normalized).digest("hex"); + if (actual !== expectedSectionSha256) { + throw new Error("Canonical client authentication changed; review its credential and JWT examples"); + } + const agentBody = original.slice(heading.length).trim(); + const replacement = [ + heading, "", + '', "", humanBody, "", "", "", + '', "", agentBody, "", "", "", + ].join("\n"); + return content.slice(0, start) + replacement + content.slice(end); +} diff --git a/scripts/world-id-auth-credentials.mjs b/scripts/world-id-auth-credentials.mjs new file mode 100644 index 00000000..9aa7bcc8 --- /dev/null +++ b/scripts/world-id-auth-credentials.mjs @@ -0,0 +1,68 @@ +// Present canonical credential data as cards without changing the agent table. +const heading = "## Credentials and authentication classes {#credentials-and-authentication-classes}"; +const headers = ["Credential", "What it establishes", "Baseline `acr`"]; +const baseline = { + Orb: "`https://world.org/oidc/acr/orb`", + "Selfie Check": "`https://world.org/oidc/acr/selfie`", + Passkey: "The account's Orb or Selfie Check class, or no `acr` if it holds neither.", +}; +const cards = [ + { source: "Orb", title: "Proof of Human", image: "/images/docs/credentials/proof-of-human.png", href: "/world-id/credentials/1" }, + { source: "Passkey", title: "Passkey", image: "/images/docs/credentials/passkey.png", href: "#authentication-methods" }, + { source: "Selfie Check", title: "Proof of Presence", image: "/images/docs/credentials/proof-of-presence.png", href: "/world-id/credentials/11" }, +]; + +function escapeHtml(text) { + return text.replace(/[&<>"'{}]/g, (character) => ({ + "&": "&", "<": "<", ">": ">", '"': """, + "'": "'", "{": "{", "}": "}", + })[character]); +} + +function inlineCode(text) { + return text.split(/(`[^`]+`)/g).map((part) => part.startsWith("`") && part.endsWith("`") + ? `${escapeHtml(part.slice(1, -1))}` : escapeHtml(part)).join(""); +} + +function renderCard(card, row) { + const title = escapeHtml(card.title); + const visual = `${title} credential card`; + return ` + ${visual} +

${title}

+

${inlineCode(row[1])}

+

Baseline acr

+

${inlineCode(row[2])}

+
`; +} + +export function renderCredentialCards(content) { + const matches = [...content.matchAll(/^## Credentials and authentication classes \{#credentials-and-authentication-classes\}$/gm)]; + if (matches.length !== 1) throw new Error("Credential cards require exactly one canonical credentials section"); + const start = matches[0].index; + const next = content.indexOf("\n## ", start + heading.length); + const section = content.slice(start, next < 0 ? content.length : next); + const tables = [...section.matchAll(/^\|[^\n]*\|[ \t]*(?:\n\|[^\n]*\|[ \t]*)+/gm)]; + const cells = (line) => line.trim().slice(1, -1).split("|").map((cell) => cell.trim()); + const original = tables[0]?.[0]; + const rows = original?.split("\n").map(cells); + if (!rows || rows.length !== 5 || rows.some((row) => row.length !== 3) || + rows[0].some((cell, index) => cell !== headers[index]) || + rows[1].some((cell) => !/^:?-{3,}:?$/.test(cell)) || + tables.filter((table) => cells(table[0].split("\n", 1)[0]).join("|") === headers.join("|")).length !== 1) { + throw new Error("Canonical credential table changed; review the card layout"); + } + const data = new Map(rows.slice(2).map((row) => [row[0], row])); + if (data.size !== 3 || cards.some((card) => { + const row = data.get(card.source); + return !row || !row[1] || row[2] !== baseline[card.source]; + })) throw new Error("Credential labels or baseline classes changed; review the card mapping"); + const human = `
+
+${cards.map((card) => renderCard(card, data.get(card.source))).join("\n")} +
+
`; + const replacement = `\n ${human}\n\n\n\n\n${original}\n\n`; + const tableStart = start + tables[0].index; + return content.slice(0, tableStart) + replacement + content.slice(tableStart + original.length); +} diff --git a/scripts/world-id-auth-oidc.mjs b/scripts/world-id-auth-oidc.mjs new file mode 100644 index 00000000..20d0b4e6 --- /dev/null +++ b/scripts/world-id-auth-oidc.mjs @@ -0,0 +1,104 @@ +// Presentation-only examples. Agent exports retain the original requests and table. +const visibility = (human, original) => `\n${human}\n\n\n\n${original}\n`; +const requests = [ + { title: "Authorization parameters", method: "GET", endpoint: "authorize", keys: ["client_id", "redirect_uri", "response_type", "scope", "state", "nonce", "code_challenge", "code_challenge_method"], constants: { response_type: "code", scope: "openid", code_challenge_method: "S256" } }, + { title: "Code exchange", method: "POST", endpoint: "token", keys: ["grant_type", "client_id", "client_secret", "code", "redirect_uri", "code_verifier"], constants: { grant_type: "authorization_code" } }, + { title: "Device authorization", method: "POST", endpoint: "device_authorization", keys: ["client_id", "client_secret", "scope"], constants: { scope: "openid" } }, + { title: "Device token polling", method: "POST", endpoint: "token", keys: ["grant_type", "client_id", "client_secret", "device_code"], constants: { grant_type: "urn:ietf:params:oauth:grant-type:device_code" } }, +]; +const responseLabels = [ + "HTTP 400 `authorization_pending`", + "HTTP 400 `slow_down`", + "`access_denied`, `expired_token`, `invalid_grant`, other OAuth error", + "HTTP 503", + "HTTP 429", + "Connection timeout", +]; +const responseActions = [ + "Keep waiting and poll again after the interval.", + "Add five seconds to all later intervals. An early poll can return this before the grant is checked; it never extends the attempt's expiry.", + "Stop polling.", + "Temporary unavailability, never approval. End this attempt.", + "Per-network-address flood protection on back-channel endpoints, separate from the per-client limits. It can end the attempt; `Retry-After` does not override the stop rules.", + "Back off before polling again.", +]; + +function review(message) { + throw new Error(`OIDC examples require review: ${message}`); +} + +function requestExample(original, source, expected) { + const lines = source.split("\n"); + const endpoint = lines.shift(); + if (endpoint !== `${expected.method} https://auth.world.org/api/v1/${expected.endpoint}`) { + review(`endpoint or order changed for ${expected.title}`); + } + let contentType; + if (lines[0]?.startsWith("Content-Type:")) { + contentType = lines.shift(); + if (expected.method !== "POST" || contentType !== "Content-Type: application/x-www-form-urlencoded") { + review(`content type changed for ${expected.title}`); + } + } + while (lines[0] === "") lines.shift(); + const pairs = lines.map((line) => { + const match = line.match(/^([a-z_]+)=(.+)$/); + if (!match) review(`unrecognized request field for ${expected.title}`); + return [match[1], match[2]]; + }); + const keys = pairs.map(([key]) => key); + if (new Set(keys).size !== keys.length || keys.length !== expected.keys.length || + [...keys].sort().join("|") !== [...expected.keys].sort().join("|")) { + review(`parameter keys changed for ${expected.title}`); + } + const parameters = Object.fromEntries(pairs); + if (Object.entries(expected.constants).some(([key, value]) => parameters[key] !== value)) { + review(`request profile changed for ${expected.title}`); + } + const lead = `\`${endpoint}\`${contentType ? ` with \`${contentType}\`` : ""}.`; + const encoding = expected.method === "GET" + ? "Send these as URL-encoded query parameters." + : "Form-encode these fields; do not send JSON."; + const human = `${lead}\n\n${encoding}\n\n\n\`\`\`json title="${expected.title}"\n${JSON.stringify(parameters, null, 2)}\n\`\`\`\n`; + return visibility(human, original); +} + +function pollingResponses(content) { + const tables = [...content.matchAll(/^\|[^\n]*\|[ \t]*(?:\n\|[^\n]*\|[ \t]*)+$/gm)] + .filter(([value]) => value.split("\n")[0].split("|")[1]?.trim() === "Poll response"); + if (tables.length !== 1) review("expected one device polling response table"); + const original = tables[0][0]; + const rows = original.split("\n").map((line) => line.trim().slice(1, -1).split("|").map((cell) => cell.trim())); + if (rows.length !== 8 || rows.some((row) => row.length !== 2) || + rows[0].join("|") !== "Poll response|What to do" || !rows[1].every((cell) => /^:?-{3,}:?$/.test(cell))) { + review("polling response table columns or row count changed"); + } + const responses = rows.slice(2); + if (responses.some(([label, action], index) => label !== responseLabels[index] || + action.replace(/\s+/g, " ") !== responseActions[index])) { + review("polling response labels or actions changed"); + } + const oauth = (error, status) => `${status ? `HTTP ${status}.\n\n` : ""}\`\`\`json\n${JSON.stringify({ error }, null, 2)}\n\`\`\``; + const options = [ + ["authorization_pending", oauth("authorization_pending", 400), responses[0][1]], + ["slow_down", oauth("slow_down", 400), responses[1][1]], + ["access_denied", oauth("access_denied"), responses[2][1]], + ["expired_token", oauth("expired_token"), responses[2][1]], + ["invalid_grant", oauth("invalid_grant"), responses[2][1]], + ["Other OAuth errors", "Any other OAuth error.", responses[2][1]], + ["HTTP 503", "```http\nHTTP/1.1 503\n```", responses[3][1]], + ["HTTP 429", "```http\nHTTP/1.1 429\n```", responses[4][1]], + ["Timeout", "No HTTP response.", responses[5][1]], + ]; + const tabs = options.map(([title, example, action]) => ` \n\n${example}\n\n${action}\n\n `); + return content.replace(original, visibility(`\n${tabs.join("\n")}\n`, original)); +} + +export function renderOidcExamples(content) { + if (typeof content !== "string") review("expected a converted MDX body"); + const blocks = [...content.matchAll(/^```text\n([\s\S]*?)\n```$/gm)]; + if (blocks.length !== requests.length) review("expected four reviewed request blocks"); + let index = 0; + const result = content.replace(/^```text\n([\s\S]*?)\n```$/gm, (original, source) => requestExample(original, source, requests[index++])); + return pollingResponses(result); +} diff --git a/scripts/world-id-auth-quickstart.mjs b/scripts/world-id-auth-quickstart.mjs new file mode 100644 index 00000000..3df1f350 --- /dev/null +++ b/scripts/world-id-auth-quickstart.mjs @@ -0,0 +1,98 @@ +// Presentation-only adaptations. Keep the complete canonical text in agent exports. +const icons = { + "/agent-pass/connect-your-backend#sign-in-through-the-browser": "window-maximize", + "/agent-pass/connect-your-backend#sign-in-a-headless-agent-device-flow": "terminal", + "/agent-pass/step-up": "shield-halved", + "/agent-pass/step-up#human-checkpoints": "user-check", + "/agent-pass/connect-your-backend#primary-sign-in": "key", + "/agent-pass/connect-your-auth-server": "server", + "/agent-pass/xaa": "arrows-left-right", +}; +const heading = (title, id) => `## ${title} {#${id}}\n`; +const visibility = (human, original) => `\n${human}\n\n\n\n${original}\n`; +const attribute = (value) => value.replaceAll("&", "&").replaceAll('"', """); + +function review(message) { + throw new Error(`Quickstart layout requires review: ${message}`); +} + +function section(content, title, id, nextTitle, nextId, render) { + const startHeading = heading(title, id); + const endHeading = heading(nextTitle, nextId); + if (content.split(startHeading).length !== 2 || content.split(endHeading).length !== 2) { + review(`missing or repeated section boundary for ${title}`); + } + const start = content.indexOf(startHeading) + startHeading.length; + const end = content.indexOf(endHeading, start); + if (end < start || /^## /m.test(content.slice(start, end))) review(`section boundary changed for ${title}`); + return content.slice(0, start) + render(content.slice(start, end)) + content.slice(end); +} + +function table(body, columns, rowCount) { + const matches = [...body.matchAll(/^\|[^\n]*\|[ \t]*(?:\n\|[^\n]*\|[ \t]*)+$/gm)]; + if (matches.length !== 1) review(`expected one ${columns.join("/")} table`); + const original = matches[0][0]; + const rows = original.split("\n").map((line) => line.trim().slice(1, -1).split("|").map((cell) => cell.trim())); + if (rows.some((row) => row.length !== columns.length) || rows[0].join("|") !== columns.join("|") || + !rows[1]?.every((cell) => /^:?-{3,}:?$/.test(cell)) || rows.length !== rowCount + 2) { + review(`changed ${columns.join("/")} table columns or row count`); + } + return { original, rows: rows.slice(2) }; +} + +function cards(body) { + const { original, rows } = table(body, ["Goal", "Guide"], 7); + const rendered = rows.map(([goal, guide]) => { + const link = guide.match(/^\[([^\]\n]+)\]\((\/agent-pass\/[^\s"'<>]+)\)$/); + if (!goal || !link || !icons[link[2]]) review("integration goals must have one reviewed linked guide each"); + return ` \n ${goal}\n `; + }); + return body.replace(original, visibility(`\n${rendered.join("\n")}\n`, original)); +} + +function environment(body) { + const { original, rows } = table(body, ["Setting", "Value"], 3); + if (rows.map(([label]) => label).join("|") !== "Issuer|Discovery|Developer portal") review("environment settings changed"); + const issuer = rows[0][1].match(/^`(https:\/\/[^\s`"'<>]+)`$/)?.[1]; + const discovery = rows[1][1].match(/^`(https:\/\/[^\s`"'<>]+)`$/)?.[1]; + const portal = rows[2][1].match(/^\[[^\]\n]+\]\((https:\/\/[^\s"'<>]+)\)$/)?.[1]; + if (!issuer || !discovery || !portal) review("environment URLs must retain their reviewed code/link formats"); + const json = JSON.stringify({ issuer, discovery, developer_portal: portal }, null, 2); + const rendered = `Production URLs for your OIDC client and [developer portal](${portal}):\n\n\`\`\`json\n${json}\n\`\`\``; + return body.replace(original, visibility(rendered, original)); +} + +const integrationEdits = [ + [ + "These guides cover OIDC integration with World IdP. Use World IdP's\nregistrations, credentials, and identifiers only for that flow; IDKit proof\napplications use their own.", + "IDKit gives your application World ID proofs to verify. World IdP gives it\nOpenID Connect ID tokens to validate. Keep their registrations, credentials, and\nidentifiers separate.", + ], + [ + "- **IDKit uniqueness:** use a nullifier scoped to the application and action for\n one-use eligibility. Verify the proof on your backend and atomically reject a\n previously consumed nullifier.", + "- **Verify a World ID proof (IDKit):** verify the complete proof on your backend.\n For a one-use action, atomically reject any `nullifier` already accepted for that\n app and action.", + ], + [ + "- **IDKit sessions:** use repeated proofs of the saved `session_id` for account\n continuity. Each check still requires user interaction and a fresh proof.\n Use `session_nullifier` to identify a proof for replay checks.", + "- **Verify returning users (IDKit):** verify a new proof for the account's saved\n `session_id` and reject reused `session_nullifier` values. Each check still\n requires user interaction and a fresh proof.", + ], +]; + +function otherIntegrations(body) { + const warning = "\n\n**Legacy Sign In with World ID is deprecated.**"; + if (body.split(warning).length !== 2) review("legacy deprecation warning changed"); + const boundary = body.indexOf(warning); + const original = body.slice(0, boundary).trim(); + if ((original.match(/^- /gm) ?? []).length !== 2) review("IDKit comparison bullet count changed"); + let rendered = original; + for (const [before, after] of integrationEdits) { + if (rendered.split(before).length !== 2) review("IDKit comparison wording changed"); + rendered = rendered.replace(before, after); + } + return `\n${visibility(rendered, original)}${body.slice(boundary)}`; +} + +export function renderQuickstartLayout(content) { + let result = section(content, "Choose your integration", "choose-your-integration", "Environment values", "environment-values", cards); + result = section(result, "Environment values", "environment-values", "Other World ID integrations", "other-world-id-integrations", environment); + return section(result, "Other World ID integrations", "other-world-id-integrations", "Get help from a coding agent", "get-help-from-a-coding-agent", otherIntegrations); +} diff --git a/scripts/world-id-auth-troubleshooting.mjs b/scripts/world-id-auth-troubleshooting.mjs new file mode 100644 index 00000000..a2f423a1 --- /dev/null +++ b/scripts/world-id-auth-troubleshooting.mjs @@ -0,0 +1,62 @@ +// Reviewed human presentation; retain the complete canonical section for agents. +import { createHash } from "node:crypto"; + +const heading = "## Troubleshooting {#troubleshooting}"; +// Pin the entire rendered canonical section, including its introduction and rows. +// Horizontal table padding and trailing whitespace do not affect the contract. +const expectedSectionSha256 = "7c8fae10d35e79a48e81f3ce69e43e5ca197a19635d2ad76184ae1859c1d4263"; +const tabTitles = [ + "invalid_scope", + "unsupported_grant_type", + "invalid_request", + "invalid_client", + "invalid_grant", + "Silent sign-in", + "Portal access", + "HTTP 503", +]; +const introduction = [ + "Select an error to see what to check. OAuth failures provide `error` and", + "`error_description` in a JSON response or authorization error redirect.", + "Use `error` to choose how your application responds and `error_description`", + "to diagnose malformed parameters.", +].join("\n"); +const commonGuidance = [ + "", + " Descriptions never echo submitted values. Credential, grant, and service", + " errors use generic descriptions. Keep dependency failures distinguishable", + " from invalid authentication.", + "", +].join("\n"); + +export function renderOidcTroubleshooting(content) { + const matches = [...content.matchAll(/^## Troubleshooting \{#troubleshooting\}$/gm)]; + if (matches.length !== 1) { + throw new Error("OIDC troubleshooting requires exactly one canonical section"); + } + const start = matches[0].index; + const original = content.slice(start); + const normalized = original.replace(/[ \t]+/g, " ").trim(); + if (createHash("sha256").update(normalized).digest("hex") !== expectedSectionSha256) { + throw new Error("Canonical OIDC troubleshooting changed; review its error tabs"); + } + const rows = original.split("\n").filter((line) => line.startsWith("| ")) + .slice(2).map((line) => line.split("|").slice(1, -1).map((cell) => cell.trim())); + if (rows.length !== tabTitles.length || rows.some((row) => row.length !== 2)) { + throw new Error("OIDC troubleshooting table changed; review its error tabs"); + } + const tabs = rows.map(([symptom, check], index) => { + const mismatchGuidance = index === 2 + ? "\n\nClient and callback mismatches use the same guidance." + : ""; + return ` \n\n${symptom}\n\n${check}${mismatchGuidance}\n\n `; + }).join("\n"); + const agentBody = original.slice(heading.length).trim(); + return content.slice(0, start) + [ + heading, "", + '', "", + introduction, "", commonGuidance, "", "", tabs, "", "", + "", "", + '', "", agentBody, "", "", + ].join("\n"); +} diff --git a/snippets/qr-code-generator.jsx b/snippets/qr-code-generator.jsx index e611287b..6f73e0ff 100644 --- a/snippets/qr-code-generator.jsx +++ b/snippets/qr-code-generator.jsx @@ -87,7 +87,7 @@ export const QRCodeGenerator = (props) => {
  1. Enter your App ID {hideInput ? "via props" : "above"}.
  2. Scan the QR with your phone’s camera.
  3. -
  4. Confirm the prompt in World App.
  5. +
  6. Confirm the prompt in World Money.
)} diff --git a/tailwind.css b/tailwind.css index 4ab25699..3fd03a85 100644 --- a/tailwind.css +++ b/tailwind.css @@ -149,7 +149,7 @@ #navbar .nav-tabs-item > div.absolute { display: none; } - /* Hairline divider between the page tabs and the Resources/Support + /* Hairline divider between the page tabs and the Others/Resources/Support menus (the menu tabs render as
PayRequest a payment inside World AppRequest a payment inside World Money
Wallet Auth
Share ContactsOpen the World App contact pickerOpen the World Money contact picker
Request Permission
diff --git a/world-id/SKILL.md b/world-id/SKILL.md index 48468f3a..3a31c774 100644 --- a/world-id/SKILL.md +++ b/world-id/SKILL.md @@ -1,7 +1,7 @@ --- name: world-id-integration description: | - Use this skill when adding, upgrading, debugging, or testing World ID verification with IDKit in a new or existing web or mobile app. Covers Proof of Human, passport/document, Selfie Check, and session/sign-in flows; Developer Portal app, RP, and action setup; server-side signing and proof verification; environment matching; nullifier replay protection; and launch testing. Trigger when the user asks to add World ID, verify humans, stop bots or multi-accounting, add Sybil resistance, or mentions IDKit, Orb, World ID proof flows, World App proof flows, @worldcoin/idkit, signing keys, rp_id, or app_id. + Use this skill when adding, upgrading, debugging, or testing World ID verification with IDKit in a new or existing web or mobile app. Covers Proof of Human, passport/document, Selfie Check, and session/sign-in flows; Developer Portal app, RP, and action setup; server-side signing and proof verification; environment matching; nullifier replay protection; and launch testing. Trigger when the user asks to add World ID, verify humans, stop bots or multi-accounting, add Sybil resistance, or mentions IDKit, Orb, World ID proof flows, World ID app proof flows, @worldcoin/idkit, signing keys, rp_id, or app_id. version: 0.1.0 metadata: author: worldcoin @@ -190,7 +190,7 @@ Surface these proactively when you see the matching symptom — don't make the u |---|---|---| | World ID shows "action not found" or QR scan does nothing | Action wasn't created in the environment IDKit is pointing at | Create the missing action with `create_world_id_action` (`environment: "production"` for real devices, `"staging"` for simulator). Confirm `NEXT_PUBLIC_WLD_ENVIRONMENT` matches. | | `/api/v4/verify/{rp_id}` returns `invalid_proof` or `verification_failed` | Often staging/production env mismatch, or proof was mutated before forward | Re-check Phase 5. Forward the proof JSON byte-for-byte without re-encoding fields. | -| Verification fails in JS/React and the error code alone isn't enough | Need transport/payload diagnostics | Read `getDebugReport()` (or the `onError` `debugReport` arg) — it carries `transport`, `request_id`, request/response payloads, and World App `mini_app` channel info. JS SDKs only. | +| Verification fails in JS/React and the error code alone isn't enough | Need transport/payload diagnostics | Read `getDebugReport()` (or the `onError` `debugReport` arg) — it carries `transport`, `request_id`, request/response payloads, and World Money `mini_app` channel info. JS SDKs only. | | `/api/v4/verify/{rp_id}` returns `not_registered` or 4xx with `rp` errors | On-chain registration is still `pending` | Poll `get_world_id_registration_status` until the intended environment is `registered`. Production must be registered before launch. | | Signing key is gone (lost `.env`, never persisted) | `signing_key.private_key` is returned exactly once at create/rotate time | Prepare the replacement secret destination, explain the invalidation impact, get confirmation, then call `rotate_world_id_signing_key`, persist the new key immediately, and redeploy. | | Duplicate-verification (user submits the same proof twice) | Expected — that's what nullifiers prevent | Reject on the unique-constraint violation. **Do not** "helpfully" upsert. | diff --git a/world-id/agent-pass.mdx b/world-id/agent-pass.mdx new file mode 100644 index 00000000..bfea2531 --- /dev/null +++ b/world-id/agent-pass.mdx @@ -0,0 +1,47 @@ +--- +title: "World IdP" +sidebarTitle: "Agent Pass (OIDC)" +description: "Authenticate World ID accounts with OpenID Connect and check authentication before sensitive actions." +"og:image": "https://raw.githubusercontent.com/worldcoin/developer-docs/main/images/docs/docs-meta.png" +"twitter:image": "https://raw.githubusercontent.com/worldcoin/developer-docs/main/images/docs/docs-meta.png" +--- + +World IdP returns an OpenID Connect ID token after a user authenticates with +World ID. Your backend or auth server validates the token and uses `(iss, sub)` +to match the user to an application account. You manage login sessions and +permissions in your application. + + + +## Connect your application + +Follow the [Quickstart](/agent-pass/quickstart) and +[register your application](/agent-pass/app-registration). Choose the flow your +client supports: + +- [Browser sign-in](/agent-pass/connect-your-backend#sign-in-through-the-browser). + For web apps with a browser callback URL. +- [Device authorization](/agent-pass/connect-your-backend#sign-in-a-headless-agent-device-flow). + For a CLI or other client without a browser callback. + +## Check authentication before an action + +Use [step-up authentication](/agent-pass/step-up) to require recent authentication +or a specific method before an action. + +[Human checkpoints](/agent-pass/human-in-the-loop) pause an agent workflow while +a person authenticates. Your backend checks permissions and any required action +approval before resuming. + +## Authorize access to your MCP server + +With [MCP authorization](/agent-pass/connect-your-auth-server), your auth server +authenticates the user through World IdP and issues an access token for your MCP +server. + +With [Cross App Access (XAA)](/agent-pass/xaa), users choose which apps a supported +agent host may access. Each app's auth server issues its own access tokens. + +For proof-based integration with IDKit, return to +[Choose your integration](/world-id/overview#choose-your-integration). IDKit and +World IdP use different registrations, credentials, and account identifiers. diff --git a/world-id/credentials/11.mdx b/world-id/credentials/11.mdx index 26be43ea..ac02d6ab 100644 --- a/world-id/credentials/11.mdx +++ b/world-id/credentials/11.mdx @@ -57,7 +57,7 @@ Use Proof of Presence for: Proof of Presence has a 90-day inactivity window. After 90 days without use, the user completes the camera flow again before returning another proof. -Anyone with World ID App can use Proof of Presence. No Orb, passport or +Anyone with the World ID app can use Proof of Presence. No Orb, passport or other prerequisite credential is required. ## Uniqueness Risk Signal @@ -66,7 +66,7 @@ Each Proof of Presence response includes a versioned `sybil_score` that can help an app assess the risk of repeated enrollment. It is a risk signal, not a uniqueness verdict, and should be considered alongside other evidence. The response also includes an `integrity_bundle` that lets the Developer Portal -verify it came from an authentic World ID App. +verify it came from an authentic World ID app. ### Understanding Sybil Score @@ -126,13 +126,13 @@ guarantee. Use the `selfieCheck` preset in IDKit to integrate Proof of Presence into your application. -* **On mobile (iOS/Android):** Use IDKit to generate a deep link and attach it to a "Verify" CTA. When the user taps it, they are redirected to World ID App to complete Proof of Presence. -* **On desktop:** Use IDKit to generate a QR code and display it to the user. When the user scans it with their mobile device camera, World ID App launches and guides them through Proof of Presence. +* **On mobile (iOS/Android):** Use IDKit to generate a deep link and attach it to a "Verify" CTA. When the user taps it, they are redirected to World ID app to complete Proof of Presence. +* **On desktop:** Use IDKit to generate a QR code and display it to the user. When the user scans it with their mobile device camera, World ID app launches and guides them through Proof of Presence. ## User Experience Flow 1. **Challenge:** The user initiates the flow on your app (Relying Party). -2. **Hand-off:** The user is redirected to World ID App. If they don't have World ID App installed, they are guided to download it and go straight into the Proof of Presence experience. +2. **Hand-off:** The user is redirected to World ID app. If they don't have World ID app installed, they are guided to download it and go straight into the Proof of Presence experience. 3. **Enrollment/Auth:** * **New User:** Enrolls with a selfie and liveness check. * **Returning User:** Completes a short camera check to verify continuity. diff --git a/world-id/idkit/credentials.mdx b/world-id/idkit/credentials.mdx index d786bd32..b6198291 100644 --- a/world-id/idkit/credentials.mdx +++ b/world-id/idkit/credentials.mdx @@ -114,7 +114,7 @@ Use `CredentialRequest("selfie")` with [session proofs](/world-id/idkit/session- users when they first arrive and when they return. Create a session once, save its verified `session_id`, then prove that same session on later checks. -Anyone with World ID App can complete the flow—no Orb or document credential is +Anyone with the World ID app can complete the flow—no Orb or document credential is required. ```typescript diff --git a/world-id/idkit/error-codes.mdx b/world-id/idkit/error-codes.mdx index 4d6d9be1..54c5fe86 100644 --- a/world-id/idkit/error-codes.mdx +++ b/world-id/idkit/error-codes.mdx @@ -50,7 +50,7 @@ This page documents the IDKit SDK and bridge error codes returned during request - + @@ -80,7 +80,7 @@ This page documents the IDKit SDK and bridge error codes returned during request - + diff --git a/world-id/idkit/integrate.mdx b/world-id/idkit/integrate.mdx index 5678f2e0..c6602938 100644 --- a/world-id/idkit/integrate.mdx +++ b/world-id/idkit/integrate.mdx @@ -8,7 +8,7 @@ description: "Integrate World ID into your app" import IDKitResponse from "/snippets/idkit-response.mdx"; -IDKit is the SDK for integrating World ID into your app. It handles proof requests, verification flows and communication with the World ID App, so your backend receives cryptographic proof of human, not personal data. +IDKit is the SDK for integrating World ID into your app. It handles proof requests, verification flows and communication with the World ID app, so your backend receives cryptographic proof of human, not personal data. Use the React widget for drop-in integration, or the JS, Swift and Kotlin SDKs for custom flows. For the core concepts of World ID, see [this page](/world-id/concepts). @@ -18,11 +18,23 @@ Use the React widget for drop-in integration, or the JS, Swift and Kotlin SDKs f Use IDKit to request a proof and verify it on your backend: follow this guide for one-time checks, or use [session proofs](/world-id/idkit/session-proofs) for returning users. -
- IDKit integration flow: your app sends a proof request to World App, receives a ZK proof, forwards it to your backend, and the backend verifies it with the World ID Developer Portal -
+```mermaid +sequenceDiagram + accTitle: Verify a proof from the World ID app + accDescr: IDKit requests a proof from the World ID app. Your app sends the complete proof to your backend, which verifies it through the Developer Portal. + participant Client as Your app (IDKit) + participant Identity as World ID app + participant Backend as Your backend + participant Portal as Developer Portal + + Client->>Identity: Request a proof + Identity-->>Client: World ID proof + Client->>Backend: Send the complete proof + Backend->>Portal: Verify the proof + Portal-->>Backend: Verification result +``` -Four components are involved: your **client** (where IDKit runs), your **backend** (which signs requests and verifies proofs), the **World ID App** (on the user's device) and the **Developer Portal** (which validates proofs on-chain). The steps below cover each one. +Four components are involved: your **client** (where IDKit runs), your **backend** (which signs requests and verifies proofs), the **World ID app** (on the user's device) and the **Developer Portal** (which validates proofs on-chain). The steps below cover each one. # Step 1: Install IDKit diff --git a/world-id/idkit/javascript.mdx b/world-id/idkit/javascript.mdx index 03d8ce66..def4e056 100644 --- a/world-id/idkit/javascript.mdx +++ b/world-id/idkit/javascript.mdx @@ -101,8 +101,8 @@ if (!completion.success) { ``` - When running inside World App, native transport is used and `connectorURI` may be empty. - Outside World App, `connectorURI` is the URL you render as a QR code. + When running inside World Money, native transport is used and `connectorURI` may be empty. + Outside World Money, `connectorURI` is the URL you render as a QR code. ## Debug report @@ -119,7 +119,7 @@ if (!completion.success) { } ``` -`IDKitDebugReport` fields: `version`, `package_version`, `transport` (`"bridge" | "mini_app"`), `generated_at`, and optional `request_id`, `request_payload`, `response_payload`, and `mini_app` (`MiniAppDebugInfo`). For bridge transport `response_payload` is the decrypted plaintext response string once the request completes; for native (`mini_app`) transport it is a structured debug object. The `mini_app` object holds World App native-transport diagnostics: `verify_version`, `platform`, `send_channel`, `minikit_subscribed`, and `response_channel`. +`IDKitDebugReport` fields: `version`, `package_version`, `transport` (`"bridge" | "mini_app"`), `generated_at`, and optional `request_id`, `request_payload`, `response_payload`, and `mini_app` (`MiniAppDebugInfo`). For bridge transport `response_payload` is the decrypted plaintext response string once the request completes; for native (`mini_app`) transport it is a structured debug object. The `mini_app` object holds World Money native-transport diagnostics: `verify_version`, `platform`, `send_channel`, `minikit_subscribed`, and `response_channel`. `setDebug(true)` (or `window.IDKIT_DEBUG = true`) and `isDebug()` toggle verbose `console.debug` logging. This is separate from `getDebugReport()`, which works regardless. diff --git a/world-id/idkit/mini-apps.mdx b/world-id/idkit/mini-apps.mdx index 0c797e09..aadff6bd 100644 --- a/world-id/idkit/mini-apps.mdx +++ b/world-id/idkit/mini-apps.mdx @@ -9,7 +9,7 @@ description: "Add World ID verification to a Mini App with IDKit, which uses the IDKit is the verification layer for Mini Apps. MiniKit handles native Mini App commands such as wallet auth, payments, transactions, sharing, and permissions. World ID verification, including Selfie Check, is implemented with `@worldcoin/idkit`. -Inside World App, IDKit uses the native World App transport — no QR code is shown. The same widget also works outside World App, where it falls back to the normal connect URL and QR experience. Your backend responsibilities do not change: sign each request server-side, verify the proof server-side, and store nullifiers for replay protection. +Inside World Money, IDKit uses the native World Money transport — no QR code is shown. The same widget also works outside World Money, where it falls back to the normal connect URL and QR experience. Your backend responsibilities do not change: sign each request server-side, verify the proof server-side, and store nullifiers for replay protection. If you are migrating from MiniKit 1.x, replace `MiniKit.verify(...)` or @@ -30,8 +30,8 @@ The integration is the standard IDKit flow — follow the [Integrate IDKit](/wor The Mini-App-specific details: - **Separate app IDs.** If your Mini App and World ID integration use separate Developer Portal apps, MiniKit initialization uses the Mini App `app_id`, while IDKit uses the World ID `app_id`, `rp_id`, action, and signing key. -- **No transport configuration needed.** IDKit detects World App and uses the native transport automatically. -- **Standalone websites work too.** If your Mini App also runs as a regular website, the same widget handles browser users. For iOS install-continuation flows outside World App, see [invite-code mode](/world-id/idkit/verification-flows#with-invite-code-mode). +- **No transport configuration needed.** IDKit detects World Money and uses the native transport automatically. +- **Standalone websites work too.** If your Mini App also runs as a regular website, the same widget handles browser users. For standalone iOS users who need to install the World ID app, see [invite-code mode](/world-id/idkit/verification-flows#with-invite-code-mode). ## Choose a verification level @@ -65,7 +65,7 @@ This is the same widget from [Step 4 of the integration guide](/world-id/idkit/i // Unlock the protected Mini App experience here. }} onError={(errorCode, debugReport) => { - // Inside World App, debugReport?.transport is "mini_app". + // Inside World Money, debugReport?.transport is "mini_app". console.error("IDKit error", errorCode, debugReport); }} /> diff --git a/world-id/idkit/react-native.mdx b/world-id/idkit/react-native.mdx index 35f709c2..e6de7688 100644 --- a/world-id/idkit/react-native.mdx +++ b/world-id/idkit/react-native.mdx @@ -61,10 +61,10 @@ export function VerificationScreen({ rpContext }: { rpContext: RpContext }) { {flow.connectorURI && !flow.result && !flow.isError && (
invalid_networkEnvironment mismatch between app config and World App context.Environment mismatch between app configuration and the verification environment. Align staging/production settings.
failed_by_host_appWorld App returned a proof, but the host app's handleVerify callback threw or rejected it.IDKit received a proof, but the host app's handleVerify callback threw or rejected it. Inspect the callback and backend verification response. Do not use this code alone to decide whether the issue is in the integration or credential availability.