Skip to content

feat(nextjs-example): allow reordering multi-credential requests - #368

Merged
Takaros999 merged 1 commit into
mainfrom
feat/nextjs-credential-order
Nov 23, 2026
Merged

Takaros999 merged 1 commit into
mainfrom
feat/nextjs-credential-order

Conversation

@evlaryutina-test

@evlaryutina-test evlaryutina-test commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

The Next.js demo currently forces multiple credentials into a fixed PoH/Selfie/Passport/MNC order, so testers cannot try a different order in enumerate (or any/all) requests.

Add accessible up/down controls for selected credentials. For example, moving Selfie above PoH now produces enumerate: [selfie, proof_of_human] in both the JSON preview and the widget request. Newly selected credentials are appended, and shared configurations preserve their selected order. Request and session flows use the same order-preserving helper; default selections and credential options are unchanged.

Changes are limited to the Next.js example, its README, and regression tests. SDK and API implementations are untouched.

Validation:

  • Next.js production build and type validation passed on Node 24.
  • 7 new example regression tests passed (all combinators, share-state normalization, default payload, session genesis/no signal).
  • Core: 235 tests passed; React: 65 passed; server: 93 passed.
  • Nullifier exports passed for ESM, CommonJS and browser; formatting and diff checks passed.
  • Browser smoke test: moved Selfie before PoH, added Passport, verified the ordered enumerate JSON.
  • 694 Rust differential cases were skipped locally because the native conformance binary was not built; repository CI includes those checks.

Manual review: choose World ID 4.0 → Multiple credentials → Enumerate; use the arrows, confirm preview order, and repeat in Session flow. Share and reopen the configuration to check the saved order.


Note

Low Risk
Changes are confined to the Next.js example app, styling, README, and tests; no SDK or production API behavior is modified.

Overview
The Next.js World ID 4.0 demo no longer pins Multiple credentials to a fixed PoH → Selfie → Passport → MNC order. Credential order ↑/↓ controls let testers reorder the selection; new checkboxes append at the end, and that order flows through the constraints JSON preview, widget requests, session constraints, and shared config links.

normalizeMultiCredentials and buildMultiConstraints in multi-constraints.ts now preserve user order (dedupe and filter unknown types only) instead of re-sorting to canonical priority—important for any priority and enumerate ordering. The example README documents the UI and adds a pnpm test regression suite (node --test) covering order preservation across combinators, shared-state normalization, and session genesis options.

Reviewed by Cursor Bugbot for commit e51004f. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel

vercel Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
idkit-js-example Ready Ready Preview Nov 18, 2026 12:26pm UTC

Request Review

@Takaros999
Takaros999 merged commit 789ad41 into main Nov 23, 2026
23 of 24 checks passed
@Takaros999
Takaros999 deleted the feat/nextjs-credential-order branch November 23, 2026 14:11

This branch was successfully deployed

1 active deployment
Preview — e51004fe Deployed Nov 18, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants