Skip to Content
Reference

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

Import from these paths only. Internal dist paths aren't part of the public API.

ImportExports
@monarcode/session-kitcreateAuth, createMirrorAuth, fromAccessToken, webStorage, memoryStorage, safeReturnTo, AuthError, types
@monarcode/session-kit/reactcreateAuthHooks, useMirrorAuth, types
@monarcode/session-kit/tanstack-routerconnectAuth, requireSession, redirectIfSignedIn, SessionOutlet, useRouterAuth, types
@monarcode/session-kit/react-routerrequireSession, redirectIfSignedIn, SessionOutlet, useAuthRevalidation, types
@monarcode/session-kit/react-router/servercookieJarMiddleware, routerJar, types
@monarcode/session-kit/httpcreateAuthFetch, types
@monarcode/session-kit/servercreateServerAuth, types
@monarcode/session-kit/tanstack-startsessionHydration, loadSession, types
@monarcode/session-kit/tanstack-start/serverstartJar
@monarcode/session-kit/nextnextJar, proxyJar, types
@monarcode/session-kit/exposecureStorage, SessionGate, rememberDeepLink, types
@monarcode/session-kit/effectAuth, AuthFailure, types
@monarcode/session-kit/effetchsessionBearer, 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. See Error codes for every AuthErrorCode.

On this page