Entry points
Every import path Session kit publishes, and what each one exports.
Session kit publishes one entry point for each part of the package. This page lists them, with what each one exports. Each entry point's page documents its exports, with their options and types.
Entry points
Internal dist paths aren't part of the public API. Import from these paths
only:
| Import | Exports |
|---|---|
@monarcode/session-kit | createAuth, createMirrorAuth, fromAccessToken, webStorage, memoryStorage, isSignedIn, safeReturnTo, loginHref, AuthError, types |
@monarcode/session-kit/react | AuthProvider, useAuth, useAuthClient, createAuthHooks, useMirrorAuth, types |
@monarcode/session-kit/tanstack-router | connectAuth, requireSession, redirectIfSignedIn, SessionOutlet, useAuth, useAuthClient, types |
@monarcode/session-kit/react-router | requireSession, requireSessionLoader, redirectIfSignedIn, redirectIfSignedInLoader, SessionOutlet, useAuthRevalidation, types |
@monarcode/session-kit/react-router/server | sessionMiddleware, requireSession, redirectIfSignedIn, sessionRoute, routerAuth, cookieJarMiddleware, routerJar, types |
@monarcode/session-kit/http | createAuthFetch, types |
@monarcode/session-kit/server | createServerAuth, sessionHandler, types |
@monarcode/session-kit/tanstack-start | connectSession, loadSession |
@monarcode/session-kit/tanstack-start/server | startAuth, refreshSession, sessionRoute, startJar, types |
@monarcode/session-kit/next | nextSession, sessionRoute, nextJar, proxyJar, types |
@monarcode/session-kit/expo | secureStorage, SessionGate, deepLinkHandler, rememberDeepLink, types |
@monarcode/session-kit/effect | Auth, AuthFailure, types |
@monarcode/session-kit/effetch | sessionBearer, types |
Bundle size
The package is tree-shakeable, so a bundle holds only what you import. An entry point you don't import adds nothing.
Errors
Errors from Session kit's own logic are AuthErrors. In ./effect and
./effetch, Effects fail with AuthFailure, which carries the same code.
The exception is INVALID_OPTIONS: it's misuse, so the Effect dies with the
AuthError instead. See Error codes for every
AuthErrorCode.