Remix SDK reference
npm install @rownd/remix
or yarn add @rownd/remix
.
root.tsx
file, use the Remix Rownd provider to wrap children,
likely before other providers:
root.tsx
entry.server.ts
file, add the Rownd handle request higher-order
function with your server’s request handler handleRequest
:
entry.server.ts
withRowndRequireSignIn
higher-order component and the withRowndLoader
higher-order function.
useRownd
React hook. Unless otherwise noted, we’re assuming that you’re using
hooks.
auto_sign_in: boolean
- when true
, automatically trigger a sign-in
attempt if identifier
is included or an email address or phone number has
already been set in the user data.
identifier: string
- an email address or phone number (in E164 format) to
which a verification message may be sent. If the Rownd app is configured to
allow unverified users, then sign-in will complete without verification if the
user has not signed in previously.
waitForToken: boolean
- when true
, if no access token is present or if
it’s expired, the promise will not resolve until a valid token is available.
While unlikely, this could result in waiting forever.is_initializing
will be true
until the Hub has fully loaded, recalled its
state, and resolved the current user’s authentication status. This usually takes
only a few milliseconds, but if you make decisions that depend on the
is_authenticated
flag while is_initializing
is still true
, your code/logic
may not work as you expect.
first_name
in a form field, update a local copy of that data
as the user changes it, and then save the changes to Rownd once the user submits
the form.
setUser
function allows you to update a user’s profile information within the Rownd platform. You can modify user attributes such as first_name
, last_name
, and other properties by passing an object with the relevant fields.
setUserValue
function allows you to update a specific attribute of the user’s profile within the Rownd platform. Instead of passing an entire user object, you can update individual fields by specifying the key (attribute name) and value.
manageAccount()
function allows users to view and update their profile information within the Rownd platform. This function opens the user’s account management interface, where they can review and modify personal details such as their name, email, and other profile attributes.
register
function starts the process of creating a new passkey for the user, while the authenticate
function validates an existing passkey to authenticate the user.
RequireSignIn
component is a wrapper that triggers the sign-in process when the component it wraps is rendered. It ensures that the user is signed in before accessing the content of the wrapped component. If the user is not authenticated, the sign-in process will automatically begin when the component mounts.
SignedIn
component is used to conditionally render its children only when the user is authenticated. If the user is not signed in, the wrapped content will not be displayed.
SignedOut
component is the counterpart to SignedIn
. It renders its children only when the user is not authenticated. If the user is signed in, the wrapped content will not be displayed.