@useauthio/edge
v0.2.0
Published
Verify Authio JWTs at the edge. Runtime-agnostic (Vercel Edge, Deno Deploy, Bun, Node, Cloudflare).
Readme
@useauthio/edge
Part of Authio Lobby — Authio's drop-in passwordless authentication. Learn more at https://authio.com/products/lobby.
Verify Authio JWTs at any edge runtime — Cloudflare Workers, Vercel Edge, Deno Deploy, Bun, and Node. JWKS is fetched once and cached. No round-trip to auth-core on the hot path.
Install
pnpm add @useauthio/edgeQuick start
import { EdgeAuth } from "@useauthio/edge";
const auth = new EdgeAuth({ apiUrl: "https://api.authio.com" });
export default {
async fetch(req: Request) {
const session = await auth.verifyRequest(req);
if (!session) return new Response("Unauthorized", { status: 401 });
return Response.json({ userId: session.userId, orgId: session.orgId });
},
};License
MIT
