Skip to main content
Docs

Clerk Remix SDK

The Clerk Remix SDK gives you access to prebuilt components, React hooks, and helpers to make user authentication easier. Refer to the quickstart guideRemix Icon to get started.

ClerkApp

The ClerkApp component is a wrapper that provides Clerk's authentication state to your React tree. It is required to configure Clerk in your Remix application. Learn more in the referenceRemix Icon.

rootAuthLoader()

The rootAuthLoader() function is a helper function that provides the authentication state to your Remix application. It is required to configure Clerk in your Remix application. Learn more in the referenceRemix Icon.

Client-side helpers

Because the Remix SDK is built on top of the Clerk React SDK, you can use the hooks that the React SDK provides. These hooks include access to the ClerkJavaScript Icon object, User objectJavaScript Icon, Organization objectJavaScript Icon, and a set of useful helper methods for signing in and signing up.

Server-side helpers

getAuth()

The getAuth() helper retrieves authentication state from the request object. Returns the AuthClerk Icon object. Accepts the following parameters:

  • Name
    args
    Description

    The arguments object.

  • Name
    opts?
    Description

    An optional object that can be used to configure the behavior of the getAuth() function. It accepts the following properties:

    • secretKey?: A string that represents the Secret Key used to sign the session token. If not provided, the Secret Key is retrieved from the environment variable CLERK_SECRET_KEY.

See the dedicated guideRemix Icon for example usage.

SPA mode

Clerk supports Remix in SPA mode out-of-the-box. Learn more in the tutorialRemix Icon.

Feedback

What did you think of this content?

Last updated on