HYPERJS.AI

SESSION

v0.1.0Signed-cookie session middleware for Hyper. Pluggable stores.

$ hyper add session

Copies 3 files into src/hyper/session/ and updates hyper.lock.json.

DEPS

FILES

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