
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@userfront/react
Advanced tools
The Userfront React SDK is a fast and easy way to use Userfront in your JavaScript or TypeScript React application.
For Node.js support on the server, see @userfront/node.
For Next.js support on the server and client, see @userfront/next.
npm install @userfront/react
# or
yarn add @userfront/react
# or
pnpm add @userfront/react
Add the UserfrontProvider with your desired tenantId to the root layout of your application.
import { UserfrontProvider } from "@userfront/react";
function Layout({ children }) {
return (
<html lang="en">
<body>
<UserfrontProvider tenantId="...">
{children}
</UserfrontProvider>
</body>
</html>
);
}
| Option | Default | Description |
|---|---|---|
tenantId | string | The tenant identifier, this can be found in workspace Tenants on the Userfront dashboard. |
loginUrl | string | Redirect URL for unauthenticated visitors that need to login, the default is /login. |
loginRedirect | string | Redirect URL after login, false to disable. When undefined, uses the path configured to the workspace paths & routing settings. |
signupRedirect | string | Redirect URL after signup, false to disable. When undefined, uses the path configured to the workspace paths & routing settings. |
logoutRedirect | string | Redirect URL after logout, false to disable. When undefined, uses the path configured to the workspace paths & routing settings. |
requireAuth | boolean | When true, unauthenticated visitors will be redirected to the loginUrl. |
Use the useUserfront() hook to access Userfront core and the current client auth state.
import { useUserfront } from "@userfront/react";
export default function Component() {
const { user, isLoading } = useUserfront();
if (isLoading) {
return <div>Loading...</div>;
}
return <div>Hello, {user.email}</div>;
}
In addition to core and the UserfrontProvider properties, these are also available for use:
| Property | Type | Description |
|---|---|---|
isAuthenticated | boolean | Whether or not the current visitor is signed into a valid user account. |
isLoading | boolean | Whether or not Userfront has loaded and initialized. |
Userfront toolkit components are included in this package. Import and use them without any necessary additional props:
import { LoginForm } from "@userfront/react";
export default function Component() {
return <LoginForm />;
}
The available components are LoginForm, SignupForm, PasswordResetForm and LogoutButton.
FAQs
Transform your React application with Userfront authentication
The npm package @userfront/react receives a total of 165 weekly downloads. As such, @userfront/react popularity was classified as not popular.
We found that @userfront/react demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.