
Research
/Security News
737 Chrome VPN Extensions Linked to Brand Impersonation and Browser Traffic Redirection
The campaign amassed more than 75,000 installs by targeting Russian-speaking users seeking access to blocked services.
@insforge/react
Advanced tools
Framework-agnostic React authentication UI components for Insforge - reusable across all frameworks
Complete authentication solution for React applications. Production-ready components with full business logic included.
✅ 5-Minute Setup - One provider + one line of router config = done
✅ Built-in Auth UI - Use deployed auth pages (like Next.js middleware)
✅ Framework Agnostic - Works with any React framework
✅ Full TypeScript - Complete type safety out of the box
✅ Fully Customizable - Deep styling control when you need it
Get authentication working in your React app in 5 minutes.
npm install @insforge/react
# or
yarn add @insforge/react
# or
pnpm add @insforge/react
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 '@insforge/react/styles.css';
import App from './App';
createRoot(document.getElementById('root')!).render(
<StrictMode>
<InsforgeProvider baseUrl={import.meta.env.VITE_INSFORGE_BASE_URL}>
<App />
</InsforgeProvider>
</StrictMode>
);
// src/App.tsx
import { createBrowserRouter, RouterProvider } from 'react-router-dom';
import { getInsforgeRoutes } from '@insforge/react/router';
import Home from './pages/Home';
import Dashboard from './pages/Dashboard';
const router = createBrowserRouter([
{ path: '/', element: <Home /> },
...getInsforgeRoutes({
baseUrl: import.meta.env.VITE_INSFORGE_BASE_URL,
builtInAuth: true
}),
{ path: '/dashboard', element: <Dashboard /> }
]);
export default function App() {
return <RouterProvider router={router} />;
}
What this does:
/sign-in → Redirects to your-project.insforge.app/auth/sign-in/sign-up → Redirects to your-project.insforge.app/auth/sign-up/auth/callback → Goes to dashboard// src/pages/Home.tsx
import { SignedIn, SignedOut, UserButton } from '@insforge/react';
export default function Home() {
return (
<div>
<nav>
<SignedOut>
<a href="/sign-in">Sign In</a>
</SignedOut>
<SignedIn>
<UserButton afterSignOutUrl="/" />
</SignedIn>
</nav>
<h1>Welcome to My App!</h1>
</div>
);
}
That's it! 🎉 You now have production-ready authentication.
Uses your deployed Insforge auth pages:
...getInsforgeRoutes({
baseUrl: 'https://your-project.insforge.app',
builtInAuth: true, // Default
paths: {
signIn: '/sign-in', // Custom path (optional)
signUp: '/sign-up',
verifyEmail: '/verify-email',
forgotPassword: '/forgot-password',
resetPassword: '/reset-password',
callback: '/auth/callback'
}
})
Use package components with your own styling:
import { SignIn, SignUp } from '@insforge/react';
const router = createBrowserRouter([
{ path: '/', element: <Home /> },
// Still need callback route for OAuth
...getInsforgeRoutes({
baseUrl: import.meta.env.VITE_INSFORGE_BASE_URL,
builtInAuth: false // Don't redirect to deployed UI
}),
// Use package components
{ path: '/sign-in', element: <SignIn afterSignInUrl="/dashboard" /> },
{ path: '/sign-up', element: <SignUp afterSignUpUrl="/dashboard" /> }
]);
Build your own auth pages from scratch:
import { useAuth } from '@insforge/react';
function CustomSignIn() {
const { signIn } = useAuth();
const handleSubmit = async (e) => {
e.preventDefault();
await signIn(email, password);
navigate('/dashboard');
};
return <form onSubmit={handleSubmit}>...</form>;
}
Pre-built with Business Logic:
<SignIn /> - Complete sign-in with email/password & OAuth<SignUp /> - Registration with password validation<UserButton /> - User dropdown with sign-out<Protect /> - Route protection wrapper<SignedIn> / <SignedOut> - Conditional rendering<InsforgeCallback /> - OAuth callback handlerForm Components (Pure UI):
<SignInForm /> - Sign-in UI without logic<SignUpForm /> - Sign-up UI without logic<ForgotPasswordForm /> - Password reset request<ResetPasswordForm /> - Password reset with token<VerifyEmailStatus /> - Email verification statusAtomic Components (13 total):
<AuthContainer />, <AuthHeader />, <AuthFormField />, <AuthPasswordField />, etc.const { signIn, signUp, signOut, isSignedIn, isLoaded } = useAuth();
const { user, updateUser, isLoaded } = useUser();
const { oauthProviders, emailConfig, isLoaded } = usePublicAuthConfig();
All components support appearance props:
<SignIn
appearance={{
container: "max-w-lg",
card: "bg-white shadow-2xl",
button: "bg-blue-600 hover:bg-blue-700"
}}
/>
Style nested components through hierarchical structure:
<SignIn
appearance={{
card: "bg-gradient-to-br from-blue-50 to-white shadow-2xl",
header: {
title: "text-3xl font-bold text-purple-900",
subtitle: "text-purple-600"
},
form: {
emailField: {
label: "text-gray-800 font-semibold",
input: "border-purple-300 focus:border-purple-500 rounded-lg"
},
passwordField: {
input: "border-purple-300 focus:border-purple-500 rounded-lg",
forgotPasswordLink: "text-purple-600 hover:text-purple-800"
}
},
button: "bg-purple-600 hover:bg-purple-700 rounded-lg h-12",
link: {
text: "text-gray-600",
link: "text-purple-600 hover:text-purple-800 font-semibold"
},
oauth: {
button: "border-2 hover:bg-gray-50 rounded-xl"
}
}}
/>
SignIn / SignUp Components:
appearance?: {
container?: string; // Outermost wrapper
card?: string; // Inner card box
header?: {
container?: string; // Header wrapper
title?: string; // Title text
subtitle?: string; // Subtitle text
};
errorBanner?: string; // Error message banner
form?: {
container?: string; // Form wrapper
emailField?: {
container?: string; // Email field wrapper
label?: string; // Email label
input?: string; // Email input
};
passwordField?: {
container?: string; // Password field wrapper
label?: string; // Password label
input?: string; // Password input
forgotPasswordLink?: string; // Forgot password link (SignIn only)
strengthIndicator?: { // Password strength (SignUp only)
container?: string;
requirement?: string;
};
};
};
button?: string; // Submit button
link?: {
container?: string; // Link section wrapper
text?: string; // Link description text
link?: string; // Actual link element
};
divider?: string; // "or" divider
oauth?: {
container?: string; // OAuth buttons wrapper
button?: string; // Individual OAuth button
};
}
All text is customizable:
<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"
/>
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: React.FormEvent) => {
e.preventDefault();
setLoading(true);
setError('');
try {
await signIn(email, password);
// Custom success logic
} catch (err) {
setError(err.message);
} finally {
setLoading(false);
}
};
return (
<SignInForm
email={email}
password={password}
onEmailChange={setEmail}
onPasswordChange={setPassword}
onSubmit={handleSubmit}
error={error}
loading={loading}
availableProviders={['google', 'github']}
onOAuthClick={(provider) => {
// Custom OAuth logic
}}
/>
);
}
import {
AuthContainer,
AuthHeader,
AuthFormField,
AuthPasswordField,
AuthSubmitButton,
AuthErrorBanner,
AuthDivider,
AuthOAuthProviders,
AuthLink,
} from '@insforge/react';
function CompletelyCustomAuth() {
return (
<AuthContainer
appearance={{
containerClassName: "max-w-md",
cardClassName: "bg-white shadow-2xl"
}}
>
<AuthHeader
title="Welcome to MyApp"
subtitle="Sign in to continue"
appearance={{
titleClassName: "text-3xl text-blue-900"
}}
/>
<AuthErrorBanner error={error} />
<form onSubmit={handleSubmit}>
<AuthFormField
id="email"
type="email"
label="Email"
value={email}
onChange={(e) => setEmail(e.target.value)}
appearance={{
inputClassName: "border-blue-500"
}}
/>
<AuthPasswordField
id="password"
label="Password"
value={password}
onChange={(e) => setPassword(e.target.value)}
emailAuthConfig={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>
);
}
import { Protect } from '@insforge/react';
function Dashboard() {
return (
<div>
<h1>Dashboard</h1>
{/* Simple protection */}
<Protect redirectTo="/sign-in">
<UserContent />
</Protect>
{/* Role-based protection */}
<Protect
redirectTo="/unauthorized"
condition={(user) => user.role === 'admin'}
>
<AdminPanel />
</Protect>
</div>
);
}
Full TypeScript support with exported types:
import type {
InsforgeUser,
SignInProps,
SignUpProps,
SignInAppearance,
SignUpAppearance,
UserButtonProps,
ProtectProps,
ConditionalProps,
InsforgeCallbackProps,
SignInFormProps,
SignUpFormProps,
AuthFormFieldProps,
OAuthProvider,
EmailAuthConfig,
InsforgeProviderProps,
GetInsforgeRoutesConfig,
} from '@insforge/react';
Built-in support for 10+ OAuth providers:
Providers are auto-detected from your backend configuration.
import { emailSchema, cn } from '@insforge/react/lib';
// Validate email with Zod
const result = emailSchema.safeParse('user@example.com');
// Merge Tailwind classes
const className = cn('px-4 py-2', 'bg-blue-500', conditionalClass);
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 inputMIT © Insforge
FAQs
Framework-agnostic React authentication UI components for Insforge - reusable across all frameworks
The npm package @insforge/react receives a total of 660 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.

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.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.