Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## Unreleased

### Changed

- The documentation site moved to https://session-kit.monarcode.dev. The old
address, https://session-kit.pages.dev, still serves it.

## 0.1.0-rc.3

Fixes for Expo SDK 53 to 57 and for redirects on React Native, and a
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
[![provenance](https://img.shields.io/badge/provenance-verified-brightgreen?logo=npm)](https://www.npmjs.com/package/@monarcode/session-kit#provenance)
[![license](https://img.shields.io/npm/l/@monarcode/session-kit)](./LICENSE)

[![React](https://img.shields.io/badge/React-20232a?logo=react&logoColor=61dafb)](https://session-kit.pages.dev/docs/getting-started)
[![TanStack Router](https://img.shields.io/badge/TanStack%20Router-20232a?logo=tanstack&logoColor=white)](https://session-kit.pages.dev/docs/setups/tanstack-router)
[![TanStack Start](https://img.shields.io/badge/TanStack%20Start-20232a?logo=tanstack&logoColor=white)](https://session-kit.pages.dev/docs/setups/tanstack-start)
[![React Router](https://img.shields.io/badge/React%20Router-20232a?logo=reactrouter&logoColor=ca4245)](https://session-kit.pages.dev/docs/setups/react-router)
[![Next.js](https://img.shields.io/badge/Next.js-20232a?logo=nextdotjs&logoColor=white)](https://session-kit.pages.dev/docs/setups/next)
[![Expo](https://img.shields.io/badge/Expo-20232a?logo=expo&logoColor=white)](https://session-kit.pages.dev/docs/setups/expo)
[![Effect](https://img.shields.io/badge/Effect-20232a?logo=effect&logoColor=white)](https://session-kit.pages.dev/docs/effect)
[![React](https://img.shields.io/badge/React-20232a?logo=react&logoColor=61dafb)](https://session-kit.monarcode.dev/docs/getting-started)
[![TanStack Router](https://img.shields.io/badge/TanStack%20Router-20232a?logo=tanstack&logoColor=white)](https://session-kit.monarcode.dev/docs/setups/tanstack-router)
[![TanStack Start](https://img.shields.io/badge/TanStack%20Start-20232a?logo=tanstack&logoColor=white)](https://session-kit.monarcode.dev/docs/setups/tanstack-start)
[![React Router](https://img.shields.io/badge/React%20Router-20232a?logo=reactrouter&logoColor=ca4245)](https://session-kit.monarcode.dev/docs/setups/react-router)
[![Next.js](https://img.shields.io/badge/Next.js-20232a?logo=nextdotjs&logoColor=white)](https://session-kit.monarcode.dev/docs/setups/next)
[![Expo](https://img.shields.io/badge/Expo-20232a?logo=expo&logoColor=white)](https://session-kit.monarcode.dev/docs/setups/expo)
[![Effect](https://img.shields.io/badge/Effect-20232a?logo=effect&logoColor=white)](https://session-kit.monarcode.dev/docs/effect)

**Every sign-in ends in a session. Make yours type-safe and predictable.**

Expand All @@ -31,7 +31,7 @@ server with TanStack Start, Next.js, and React Router, and comes with an
> **Release candidate.** The API is frozen for 0.1, and later 0.1 releases
> only add to it. See the [release notes](./CHANGELOG.md).

**Documentation: [session-kit.pages.dev](https://session-kit.pages.dev)**
**Documentation: [session-kit.monarcode.dev](https://session-kit.monarcode.dev)**

## Installation

Expand All @@ -45,7 +45,7 @@ Any [Standard Schema](https://standardschema.dev) library describes users.
The examples use Zod. Peer dependencies such as React and your router are
optional: install the ones your setup uses. Session kit needs TypeScript 5.4
or newer (Effect asks for 5.9), and
[Compatibility](https://session-kit.pages.dev/docs/reference/compatibility)
[Compatibility](https://session-kit.monarcode.dev/docs/reference/compatibility)
lists the supported versions.

Release candidates are published to the `latest` tag, so pin an exact version
Expand Down Expand Up @@ -165,14 +165,14 @@ function Home() {

To call your API, `createAuthFetch` from `@monarcode/session-kit/http` adds
the access token to each request and refreshes it after a 401.
[Getting started](https://session-kit.pages.dev/docs/getting-started) builds
[Getting started](https://session-kit.monarcode.dev/docs/getting-started) builds
this app step by step against a real test backend, and the setup guides add
your router's guards or server rendering.

## Pick your setup

Each setup, from plain React to Next.js, Expo Router and Effect, has a guide:
see [Pick your setup](https://session-kit.pages.dev/docs/installation#pick-your-setup).
see [Pick your setup](https://session-kit.monarcode.dev/docs/installation#pick-your-setup).
Every setup but plain React has a runnable app in [`examples/`](./examples).

## Contributing
Expand Down
2 changes: 1 addition & 1 deletion docs/effect.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Effect and effetch

This guide moved to the documentation site: [Effect and effetch](https://session-kit.pages.dev/docs/effect).
This guide moved to the documentation site: [Effect and effetch](https://session-kit.monarcode.dev/docs/effect).
2 changes: 1 addition & 1 deletion docs/expo.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Expo Router

This guide moved to the documentation site: [Expo Router](https://session-kit.pages.dev/docs/setups/expo).
This guide moved to the documentation site: [Expo Router](https://session-kit.monarcode.dev/docs/setups/expo).
2 changes: 1 addition & 1 deletion docs/next.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Next.js

This guide moved to the documentation site: [Next.js](https://session-kit.pages.dev/docs/setups/next).
This guide moved to the documentation site: [Next.js](https://session-kit.monarcode.dev/docs/setups/next).
2 changes: 1 addition & 1 deletion docs/react-router-ssr.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# React Router with server rendering

This guide moved to the documentation site: [React Router with server rendering](https://session-kit.pages.dev/docs/setups/react-router-ssr).
This guide moved to the documentation site: [React Router with server rendering](https://session-kit.monarcode.dev/docs/setups/react-router-ssr).
2 changes: 1 addition & 1 deletion docs/react-router.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# React Router

This guide moved to the documentation site: [React Router](https://session-kit.pages.dev/docs/setups/react-router).
This guide moved to the documentation site: [React Router](https://session-kit.monarcode.dev/docs/setups/react-router).
2 changes: 1 addition & 1 deletion docs/server-sessions.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Server sessions

This guide moved to the documentation site: [Server sessions](https://session-kit.pages.dev/docs/server-rendering/server-sessions).
This guide moved to the documentation site: [Server sessions](https://session-kit.monarcode.dev/docs/server-rendering/server-sessions).
2 changes: 1 addition & 1 deletion docs/tanstack-router.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# TanStack Router

This guide moved to the documentation site: [TanStack Router](https://session-kit.pages.dev/docs/setups/tanstack-router).
This guide moved to the documentation site: [TanStack Router](https://session-kit.monarcode.dev/docs/setups/tanstack-router).
2 changes: 1 addition & 1 deletion docs/tanstack-start.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# TanStack Start

This guide moved to the documentation site: [TanStack Start](https://session-kit.pages.dev/docs/setups/tanstack-start).
This guide moved to the documentation site: [TanStack Start](https://session-kit.monarcode.dev/docs/setups/tanstack-start).
8 changes: 4 additions & 4 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ run ios` and `run android` build it natively. In CI it is only bundled, with
and the profile query, which `src/ui.tsx` uses with `useMutation` and
`useQuery`, and the root route gives each session its own query cache. The
hooks and the guards are the SPA app's. See
[the guide](https://session-kit.pages.dev/docs/effect).
[the guide](https://session-kit.monarcode.dev/docs/effect).
- **TanStack Start with server rendering** keeps the session in an encrypted
`httpOnly` cookie with `createServerAuth` (`src/auth/server.ts`), signs in
with DummyJSON from a server function, and refreshes in request middleware
Expand All @@ -84,7 +84,7 @@ run ios` and `run android` build it natively. In CI it is only bundled, with
`vite dev` uses a development secret. The cookie is `Secure` outside
`vite dev`, which Safari refuses over `http://localhost`: try
`vite preview` in another browser. See
[the guide](https://session-kit.pages.dev/docs/setups/tanstack-start).
[the guide](https://session-kit.monarcode.dev/docs/setups/tanstack-start).
- **Next.js** keeps the session the same way: Proxy refreshes it
(`proxy.ts`), Server Components read it through `lib/auth/session.ts`, and
a Server Function in `app/actions.ts` signs in. `useMirrorAuth` in
Expand All @@ -93,7 +93,7 @@ run ios` and `run android` build it natively. In CI it is only bundled, with
redirects run. The browser reads the session, signs out and gets the
access token through the session route (`app/api/session/route.ts`).
`SESSION_SECRET` and Safari work as for TanStack Start, with `next start`
and `next dev`. See [the guide](https://session-kit.pages.dev/docs/setups/next).
and `next dev`. See [the guide](https://session-kit.monarcode.dev/docs/setups/next).
- **React Router with server rendering** keeps the session the same way.
The root route's `sessionMiddleware` gives each request a cookie jar and
refreshes, the root loader reads the session, and the sign-in route's
Expand All @@ -104,7 +104,7 @@ run ios` and `run android` build it natively. In CI it is only bundled, with
session, signs out and gets the access token through the session route in
`app/routes/auth.session.ts`. `SESSION_SECRET` and Safari work as for
TanStack Start, with `pnpm start` (after `pnpm build`) and `react-router dev`. See
[the guide](https://session-kit.pages.dev/docs/setups/react-router-ssr).
[the guide](https://session-kit.monarcode.dev/docs/setups/react-router-ssr).
- **Expo Router** saves the session with `secureStorage()`. `SessionGate` in
`app/_layout.tsx` holds the splash screen, shows `src/unavailable.tsx`
after a failed refresh, and re-checks the session when the app returns to
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"tanstack",
"tanstack-start"
],
"homepage": "https://session-kit.pages.dev",
"homepage": "https://session-kit.monarcode.dev",
"bugs": {
"url": "https://github.com/monarcode/session-kit/issues"
},
Expand Down
5 changes: 3 additions & 2 deletions site/PRODUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ those same checked examples, so the code shown is code that compiles.
identifier (the npm name, URLs, paths). Use the reader's words ("signed in", "the saved
session", "another tab", "the access token expired"), never engine names
such as epoch, revision or flight.
- Undecided: the site's final URL. `https://session-kit.pages.dev` is assumed
until the Cloudflare Pages project or a custom domain is set.
- The site's URL is `https://session-kit.monarcode.dev`, a custom domain on
the Cloudflare Pages project. `https://session-kit.pages.dev` still serves
it.

## Brand Commitments

Expand Down
2 changes: 1 addition & 1 deletion site/src/lib/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const codeThemes = {
} as const;

/** Where the site is served. Link previews need absolute URLs. */
export const SITE_URL = "https://session-kit.pages.dev";
export const SITE_URL = "https://session-kit.monarcode.dev";

/** A page's title and description, for the browser and for link previews. */
export function pageMeta(title: string, description: string) {
Expand Down
Loading