
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.
@authon/react
Advanced tools
English | 한국어
Drop-in React authentication with hooks and components — Auth0 alternative, open-source auth
Before installing the SDK, create an Authon project and get your API keys:
Create a project at Authon Dashboard
Get your API keys from Project Settings → API Keys
pk_live_...) — use in your frontend codepk_test_...) — for development, enables Dev TeleportConfigure OAuth providers (optional) in Project Settings → OAuth
https://api.authon.dev/v1/auth/oauth/redirectTest vs Live keys: Use
pk_test_...during development. Switch topk_live_...before deploying to production. Test keys use a sandbox environment with no rate limits.
npm install @authon/react
// src/main.tsx — complete working file
import React from 'react';
import ReactDOM from 'react-dom/client';
import { AuthonProvider, useAuthon, useUser, SignedIn, SignedOut, UserButton } from '@authon/react';
function App() {
const { openSignIn, signOut } = useAuthon();
const { user } = useUser();
return (
<div>
<SignedOut>
<button onClick={() => openSignIn()}>Sign In</button>
</SignedOut>
<SignedIn>
<p>Welcome, {user?.email}</p>
<UserButton />
<button onClick={() => signOut()}>Sign Out</button>
</SignedIn>
</div>
);
}
ReactDOM.createRoot(document.getElementById('root')!).render(
<AuthonProvider
publishableKey="pk_live_YOUR_PUBLISHABLE_KEY"
>
<App />
</AuthonProvider>
);
import { useAuthon } from '@authon/react';
function GoogleLoginButton() {
const { client } = useAuthon();
return (
<button onClick={() => client?.signInWithOAuth('google')}>
Sign in with Google
</button>
);
}
import { Protect } from '@authon/react';
function Dashboard() {
return (
<Protect fallback={<p>Please sign in to view this page.</p>}>
<h1>Dashboard</h1>
</Protect>
);
}
// With role-based condition
function AdminPanel() {
return (
<Protect
condition={(user) => user.publicMetadata?.role === 'admin'}
fallback={<p>Admin access required.</p>}
>
<h1>Admin Panel</h1>
</Protect>
);
}
import { useUser } from '@authon/react';
function Profile() {
const { user, isLoading } = useUser();
if (isLoading) return <p>Loading...</p>;
if (!user) return <p>Not signed in</p>;
return (
<div>
<p>Email: {user.email}</p>
<p>Name: {user.displayName}</p>
</div>
);
}
import { useAuthon } from '@authon/react';
import { useState } from 'react';
function EmailSignIn() {
const { client } = useAuthon();
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');
const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault();
await client?.signInWithEmail(email, password);
};
return (
<form onSubmit={handleSubmit}>
<input type="email" value={email} onChange={(e) => setEmail(e.target.value)} placeholder="Email" />
<input type="password" value={password} onChange={(e) => setPassword(e.target.value)} placeholder="Password" />
<button type="submit">Sign In</button>
</form>
);
}
import { useAuthon } from '@authon/react';
function SignOutButton() {
const { signOut } = useAuthon();
return <button onClick={() => signOut()}>Sign Out</button>;
}
| Variable | Required | Description |
|---|---|---|
AUTHON_PUBLISHABLE_KEY | Yes | Project publishable key (pk_live_... or pk_test_...) |
AUTHON_API_URL | No | Optional — defaults to api.authon.dev |
| Component | Description |
|---|---|
<AuthonProvider> | Context provider. Props: publishableKey, config? |
<SignIn> | Pre-built sign-in form (mode="popup" or "embedded") |
<SignUp> | Pre-built sign-up form |
<UserButton> | Avatar dropdown with user info and sign-out |
<UserProfile> | Full user profile management |
<SignedIn> | Renders children only when signed in |
<SignedOut> | Renders children only when signed out |
<Protect> | Conditional render with fallback and condition |
<SocialButton> | Single OAuth provider button |
<SocialButtons> | All enabled OAuth provider buttons |
| Hook | Returns |
|---|---|
useAuthon() | { isSignedIn, isLoading, user, signOut, openSignIn, openSignUp, getToken, client } |
useUser() | { user, isLoading } |
useAuthonMfa() | MFA setup, verification, and management |
useAuthonPasskeys() | Passkey registration and authentication |
useAuthonPasswordless() | Magic link and email OTP |
useAuthonWeb3() | Web3 wallet sign-in and management |
useAuthonSessions() | List and revoke active sessions |
useOrganization() | Active organization management |
useOrganizationList() | List and switch organizations |
| Feature | Authon | Clerk | Auth.js |
|---|---|---|---|
| Pricing | Free | $25/mo+ | Free |
| OAuth providers | 10+ | 20+ | 80+ |
| ShadowDOM modal | Yes | No | No |
| MFA/Passkeys | Yes | Yes | Plugin |
| Web3 auth | Yes | No | No |
| Organizations | Yes | Yes | No |
MIT
FAQs
Authon React SDK — Provider, hooks, and components for React apps
We found that @authon/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.