next-api-layerNext API Layer
DocumentationAPI ReferenceExamples
next-api-layerNext API Layer

Production-grade API layer for Next.js with external JWT backends.

Documentation

  • Introduction
  • Installation
  • Quick Start
  • API Reference

Resources

  • Examples
  • Proxy
  • API Client
  • AuthProvider

Community

  • GitHub
  • Issues
  • Discussions
  • Contact

© 2026 Next API Layer. All rights reserved.

Created by
Documentation

Getting Started

  • Introduction
  • Installation
  • Quick Start

Core Concepts

  • How It Works
  • Token Management
  • Guest Tokens

Configuration

  • Auth Proxy
  • Proxy Handler
  • API Client
  • Security
  • i18n Integration

Client Side

  • AuthProvider
  • useAuth Hook

API Reference

  • API Reference
  • Types

Examples

  • Examples
  • Authentication Patterns
  • Role-Based Access
  • API Routes
  • Forms
  • Data Fetching
Changelog

Getting Started

  • Introduction
  • Installation
  • Quick Start

Core Concepts

  • How It Works
  • Token Management
  • Guest Tokens

Configuration

  • Auth Proxy
  • Proxy Handler
  • API Client
  • Security
  • i18n Integration

Client Side

  • AuthProvider
  • useAuth Hook

API Reference

  • API Reference
  • Types

Examples

  • Examples
  • Authentication Patterns
  • Role-Based Access
  • API Routes
  • Forms
  • Data Fetching
Changelog

Installation

Prerequisites#

  • Next.js 14+ (App Router)
  • React 18+
  • TypeScript (recommended)

Install the Package#

Terminal
Loading...

Or with other package managers:

Terminal
Loading...

Optional Peer Dependencies#

If you plan to use the client-side features (AuthProvider, useAuth hook), you'll also need SWR:

Terminal
Loading...

If you need internationalization support:

Terminal
Loading...

Environment Setup#

Create or update your .env.local file:

Terminal
Loading...

TypeScript Configuration#

The library ships with TypeScript definitions. No additional setup needed.

If you want to extend the types, you can augment them:

TypeScript
Loading...

Verify Installation#

Create a simple test file to verify the installation:

TypeScript
Loading...

Run it:

Terminal
Loading...

Next Steps#

  • Quick Start - Set up your first proxy
  • Configuration - Customize the behavior