# Entry points (https://session-kit.pages.dev/docs/reference)

Find the import path for your setup here, then open its page for the
options and types of each export. Import from these paths only: the internal
`dist` paths aren't part of the public API.

## Entry points

Each entry point, what it's for, and what it exports:

| Import                                                                                  | Use it for                                              | Exports                                                                                                                                           |
| --------------------------------------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`@monarcode/session-kit`](https://session-kit.pages.dev/docs/reference/core)                                        | Creating the client, in every setup                     | `createAuth`, `createMirrorAuth`, `fromAccessToken`, `webStorage`, `memoryStorage`, `isSignedIn`, `safeReturnTo`, `loginHref`, `AuthError`, types |
| [`@monarcode/session-kit/react`](https://session-kit.pages.dev/docs/reference/react)                                 | Reading the session in React: the provider and hooks    | `AuthProvider`, `useAuth`, `useAuthClient`, `createAuthHooks`, `useMirrorAuth`, types                                                             |
| [`@monarcode/session-kit/tanstack-router`](https://session-kit.pages.dev/docs/reference/tanstack-router)             | Guarding routes with TanStack Router                    | `connectAuth`, `requireSession`, `redirectIfSignedIn`, `SessionOutlet`, `useAuth`, `useAuthClient`, types                                         |
| [`@monarcode/session-kit/react-router`](https://session-kit.pages.dev/docs/reference/react-router)                   | Guarding routes with React Router in the browser        | `requireSession`, `requireSessionLoader`, `redirectIfSignedIn`, `redirectIfSignedInLoader`, `SessionOutlet`, `useAuthRevalidation`, types         |
| [`@monarcode/session-kit/react-router/server`](https://session-kit.pages.dev/docs/reference/react-router-server)     | Server sessions with React Router                       | `sessionMiddleware`, `requireSession`, `redirectIfSignedIn`, `sessionRoute`, `routerAuth`, `cookieJarMiddleware`, `routerJar`, types              |
| [`@monarcode/session-kit/http`](https://session-kit.pages.dev/docs/reference/http)                                   | Calling your API with the access token                  | `createAuthFetch`, types                                                                                                                          |
| [`@monarcode/session-kit/server`](https://session-kit.pages.dev/docs/reference/server)                               | Server sessions on any server                           | `createServerAuth`, `sessionHandler`, types                                                                                                       |
| [`@monarcode/session-kit/tanstack-start`](https://session-kit.pages.dev/docs/reference/tanstack-start)               | The browser side of TanStack Start with server sessions | `connectSession`, `loadSession`                                                                                                                   |
| [`@monarcode/session-kit/tanstack-start/server`](https://session-kit.pages.dev/docs/reference/tanstack-start-server) | The server side of TanStack Start                       | `startAuth`, `refreshSession`, `sessionRoute`, `startJar`, types                                                                                  |
| [`@monarcode/session-kit/next`](https://session-kit.pages.dev/docs/reference/next)                                   | Server sessions with Next.js                            | `nextSession`, `sessionRoute`, `nextJar`, `proxyJar`, types                                                                                       |
| [`@monarcode/session-kit/expo`](https://session-kit.pages.dev/docs/reference/expo)                                   | Expo Router apps on iOS and Android                     | `secureStorage`, `SessionGate`, `deepLinkHandler`, `rememberDeepLink`, types                                                                      |
| [`@monarcode/session-kit/effect`](https://session-kit.pages.dev/docs/reference/effect)                               | Reading the session from Effect code                    | `Auth`, `AuthFailure`, types                                                                                                                      |
| [`@monarcode/session-kit/effetch`](https://session-kit.pages.dev/docs/reference/effetch)                             | Calling your API with 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 `AuthError`s, with a `code` you can
match on. [Error codes](https://session-kit.pages.dev/docs/reference/error-codes) lists every code, and
[Effect and effetch](https://session-kit.pages.dev/docs/effect#how-effects-fail) how they reach Effect
code.

## Next steps

- [Installation](https://session-kit.pages.dev/docs/installation#pick-your-setup): find the guide for your
  setup.
- [Compatibility](https://session-kit.pages.dev/docs/reference/compatibility): the versions and runtimes
  each entry point supports.