Skip to content
Avatar of redis-developerredis-developer/session-store-nextjs

Next.js Redis Session Store

This Next.js template demonstrates how to use Redis as a session store for app auth using multiple providers like GitHub and Discord.

Framework
Use Case
Database
redis-template-thumbnail

🚀 Next.js Redis Session Store Example

This Next.js project demonstrates how to use Redis as a session store for authentication. The application supports multiple authentication providers, offering a scalable and performant solution for your web applications.

📋 Table of Contents

  • 🚀 Deploy with Redis Cloud on Vercel
  • ✨ Features
  • 🌱 Getting Started
  • 🛠️ Configuration
  • 💾 Session Management with Redis
  • 🗂️ Project Structure
  • 📜 Available Scripts
  • 📚 Learn More
  • 🤝 Contributing
  • 📄 License

🚀 Deploy with Redis Cloud on Vercel

Follow these steps to deploy your application with Redis Cloud on Vercel:

  1. Click the "Deploy" button below to start the deployment process:
  1. In the Vercel UI, create a new repository for your project.

  1. Add Redis as a store in the Vercel UI. This will automatically set your REDIS_URL environment variable.

  1. Wait for the deployment to complete.

  1. Once deployed, use the URL of your deployed app to set up the authentication providers. See the Configuration section below for detailed instructions for setting these up. By default, the template is configured to use GitHub and Discord. Only one provider is required.

✨ Features

  • 🗄️ Redis Session Store: Utilizes Redis for storing session data
  • 🔐 NextAuth.js Integration: Implements authentication using NextAuth.js with a custom Redis adapter
  • 🌐 Multiple Authentication Providers: Supports GitHub and Discord authentication
  • ⚙️ Dynamic Configuration: Easily enable or disable authentication providers via environment variables

🌱 Getting Started

  1. Install dependencies:

    npm install
    # or
    yarn install
    # or
    pnpm install
  2. Run the development server:

    npm run dev
    # or
    yarn dev
    # or
    pnpm dev
  3. Open http://localhost:3000 in your browser to see the application.

🛠️ Configuration

Setting Up Redis

Ensure you have a Redis server running and configure the connection in your .env file:

redis-template-thumbnail
Avatar of redis-developerredis-developer/session-store-nextjs

Next.js Redis Session Store

This Next.js template demonstrates how to use Redis as a session store for app auth using multiple providers like GitHub and Discord.

Framework
Use Case
Database

🚀 Next.js Redis Session Store Example

This Next.js project demonstrates how to use Redis as a session store for authentication. The application supports multiple authentication providers, offering a scalable and performant solution for your web applications.

📋 Table of Contents

  • 🚀 Deploy with Redis Cloud on Vercel
  • ✨ Features
  • 🌱 Getting Started
  • 🛠️ Configuration
  • 💾 Session Management with Redis
  • 🗂️ Project Structure
  • 📜 Available Scripts
  • 📚 Learn More
  • 🤝 Contributing
  • 📄 License

🚀 Deploy with Redis Cloud on Vercel

Follow these steps to deploy your application with Redis Cloud on Vercel:

  1. Click the "Deploy" button below to start the deployment process:
  1. In the Vercel UI, create a new repository for your project.

  1. Add Redis as a store in the Vercel UI. This will automatically set your REDIS_URL environment variable.

  1. Wait for the deployment to complete.

  1. Once deployed, use the URL of your deployed app to set up the authentication providers. See the Configuration section below for detailed instructions for setting these up. By default, the template is configured to use GitHub and Discord. Only one provider is required.

✨ Features

  • 🗄️ Redis Session Store: Utilizes Redis for storing session data
  • 🔐 NextAuth.js Integration: Implements authentication using NextAuth.js with a custom Redis adapter
  • 🌐 Multiple Authentication Providers: Supports GitHub and Discord authentication
  • ⚙️ Dynamic Configuration: Easily enable or disable authentication providers via environment variables

🌱 Getting Started

  1. Install dependencies:

    npm install
    # or
    yarn install
    # or
    pnpm install
  2. Run the development server:

    npm run dev
    # or
    yarn dev
    # or
    pnpm dev
  3. Open http://localhost:3000 in your browser to see the application.

🛠️ Configuration

Setting Up Redis

Ensure you have a Redis server running and configure the connection in your .env file:

Unleash New Possibilities

Deploy your app on Vercel and unlock its full potential