Skip to main content
The React SDK provides two wrapper components that make it incredibly easy to restrict access to certain parts of your application: <ProtectedRoute> and <GuestRoute>.

<ProtectedRoute>

Use this component to wrap pages or layouts that only logged-in users should be able to see (e.g., Dashboards, User Settings). If a non-authenticated user attempts to view a protected route, they will be redirected to a path you specify.

<GuestRoute>

Use this component to wrap pages that only non-logged-in users should see (e.g., Login pages, Signup pages). If an already-authenticated user attempts to view a guest route, they will be redirected away (usually to the dashboard).

Props (Both Components)