This example demonstrates how to use ConnectEmbed
component in Next.js to create a "Sign in" Page. Checkout the Live Demo
This template contains two examples
- Connecting a wallet using
ConnectEmbed
component - Connecting a wallet + Enforcing Authentication using
ConnectEmbed
component
-
Clone this repository locally and then install the dependencies using
npm install
oryarn install
-
Copy the
.env.example
file to.env.local
-
Create an API Key and get the client id and set the
NEXT_PUBLIC_TEMPLATE_CLIENT_ID
environment variable in the.env.local
fileNEXT_PUBLIC_TEMPLATE_CLIENT_ID=...
-
If you want to test the Example #2 ( Connect + Enforce Authentication ), You will need to set below mentioned environment variables in the
.env.local
file as well-
set the
THIRDWEB_AUTH_PRIVATE_KEY
to the admin private key you want to use for Auth -
Set
NEXT_PUBLIC_THIRDWEB_AUTH_DOMAIN
variable to the domain you want to use for Auth.THIRDWEB_AUTH_PRIVATE_KEY=... NEXT_PUBLIC_THIRDWEB_AUTH_DOMAIN=example.com
-
Run npm run dev
or yarn dev
to start the dev server
For any questions, suggestions, join our discord at https://discord.gg/thirdweb.