Core concepts
Before building your application, it's important to understand the core concepts and objects that drive Clerk's powerful authentication and user management system. This page walks through integration options, prebuilt components, configuration steps, and the key objects you'll use as you build your application.
Ways to implement Clerk
Clerk provides three ways to integrate authentication into your application, depending on the level of control and customization you need:
- Account Portal (default): Uses Clerk's prebuilt components on dedicated pages that are hosted on Clerk servers. Every Clerk application has this enabled by default, providing a complete user management interface out of the box.
- Prebuilt components: All-in-one UI components that can be integrated into your application. They are fully customizable to match your application's branding and design. This is the recommended approach for most use cases.
- using the Clerk API: Build your own UI using the Clerk API. This option provides maximum flexibility and control over the user experience but requires more development effort.
Clerk offers a comprehensive suite of prebuilt components designed to seamlessly integrate authentication and multi-tenancy into your application. Components, like <SignIn />, <UserButton />, and <OrganizationSwitcher />, are all-in-one solutions that handle the full lifecycle of the user experience, from sign-up/sign-in to user profile and Organization management.
The Account Portal uses these components on dedicated pages that are hosted on Clerk servers. These pages cannot be customized beyond the options provided in the Clerk Dashboard.
For more control and customization, you can migrate away from the Account Portal and embed the prebuilt components directly into your own application pages. While they are fully customizable to match your application's branding and design using CSS or special props, the HTML structure and the logic/ordering of the authentication flow remain fixed.
If the prebuilt components don't meet your specific needs or if you need complete control over the logic, you can rebuild the existing Clerk flows using the Clerk API. However, this is more advanced and it's recommended to use the prebuilt components whenever possible.
Configuring your application
Configuring your application is done through the Clerk Dashboard. The Clerk Dashboard is where you, as the application owner, can manage your application's settings, users, and organizations.
For example, you can:
- Enable phone number authentication or multi-factor authentication.
- Add social providers like Google.
- Delete users or create Organizations.
- Invite other users to your workspace to help configure and manage your application.
To get started, see the configuration docs, which include dedicated guides for specific configuration options.
Building your application
Session token
When a user is authenticated in your application, Clerk generates a short-lived session token that you can use to authenticate requests to your backend. This token is a JSON Web Token (JWT) that contains information about the user and their session.
Read more about Clerk session tokens and how they work in the guide on how Clerk works.
Key Clerk objects
Clerk's SDKs are built on top of many key objects, like the Clerk, User, and Session objects. As you're building your application, you'll likely interact with these objects, either directly or through hooks and helpers. Refer to the reference docs for more information.
Deep dive
For a deeper dive into how Clerk works, like how our authentication model works, see the dedicated guide.
Feedback
Last updated on