Sign in

Overview

MonoCloud’s Next.js SDK lets you add authentication to your Next.js application.

Use it to:

  • Authenticate users
  • Protect pages, API routes, and server actions
  • Access the signed-in user from server and client code

The SDK supports both App Router and Pages Router applications.

Install the SDK

Install the SDK using your package manager:

Terminal
npm install @monocloud/auth-nextjs

View the source on GitHub: monocloud/auth-js

Get started quickly

Start with a quickstart to see MonoCloud in action:

Each quickstart walks you from a new Next.js app to a working sign-in flow, including authentication, middleware setup, and protected routes.

Before you continue

To integrate MonoCloud into your own app:

  1. Follow the installation and configuration guide.

  2. Choose the guides that match your routing setup to secure different parts of your app.

    These guides show how to:

    • Configure authentication and middleware
    • Protect pages, components, APIs, and server actions
    • Access the signed-in user on the server and client

App Router guides

For applications using the Next.js App Router:

Pages Router guides

For applications using the Next.js Pages Router:

API Reference

View all exported functions, hooks, components, and types:

© 2024 MonoCloud. All rights reserved.