# Overview (/docs/sdks/nextjs)

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]

Install the SDK using your package manager:

```npm title="Terminal"
npm install @monocloud/auth-nextjs
```

View the source on GitHub: [monocloud/auth-js](https://github.com/monocloud/auth-js)

## Get started quickly [#get-started-quickly]

Start with a quickstart to see MonoCloud in action:

- [Next.js App Router Quickstart](/docs/quickstarts/nextjs-app-router)
- [Next.js Pages Router Quickstart](/docs/quickstarts/nextjs-page-router)

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 [#before-you-continue]

To integrate MonoCloud into your own app:

1. Follow the [installation and configuration guide](/docs/sdks/nextjs/installation).
1. 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 [#app-router-guides]

For applications using the **Next.js App Router**:

- [Protect server components](/docs/sdks/nextjs/app-router/protect-server-components)
- [Protect client components](/docs/sdks/nextjs/app-router/protect-client-components)
- [Protect API routes](/docs/sdks/nextjs/app-router/protect-api-routes)
- [Protect server actions](/docs/sdks/nextjs/app-router/protect-server-actions)

## Pages Router guides [#pages-router-guides]

For applications using the **Next.js Pages Router**:

- [Protect server rendered pages](/docs/sdks/nextjs/page-router/protect-ssr-page)
- [Protect client rendered pages](/docs/sdks/nextjs/page-router/protect-csr-page)
- [Protect API routes](/docs/sdks/nextjs/page-router/protect-api-route)

## API Reference [#api-reference]

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

- [Next.js SDK API Reference](https://monocloud.github.io/auth-js/modules/_monocloud_auth-nextjs.html)
