Remix SPA Mode
You will learn the following:
- Install
@clerk/remix
- Set your environment variables
- Configure
ClerkApp
- Update your paths through
ClerkApp
options - Protecting your pages
Before you start
Install @clerk/remix
Once you have a Remix application ready, you need to install Clerk's Remix SDK. This gives you access to our prebuilt components and hooks for Remix applications.
Set your environment variables
- If you don't have an
.env
file in the root directory of your React project, create one now. - Find your Clerk publishable key. If you're signed into Clerk, the
.env
snippet below will contain your key. Otherwise:- Navigate to the Clerk Dashboard and select your application.
- In the navigation sidebar, select API Keys.
- You can copy your key from the Quick Copy section.
- Add your key to your
.env
file.
The final result should look as follows:
Configure ClerkApp
Clerk provides a ClerkApp
wrapper to provide the authentication state to your React tree.
Update your paths through ClerkApp options
Next, add paths to your ClerkApp
options to control the behavior of the components when you sign in or sign up and when you click on the respective links at the bottom of each component.
Protecting your pages
Clerk offers Control Components that allow you to protect your pages. These components are used to control the visibility of your pages based on the user's authentication state.
Next steps
Now that you have an application integrated with Clerk, you will want to read the following documentation:
Customization & Localization
Learn how to customize and localize the Clerk components.
Authentication Components
Learn more about all our authentication components.
Client Side Helpers
Learn more about our client-side helpers and how to use them.
Feedback
Last updated on