SESSION
v0.1.0 — Signed-cookie session middleware for Hyper. Pluggable stores.
$ hyper add session
Copies 3 files into src/hyper/session/ and updates hyper.lock.json.
DEPS
- registry: core
FILES
- session/csrf.ts
- session/index.ts
- session/sqlite.ts
README
@hyper/session
Signed-cookie session middleware for Hyper. Pluggable stores.
Install
Components are installed as source into your repo, not pulled from npm:
bunx hyper add session
Wires the alias @hyper/session to src/hyper/session/ (configurable in hyper.config.json). See hyperjs.ai for the full registry.
Usage
import { Hyper } from "@hyper/core"
import { csrfGuard, session } from "@hyper/session"
export default new Hyper()
.use(session({ secret: process.env.SESSION_SECRET! }))
.use(csrfGuard())
.get("/me", ({ ctx }) => ({ session: ctx.session }))
.listen(3000)
Docs
See the main README and docs/ for guides and integration recipes.
License
MIT
MANIFEST
- /r/session.json — latest
- /r/session@0.1.0.json — immutable