API Authentication in Hono
npm create hono@latest
@unkey/hono
npm install @unkey/hono
import { Hono } from "hono"; import { unkey, UnkeyContext } from "@unkey/hono"; const app = new Hono<{ Variables: { unkey: UnkeyContext } }>(); app.use("*", unkey()); app.get("/", (c) => { return c.text("Hello Hono!"); }); export default app;
bun run dev
curl -XPOST 'http://localhost:8787/' \ -H "Authorization: Bearer <KEY>"
Hello Hono!"
Was this page helpful?