StackpressGitHub

API reference

stackpress/session

stackpress/session exposes the session-aware matching helpers, session runtime class, and auth-adjacent action helpers that are publicly available through Stackpress.

Import

import { Session, actions, matchRoute, matchEvent } from 'stackpress/session';

When To Use It

Use this path when you need direct session or auth helper access in app code rather than only using the session plugin indirectly.

Export Inventory

ExportKindPurpose
SessionclassMain session runtime class
actionshelper namespace/objectSession and auth-oriented helper actions
matchAnyEvent, matchAnyRoute, matchEvent, matchRoutefunctionsMatch session rules against routes or events
isRegExpfunctionUtility used when matching route or event expressions

Detailed Exports

Session

  • Kind: class
  • Use it when you need the public session runtime object directly.
  • Common responsibilities:
  • session authorization
  • reading session state
  • applying permission-aware checks
import { Session } from 'stackpress/session';

actions

  • Kind: helper namespace/object
  • Use it when you need the public session action helpers exposed by Stackpress.
import { actions } from 'stackpress/session';

matchAnyEvent and matchEvent

  • Kind: functions
  • Use them to test whether an event expression matches the current event name.
  • Returns a boolean match result.
import { matchAnyEvent, matchEvent } from 'stackpress/session';

matchAnyRoute and matchRoute

  • Kind: functions
  • Use them to test whether a route expression matches the current route.
  • Returns a boolean match result.
import { matchAnyRoute, matchRoute } from 'stackpress/session';

isRegExp

  • Kind: function
  • Use it when you need to distinguish between string and regular-expression match input.
import { isRegExp } from 'stackpress/session';