Skip to content

3.0.0

Compare
Choose a tag to compare
@hoangvvo hoangvvo released this 12 Mar 06:18
· 247 commits to master since this release
  • Usage in Pages: Better integration with React.js and Next.js (#63) (Using HOC pattern)
  • Use nanoid for default session ID generation (#85) (Reduce 100kb of build size)
  • Store no longer has to extend nextSession.Store (#83)
  • Update documentation

💥 Breaking changes

  • maxAge is now in second and no longer parses date string (remove f487b1c).
  • useSession is replaced with applySession
  • connect middleware is now a named import:
//  BEFORE
import session from 'next-session';
//  AFTER
import { session } from 'next-session';
  • options.storePromisify is removed. You must promisify the store that uses callbacks using promisifyStore:
// BEFORE
const options = {
  storePromisify: true,
  store: new SessionStore({ ...storeOptions })
}

// AFTER
import { promisifyStore } from 'next-session';
const options = {
  store: promisifyStore(new SessionStore({ ...storeOptions }))
};