rsnext/examples/with-supertokens/README.md

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

43 lines
1.4 KiB
Markdown
Raw Permalink Normal View History

# SuperTokens App with Next.js app directory
2021-02-15 22:41:45 +01:00
This is a simple application that is protected by SuperTokens. This app uses the Next.js app directory.
2021-02-15 22:41:45 +01:00
## How to use
### Using `create-next-app`
- Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init), [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/), or [pnpm](https://pnpm.io) to bootstrap the example:
2021-02-15 22:41:45 +01:00
```bash
npx create-next-app --example with-supertokens with-supertokens-app
```
```bash
2021-02-15 22:41:45 +01:00
yarn create next-app --example with-supertokens with-supertokens-app
```
```bash
pnpm create next-app --example with-supertokens with-supertokens-app
2021-02-15 22:41:45 +01:00
```
- Run `yarn install`
- Run `npm run dev` to start the application on `http://localhost:3000`.
### Using `create-supertokens-app`
- Run the following command
```bash
npx create-supertokens-app@latest --frontend=next
```
- Select the option to use the app directory
Follow the instructions after `create-supertokens-app` has finished
2021-02-15 22:41:45 +01:00
## 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](https://supertokens.com/docs/guides)
- 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**.