This example demonstrates how to query from Hygraph NextAuth.js.
Users can login or register using the same form (for the purposes of this demo), and update their profile name/bio.
NextAuth.js has a REST API you should use to create custom login pages.
• Demo
You will need to create a Permanent Auth Token to use this example locally.
Inside of .env add the following:
HYGRAPH_ENDPOINT=
HYGRAPH_TOKEN=
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=somethingsupersecretYou will need to set NEXTAUTH_URL as your actual URL if deploying.
You will also need to follow instructions here to configure the models this project needs to work.
npx degit hygraph/hygraph-examples/with-nextauth-credentials with-nextauth-credentialsInstall & Run:
cd with-nextauth-credentials
npm install
npm run dev
# or
cd with-nextauth-credentials
yarn
yarn dev