Framework Integrations
Remix
Mount Radon in Remix (and React Router v7) — a handler for the loader and action of a splat route plus getUser. A Radon Pro feature.
Radon Pro
The Remix integration is a Pro feature and requires a license. It also works with React Router v7. See Radon Pro.
Remix speaks Web Request/Response, so Radon mounts as a handler you call from
both the loader (GET) and action (POST) of a splat route.
1. Mount the auth routes
import { radonRemix } from "@radonsdk/auth/pro/integrations/remix";
import { auth } from "~/auth.server";
const handle = radonRemix(auth, { basePath: "/api/auth" });
export const loader = ({ request }: { request: Request }) => handle(request);
export const action = ({ request }: { request: Request }) => handle(request);Both loader and action
GET routes (magic-link verify, OAuth callback, /session) hit the loader; POST
routes (send code, login) hit the action. Export both so every route works.
2. Read the user in a loader
getUser(auth, request) returns the user or null.
import { getUser } from "@radonsdk/auth/pro/integrations/remix";
import { redirect } from "@remix-run/node";
import { auth } from "~/auth.server";
export async function loader({ request }: { request: Request }) {
const user = await getUser(auth, request);
if (!user) throw redirect("/signin");
return { user };
}