|
|
||
|---|---|---|
| .. | ||
| src | ||
| CHANGELOG.md | ||
| README.md | ||
| package.json | ||
| tsconfig.json | ||
| tsup.config.js | ||
| vitest.config.ts | ||
README.md
@unkey/hono
Hono.js middleware for authenticating API keys
Inspired by openstatus.dev/blog/secure-api-with-unkey
Check out the docs at unkey.dev/docs.
Here's just an example:
import { Hono } from "hono"
import { UnkeyContext, unkey } from "@aigxion/hono";
const app = new Hono<{ Variables: { unkey: UnkeyContext } }>();
app.use("*", unkey());
app.get("/somewhere", (c) => {
// access the unkey response here to get metadata of the key etc
const ... = c.get("unkey")
return c.text("yo")
})
``