npm iron-session 8.0.0

latest releases: 8.0.3, 8.0.2, 8.0.1...
10 months ago

The v8 of iron-session focuses on reducing its API surface and bringing compatibility with the Next.js App Router.

As long as you make the required code changes, this upgrade will not disconnect your customers once deployed.

Instead of multiple opinionated wrappers (withIronSess..) There's now a single method to get sessions: getIronSession().
Use it like this:

import { getIronSession } from "iron-session";

const session = getIronSession(req, res, { password: "...", cookieName: "..." });

// or, in App Router:
const session = getIronSession(cookies(), { password: "...", cookieName: "..." });

Read more in the README: https://github.com/vvo/iron-session#usage.
Have a look at our new examples:

New features:

  • App Router compatibility
  • updateConfig method to change a session configuration for the next save() or destroy()
  • Single entry point, no more /next, /edge, ..

BREAKING CHANGES:

  • We've removed support for Node.js < 18
  • We've removed withIronSessionApiRoute, withIronSessionSsr, ironSession
  • added support

Gigantic thanks to:

Don't miss a new iron-session release

NewReleases is sending notifications on new releases.