Back to Next Js

SuperTokens App with Next.js app directory

examples/with-supertokens/README.md

16.2.51.4 KB
Original Source

SuperTokens App with Next.js app directory

This is a simple application that is protected by SuperTokens. This app uses the Next.js app directory.

How to use

Using create-next-app

bash
npx create-next-app --example with-supertokens with-supertokens-app
bash
yarn create next-app --example with-supertokens with-supertokens-app
bash
pnpm create next-app --example with-supertokens with-supertokens-app

Using create-supertokens-app

  • Run the following command
bash
npx create-supertokens-app@latest --frontend=next
bash
yarn create-supertokens-app@latest --frontend=next
bash
pnpm create-supertokens-app@latest --frontend=next
  • Select the option to use the app directory

Follow the instructions after create-supertokens-app has finished

Notes

  • To know more about how this app works and to learn how to customise it based on your use cases refer to the SuperTokens Documentation
  • We have provided development OAuth keys for the various built-in third party providers in the /app/config/backend.ts file. Feel free to use them for development purposes, but please create your own keys for production use.