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.
Install the package via npm:
npm install @inertiapixel/react-auth
- ✅ 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
// 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>
)
}
- Md Asif - LinkedIn
This icon set is free and open-source under the MIT License.
See the full license here.
Crafted in India by InertiaPixel