AUTH-JWT
v0.1.0 — JWT auth middleware + .auth() route builder sugar for Hyper.
$ hyper add auth-jwt
Copies 2 files into src/hyper/auth-jwt/ and updates hyper.lock.json.
DEPS
- registry: core
FILES
- auth-jwt/index.ts
- auth-jwt/jwt.ts
README
@hyper/auth-jwt
JWT auth plugin for Hyper — bearer-token verification, typed ctx.user, role/scope guards.
Install
Components are installed as source into your repo, not pulled from npm:
bunx hyper add auth-jwt
Wires the alias @hyper/auth-jwt to src/hyper/auth-jwt/ (configurable in hyper.config.json). See hyperjs.ai for the full registry.
Usage
import { Hyper, ok } from "@hyper/core"
import { authJwtPlugin } from "@hyper/auth-jwt"
export default new Hyper()
.use(authJwtPlugin({ secretEnv: "JWT_SECRET" }))
.get("/me", ({ ctx }) => ok({ user: ctx.user }))
.listen(3000)
Docs
See the main README and docs/ for guides and integration recipes.
License
MIT
MANIFEST
- /r/auth-jwt.json — latest
- /r/auth-jwt@0.1.0.json — immutable