Clerk RedwoodJS SDK
The Clerk RedwoodJS SDK is the recommended method for integrating Clerk into your RedwoodJS application.
Set environment variables
Below is an example of an .env.local
file.
Pro tip! If you're signed into the Clerk Dashboard, your Secret Key should become visible by clicking on the eye icon. Otherwise, you can find your keys on the API keys page in the Clerk Dashboard.
Set up Redwood auth
The next step is to run a Redwood CLI command to install the required packages and generate some boilerplate code:
You can now access Clerk functions through the Redwood useAuth()
hook, which is exported from src/web/auth.tsx
, or you can use the Clerk components directly.
Protecting your pages
Below is an example of using the useAuth()
hook to verify if the user is authenticated. This will open a modal for your user to sign in to their account.
Feedback
Last updated on