This example demonstrates how to add user accounts to any Next.js 14 app using Reflow Auth.
The app features a simple registration/sign in flow using either email and password or a social provider account. When signed in, users can view their profile information and make changes to their username and profile image.
You can view a live demo here - https://nextjs-how-to-add-users-demo.vercel.app/
To run the example, follow these steps
npm install
the dependencies in this folder- Create a file named
.env.local
and fill out the following environment variables:
REFLOW_PROJECT_ID
- The ID of your Reflow project, required for using the library. You can obtain it from your Reflow project's settings page.SESSION_SECRET
- This is a secret string that will be used for encrypting user sessions. You can enter any random 32 char string or runopenssl rand -hex 16
in the terminal to generate a secret key.
- Start the development server with
npm run dev
- Open http://localhost:3000 with your browser to see the app running.