Clerk provides a complete, easy-to-use authentication and user management solution for modern web and mobile applications. It offers prebuilt components, secure APIs, and full support for popular frameworks—letting you add sign up, sign in, user profiles, social login, and more in minutes.
- Prebuilt UI Components – Drop-in sign up, sign in, user profile, and multi-factor authentication widgets.
- Social, Passwordless, and Magic Link Logins – Easily enable Google, GitHub, Twitter, and email/passwordless login.
- User Management – Built-in dashboard for managing users, roles, and sessions.
- Secure APIs – Protect your backend routes and resources with Clerk's authentication middleware and JWTs.
- Framework Integrations – First-class support for Next.js, React, Remix, Expo/React Native, and more.
- Customizable – Fully customizable UI and workflows to fit your brand and requirements.
-
Sign Up & Create an Application
- Go to clerk.com and sign up for a free account.
- Create a new application in the Clerk dashboard.
-
Integrate Clerk into Your App
- Install the Clerk SDK for your stack (e.g., React, Next.js, etc.).
- Example for Next.js:
npm install @clerk/clerk-react
-
Add Clerk Provider & Components
- In your app’s root, wrap your code with
<ClerkProvider>. - Add authentication components like
<SignIn />,<SignUp />, and<UserButton />where needed. - Example (React):
import { ClerkProvider, SignIn, SignUp, UserButton } from "@clerk/clerk-react"; function App() { return ( <ClerkProvider> <SignIn path="/sign-in" routing="path" /> <SignUp path="/sign-up" routing="path" /> <UserButton /> {/* Your app routes */} </ClerkProvider> ); }
- In your app’s root, wrap your code with
-
Protect Backend APIs
- Use Clerk’s middleware or SDK to secure API routes and get the authenticated user.
- Example (Next.js API route):
import { getAuth } from "@clerk/nextjs/server"; export default function handler(req, res) { const { userId } = getAuth(req); if (!userId) { return res.status(401).json({ error: "Unauthorized" }); } // ...your code }
-
User Management
- Use Clerk’s dashboard to view and manage users, sessions, and roles.
- Programmatically manage users and data with Clerk’s REST API or Admin SDK.
- New projects: Quickly add robust authentication to web/mobile apps without building from scratch.
- MVPs or Startups: Save development time and ensure security best practices.
- Apps needing social login: Easily enable Google, GitHub, Twitter, and other OAuth providers.
- SaaS platforms: Out-of-the-box support for user profiles, roles, organization management, and multi-tenancy.
- Projects requiring secure API access: Protect backend endpoints and resources using JWTs and Clerk middleware.
- Apps with custom branding: Clerk’s UI is fully customizable to match your app’s look and feel.
# 1. Install Clerk packages
npm install @clerk/nextjs
# 2. Add ClerkProvider in _app.js/_app.tsx
import { ClerkProvider } from "@clerk/nextjs";
export default function MyApp({ Component, pageProps }) {
return (
<ClerkProvider>
<Component {...pageProps} />
</ClerkProvider>
);
}
# 3. Add sign in/up components in your pages:
import { SignIn, SignUp } from "@clerk/nextjs";
export default function SignInPage() {
return <SignIn />;
}
export default function SignUpPage() {
return <SignUp />;
}Learn more at clerk.com