Skip to content

Latest commit

 

History

History

with-nextauth-credentials

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Hygraph ⨯ NextAuth.js

Join our Slack

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

Deploy with Vercel Clone project

How to Use

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=somethingsupersecret

You 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.

Download Manually

npx degit hygraph/hygraph-examples/with-nextauth-credentials with-nextauth-credentials

Install & Run:

cd with-nextauth-credentials
npm install
npm run dev
# or
cd with-nextauth-credentials
yarn
yarn dev

Run on Codesandbox

Develop with Codesandbox