Framework Integrations
Hono
Mount Radon on a Hono wildcard route — all auth routes from one handler, plus requireAuth middleware. Runs on the edge.
Radon works on Hono anywhere Hono runs — Node, Bun, Deno, Cloudflare Workers, and
other edge runtimes. Mount radonHono(auth) on a wildcard route and guard your
own routes with requireAuth.
1. Mount the auth routes
import { Hono } from "hono";
import { radonHono } from "@radonsdk/auth/integrations/hono";
import { auth } from "./auth";
const app = new Hono();
// Serves every auth route under /api/auth.
app.all("/api/auth/*", radonHono(auth, { basePath: "/api/auth" }));
export default app;basePath must match the wildcard
The basePath is stripped from the incoming path before routing, so it has to
match the wildcard mount (/api/auth/* ↔ basePath: "/api/auth").
2. Guard your own routes
requireAuth(auth) is Hono middleware. It returns 401 for unauthenticated
requests and, on success, stores the user on the context — read it with
c.get("radonUser").
import { radonHono, requireAuth } from "@radonsdk/auth/integrations/hono";
app.get("/me", requireAuth(auth), (c) => {
return c.json(c.get("radonUser"));
});Options
app.all("/api/auth/*", radonHono(auth, {
basePath: "/api/auth",
cookieName: "acme_session",
successRedirect: "/dashboard",
failureRedirect: "/signin?error=1",
}));CSRF
import { issueCsrfToken, verifyCsrfToken } from "@radonsdk/auth/integrations/hono";