Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] Default SIWE Handlers #2198

Open
wslyvh opened this issue Apr 29, 2024 · 1 comment
Open

[feature] Default SIWE Handlers #2198

wslyvh opened this issue Apr 29, 2024 · 1 comment

Comments

@wslyvh
Copy link

wslyvh commented Apr 29, 2024

What problem does this new feature solve?

The documentation on SIWE is very limited and incomplete.
i.e. it's unclear from just the docs on how to set up SIWE and lacks a proper step-by-step guide.
https://docs.walletconnect.com/web3modal/nextjs/siwe/about

I also think it's unnecessary to copy/paste most of the documented functions as they could be provided out of the box by the W3M packages.

Describe the solution you'd like

I'd love to see a default (Next.js) SIWE implementation that can be referenced to reduce the amount of code/steps required to set up in my own codebase.

I think what's needed is and could be included in W3M:

  1. allow to create a SIWEClientConfig (to configure the API routes)
  2. allow to create a SIWEServerConfig (to configure iron-session, cookie name and password)
  3. the generic handler implementation

The handlers should include a default implementation for the interface as described on
https://docs.walletconnect.com/web3modal/nextjs/siwe/about#siwe-config-parameters

From an App perspective, you'd then only have to configure a client/server config and import the default W3M handler at a dynamic route (e.g. /api/siwe/[...route].ts)
https://nextjs.org/docs/pages/building-your-application/routing/dynamic-routes

ConnectKit has a great example, and I would love to see something similar in W3M
https://docs.family.co/connectkit/auth-with-nextjs#example

Copy link

linear bot commented Apr 29, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant