Working example
Sign in with Privy
Sign in once, connect the wallet you want to use, and watch the selection arrive without replacing this page.
Nothing on this page asks you to approve a transaction or sign a message.
Account and wallet
- Status
- Signed out
- Account
- Sign In
- Wallet in use
- No wallet selected
Signing in and having a wallet ready to send are two separate steps. Disconnect in the header clears the wallet shown here.
Set up your own copy
- In your Privy dashboard, turn on wallet sign-in and add your site's exact web address to the allowed list.
-
Give your copy of the site its Privy app ID and verification key, named
PRIVY_APP_IDandPRIVY_VERIFICATION_KEY. Keep the Privy app secret off the page people load. -
Create your database, then prepare sign-in with the command
mix ash_template.setup_local_auth. -
Start the site with the commands
mix assets.buildandmix phx.server, then open this page.
What each part does
- The sign-in button in the header, the same on every page.
- One small script that hears every sign-in button press and keeps the page and the site in step.
- The Privy connection: signing in, choosing a wallet and signing out.
- This page's wallet readout, which only watches and never signs anyone in.
- The site's own record of who is signed in. A wallet address in the browser never proves who you are.
The look comes from Regent's shared design kit, and the sign-in check comes from a shared Regent library. The Privy connection shown here belongs to this site.
Privy's guide to signing out ↗