Sign up your first user in 5 minutes
http://localhost:3000
and click "Add origin".Next, check the scopes labeled users.create
.Check the "JWT Auth" box.Finally, create your key and save it for subsequent steps.Create a new Next.js application
create-next-app
package to get started:y
and Enter
to proceed:Name your app `my-first-auth-app` and accept the default options
Change into the directory created in previous steps
Install the Crossmint React SDK
Add a new file named `.env.local` to root directory of your project
Prepare auth page
app/page.tsx
, delete the contents, and leave a minimal page, for next steps.Configure Crossmint Auth in Layout
app/providers/Providers.tsx
and add the following code:app/layout.tsx
and update it to use the new Providers component:Providers
component wraps your application with both CrossmintProvider
and CrossmintAuthProvider
, configuring the
Crossmint SDK and auth.Add login and logout functionality
page.tsx
file, below the "use client";
directive:useAuth
hook to
manage authentication state and provides buttons for logging in and out.AuthButton
component inside your Home
component.