@inertiapixel/react-auth
TypeScript icon, indicating that this package has built-in type declarations

1.1.18 • Public • Published

InertiaPixel React/NextJs Auth Library

InertiaPixel Auth

react-auth

Authentication library for React and Next.js. Supports credential and social login, JWT token handling, and context-based auth state — built for scalable, multi-project use.

🚀 Installation

Install the package via npm:

npm install @inertiapixel/react-auth

🚀 Features

  • ✅ Easy setup with AuthProvider
  • 🔒 JWT-based authentication
  • 🔑 Supports:
    • Credentials login (email + password)
  • 🧠 Context-driven auth state
  • 📦 Built-in utilities like useAuth, Protect, SignedIn, SignedOut
  • 🧪 Type-safe API (written in TypeScript)
  • ⚙️ Plug-and-play for scalable projects

🛠️ Basic Usage

1. Wrap your App with AuthProvider

// pages/_app.tsx
import { AuthProvider, SignedIn, SignedOut } from '@inertiapixel/react-auth'
import type { AppProps } from 'next/app'

export default function MyApp({ Component, pageProps }: AppProps) {
  return (
    <AuthProvider config={{ tokenKey: 'token', redirectTo: '/' }}>
      <SignedIn>
        <Component {...pageProps} />
      </SignedIn>
      <SignedOut>
        <p>Please sign in</p>
      </SignedOut>
    </AuthProvider>
  )
}

Authors

Website

🔗 www.inertiapixel.com/

License

This icon set is free and open-source under the MIT License.
See the full license here.

Crafted in India by InertiaPixel

Package Sidebar

Install

npm i @inertiapixel/react-auth

Weekly Downloads

3

Version

1.1.18

License

MIT

Unpacked Size

28.3 kB

Total Files

43

Last publish

Collaborators

  • mdasiff007