Skip to content

Added shareable config links that maintain selected settings#280

Merged
soamdesai-tfh merged 1 commit into
worldcoin:mainfrom
soamdesai-tfh:feat/shareable-config-links
Jun 11, 2026
Merged

Added shareable config links that maintain selected settings#280
soamdesai-tfh merged 1 commit into
worldcoin:mainfrom
soamdesai-tfh:feat/shareable-config-links

Conversation

@soamdesai-tfh

@soamdesai-tfh soamdesai-tfh commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds opaque shareable config links to the main Next.js example.
  • Shared links restore the selected scenario and collapse Configuration by default.
  • Normal visits keep Configuration open.
  • Share config copies the current live controls without mutating the address bar.

Test Plan

  • Verified default / keeps Configuration open with no modal.
  • Verified shared ?config=... restores state, stays collapsed, and does not auto-open modal.
  • Verified invalid config does not crash.
  • Verified next build passes.

Note

Low Risk
Changes are confined to the Next.js example UI and client-side URL encoding; no auth, APIs, or production SDK behavior.

Overview
Adds shareable configuration links to the Next.js IDKit demo so teammates can reproduce the same widget scenario without re-tuning every control.

Share config serializes the current UI state (flow mode, environment, credentials, identity attributes, staging overrides, etc.) into a versioned JSON blob, base64url-encodes it, and builds a ?config=… URL. Copy uses the Clipboard API with a textarea fallback; if copy fails, a read-only URL field is shown. Sharing does not change the browser address bar—only the copied link carries the token.

Opening a link with a valid config query param hydrates all matching React state via normalizeSharedDemoState (typed coercion, length limits, and the same cross-field rules as the live UI), then collapses the Configuration panel. Invalid or malformed tokens show an error and leave Configuration expanded. A Hide/Show toggle controls panel visibility on normal visits (expanded by default).

Styling adds a Configuration header row (title, status, actions), collapsed-panel behavior, share status/error text, and mobile layout tweaks in globals.css.

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

@vercel

vercel Bot commented Jun 9, 2026

Copy link
Copy Markdown

@soamdesai-tfh is attempting to deploy a commit to the Worldcoin Team on Vercel.

A member of the Team first needs to authorize it.

@vercel

vercel Bot commented Jun 9, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
idkit-js-example Ready Ready Preview, Comment Jun 9, 2026 3:56pm

Request Review

nationality: { enabled: false, value: "" },
};

type SharedDemoState = {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: this file is getting very bloated can we split this logic into a separate file?

@soamdesai-tfh soamdesai-tfh merged commit d69ca86 into worldcoin:main Jun 11, 2026
15 checks passed
@soamdesai-tfh soamdesai-tfh deleted the feat/shareable-config-links branch June 11, 2026 01:51
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