Note Archiving this app. Patterns have been superseded by artsy/forque
A proof-of-concept Next.js app that can:
- Authenticate with Gravity and create a user session
- Support two-factor authentication
- Support Vercel's SWR for data fetching with caching, deduping, revalidating etc
- Provide custom hooks (useGravity, useMetaphysics) to further simplify data fetching from Artsy sources
- Render some sample pages using data from Gravity and Metaphysics
➽ See the step-by-step commit history to see how this was put together
You may use this app as a starting point for your own Next app by using the yarn create
command as follows:
yarn create next-app my-artsy-nextjs-app --example https:/anandaroop/nextjs-artsy-auth
cp .env.local.example .env.local
This uses the create-next-app
command to create a new Next.js app, configured the same was as this one. You need only update .env.local
with credentials for a valid Gravity ClientApplication
.