This is a next.js experiment that generates end-of-2022 stats for a team using the Figma API. Try it at https://wrapped.jamiemill.com
It will build a page a bit like this:
- Create an App at https://figma.com/developers, give it a name
- Set the callback to
http://localhost:3000/callback
. - Save the client ID and secret.
- Create a
.env.local
file at the root of this project that looks like:
NEXT_PUBLIC_OAUTH_CLIENT_ID=XXXXXXX
NEXT_PUBLIC_OAUTH_CALLBACK=http://localhost:3000/callback
OAUTH_CLIENT_SECRET=ZZZZZZZ
NEXT_PUBLIC_USE_STUBS=false
- Then run
npm run dev
to develop locally.
If you set NEXT_PUBLIC_USE_STUBS=true
you'll get a largeish volume of randomly
generated data to test with locally.
Set the same environment variables on Vercel that you see in the file above, changing localhost to the domain of the deployment.
Don't forget to add an additional callback in the client app setup on figma.com/developers that points to the deployed callback URL.