Skip to content

feat: Make react hook and widget MiniKit compatible#173

Merged
Takaros999 merged 7 commits into
mainfrom
takis/make-widget-minikit-compatible
Mar 14, 2026
Merged

feat: Make react hook and widget MiniKit compatible#173
Takaros999 merged 7 commits into
mainfrom
takis/make-widget-minikit-compatible

Conversation

@Takaros999
Copy link
Copy Markdown
Contributor

@Takaros999 Takaros999 commented Mar 13, 2026

Seamless DevEx to migrate from Minikit to IDKit, plug and play the widget or hook:

Hook usage:

  const { open, result, isInWorldApp, connectorURI } = useIDKitRequest({
    app_id: "app_xxx",               
    action: "verify",  
    // ... 
  });

  // connectorURI is null in World App (no QR needed)
  // isInWorldApp is true when running inside World App

Widget usage:

  // Works in both contexts with zero config changes
  <IDKitRequestWidget
    open={open}
    onOpenChange={setOpen}
    handleVerify={(result) => { /* called in both contexts */ }}
    onSuccess={(result) => { /* called in both contexts */ }}
    onError={(code) => { /* called in both contexts */ }}
    {...config}
  />
ScreenRecording_03-13-2026.11-32-24_1.MP4

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 13, 2026

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

Project Deployment Actions Updated (UTC)
idkit-js-example Ready Ready Preview, Comment Mar 13, 2026 11:41pm

Request Review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6e47735f63

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread js/packages/react/src/widget/IDKitRequestWidget.tsx Outdated
@Takaros999
Copy link
Copy Markdown
Contributor Author

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ae72ab6b0a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread js/packages/react/src/widget/IDKitRequestWidget.tsx Outdated
"react": "^18.3.1",
"react-dom": "^18.3.1"
"react-dom": "^18.3.1",
"viem": "^2.47.2"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

i needed this to make minikit work :/

@Takaros999 Takaros999 changed the title feat: Make react hook and widge MiniKit compatible feat: Make react hook and widget MiniKit compatible Mar 13, 2026
@Takaros999
Copy link
Copy Markdown
Contributor Author

@codex review

@Takaros999 Takaros999 marked this pull request as ready for review March 14, 2026 01:01
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c7595ed4ac

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

return () => {
cancelled = true;
};
}, [flow.isInWorldApp, isHostVerifying, flow.result, handleVerify]);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Prevent duplicate handleVerify calls in World App mode

In World App mode this effect re-runs whenever the handleVerify prop gets a new function identity, so a parent re-render during isHostVerifying can invoke host verification multiple times for the same flow.result. Because the cancelled flag only suppresses setHostVerifyResult and does not cancel the already-started promise, duplicate backend side effects (e.g., repeated verification submissions) are still triggered; this is especially likely when integrators pass inline callbacks as shown in the widget usage examples.

Useful? React with 👍 / 👎.

@Takaros999 Takaros999 merged commit 9c5311f into main Mar 14, 2026
16 checks passed
@Takaros999 Takaros999 deleted the takis/make-widget-minikit-compatible branch March 14, 2026 01:58
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