
Security News
White House Authorizes Private Companies to Conduct Offensive Cyber Operations
A new federal program will let vetted U.S. cybersecurity firms help investigate and disrupt foreign cybercrime groups under government direction.
@insforge/react
Advanced tools
Framework-agnostic React authentication UI components for Insforge - reusable across all frameworks
Framework-agnostic authentication solution for React applications. Production-ready components with full business logic included.
✅ Framework Agnostic - Works with any React setup (Vite, CRA, or no bundler)
✅ Zero Router Dependencies - Use with any routing solution or none at all
✅ Production Ready - Complete auth flows with business logic included
✅ Full TypeScript - Complete type safety out of the box
Get authentication working in your React app in 5 minutes.
npm install @insforge/react
# or
yarn add @insforge/react
# or
pnpm add @insforge/react
Required Peer Dependencies:
npm install react@^19.0.0 react-dom@^19.0.0
# .env
VITE_INSFORGE_BASE_URL=https://your-project.insforge.app/
Wrap your app with InsforgeProvider:
// src/main.tsx (Vite) or src/index.tsx (CRA)
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import { InsforgeProvider } from '@insforge/react';
import App from './App';
createRoot(document.getElementById('root')!).render(
<StrictMode>
<InsforgeProvider baseUrl={import.meta.env.VITE_INSFORGE_BASE_URL} afterSignInUrl="/dashboard">
<App />
</InsforgeProvider>
</StrictMode>
);
Now you can use authentication components and hooks anywhere in your app:
// src/App.tsx
import { SignIn, SignedIn, SignedOut, UserButton, useAuth } from '@insforge/react';
export default function App() {
const { isSignedIn, isLoaded } = useAuth();
if (!isLoaded) {
return <div>Loading...</div>;
}
return (
<div>
<SignedOut>
<SignIn />
</SignedOut>
<SignedIn>
<nav>
<UserButton afterSignOutUrl="/" />
</nav>
<h1>Welcome to your dashboard!</h1>
</SignedIn>
</div>
);
}
That's it! 🎉 You now have production-ready authentication.
Use complete auth flows with built-in UI and logic:
import { SignIn, SignUp, ForgotPassword, ResetPassword } from '@insforge/react';
// In your app
<SignIn /> // Complete sign-in flow
<SignUp /> // Complete sign-up flow with email verification
<ForgotPassword /> // Password reset request + verification
<ResetPassword /> // Reset password with token (from URL params)
Use UI components and add your own logic:
import { SignInForm, useAuth } from '@insforge/react';
import { useState } from 'react';
function CustomSignIn() {
const { signIn } = useAuth();
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');
const [error, setError] = useState('');
const [loading, setLoading] = useState(false);
const handleSubmit = async (e) => {
e.preventDefault();
setLoading(true);
const result = await signIn(email, password);
if ('error' in result) {
setError(result.error);
}
setLoading(false);
};
return (
<SignInForm
email={email}
password={password}
onEmailChange={setEmail}
onPasswordChange={setPassword}
onSubmit={handleSubmit}
error={error}
loading={loading}
/>
);
}
Build completely custom UI using authentication hooks:
import { useAuth } from '@insforge/react';
function CustomAuthForm() {
const { signIn, signUp, isLoaded } = useAuth();
const handleLogin = async (email: string, password: string) => {
const result = await signIn(email, password);
if ('error' in result) {
console.error(result.error);
} else {
console.log('Signed in!');
}
};
return <form>...your custom UI...</form>;
}
Pre-built with Business Logic:
<SignIn /> - Complete sign-in with email/password & OAuth<SignUp /> - Registration with password validation & email verification<ForgotPassword /> - Request password reset with email validation<ResetPassword /> - Reset password with token validation<VerifyEmail /> - Verify email with automatic token handling<UserButton /> - User dropdown with sign-out<Protect /> - Route protection wrapper<SignedIn> / <SignedOut> - Conditional renderingForm Components (Pure UI):
<SignInForm /> - Sign-in UI without logic<SignUpForm /> - Sign-up UI without logic<ForgotPasswordForm /> - Password reset request UI<ResetPasswordForm /> - Password reset with token UI<VerifyEmailStatus /> - Email verification status UIAtomic Components (14 total):
<AuthContainer />, <AuthHeader />, <AuthFormField />, <AuthPasswordField />, <AuthEmailVerificationStep />, etc.const { signIn, signUp, signOut, isSignedIn, isLoaded } = useAuth();
const { user, updateUser, isLoaded } = useUser();
const { oauthProviders, authConfig, isLoaded } = usePublicAuthConfig();
All components support full text customization:
<SignIn
title="Welcome Back!"
subtitle="We're happy to see you again"
emailLabel="Your Email Address"
emailPlaceholder="you@company.com"
passwordLabel="Your Password"
submitButtonText="Login Now"
loadingButtonText="Signing you in..."
signUpText="New to our platform?"
signUpLinkText="Create an account"
dividerText="or continue with"
/>
<ForgotPassword
title="Reset Your Password"
subtitle="Enter your email to receive a reset code"
emailLabel="Email Address"
submitButtonText="Send Reset Code"
backToSignInText="Remember your password?"
successTitle="Check Your Email"
successMessage="We've sent a reset code to your inbox"
/>
Control what users see based on auth state:
import { SignedIn, SignedOut, Protect } from '@insforge/react';
function App() {
return (
<>
<SignedOut>
<SignIn />
</SignedOut>
<SignedIn>
<Dashboard />
</SignedIn>
{/* Or use Protect for specific sections */}
<Protect redirectTo="/sign-in">
<ProtectedContent />
</Protect>
</>
);
}
import {
AuthContainer,
AuthHeader,
AuthFormField,
AuthPasswordField,
AuthSubmitButton,
AuthErrorBanner,
AuthDivider,
AuthOAuthProviders,
AuthLink,
} from '@insforge/react';
function CompletelyCustomAuth() {
return (
<AuthContainer>
<AuthHeader title="Welcome to MyApp" subtitle="Sign in to continue" />
<AuthErrorBanner error={error} />
<form onSubmit={handleSubmit}>
<AuthFormField
id="email"
type="email"
label="Email"
value={email}
onChange={(e) => setEmail(e.target.value)}
/>
<AuthPasswordField
id="password"
label="Password"
value={password}
onChange={(e) => setPassword(e.target.value)}
authConfig={config}
showStrengthIndicator
/>
<AuthSubmitButton isLoading={loading}>Sign In</AuthSubmitButton>
</form>
<AuthDivider text="or" />
<AuthOAuthProviders
providers={['google', 'github', 'discord']}
onClick={handleOAuth}
loading={oauthLoading}
/>
<AuthLink text="Don't have an account?" linkText="Sign up" href="/sign-up" />
</AuthContainer>
);
}
Protect specific content or sections:
import { Protect } from '@insforge/react';
function Dashboard() {
return (
<div>
<h1>Dashboard</h1>
{/* Simple protection - shows nothing if not signed in */}
<Protect>
<UserContent />
</Protect>
{/* Custom condition - e.g., role-based */}
<Protect condition={(user) => user.email.endsWith('@admin.com')}>
<AdminPanel />
</Protect>
</div>
);
}
Note:
<Protect>is for conditional rendering only. For route-level protection, use your router's authentication guards withuseAuth()hook.
Built-in support for 10+ OAuth providers:
Providers are auto-detected from your backend configuration.
Low-level building blocks for complete customization:
<AuthBranding /> - Insforge branding footer<AuthContainer /> - Main container wrapper<AuthHeader /> - Title and subtitle display<AuthErrorBanner /> - Error message display<AuthFormField /> - Standard input field<AuthPasswordField /> - Password input with features<AuthPasswordStrengthIndicator /> - Password checklist<AuthSubmitButton /> - Submit button with states<AuthLink /> - Call-to-action link<AuthDivider /> - Visual separator<AuthOAuthButton /> - Single OAuth provider button<AuthOAuthProviders /> - Smart OAuth grid<AuthVerificationCodeInput /> - 6-digit OTP input<AuthEmailVerificationStep /> - Email verification step with countdown and resendFor Next.js App Router with full SSR support:
npm install @insforge/nextjs
See @insforge/nextjs documentation
MIT © Insforge
FAQs
Framework-agnostic React authentication UI components for Insforge - reusable across all frameworks
The npm package @insforge/react receives a total of 535 weekly downloads. As such, @insforge/react popularity was classified as not popular.
We found that @insforge/react demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
A new federal program will let vetted U.S. cybersecurity firms help investigate and disrupt foreign cybercrime groups under government direction.

Research
/Security News
The campaign amassed more than 75,000 installs by targeting Russian-speaking users seeking access to blocked services.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.