@authhero/admin 0.3.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +29 -1
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  The AuthHero admin UI — a Vite + React 19 SPA for managing tenants, users, applications, connections, roles, branding and more across one or many AuthHero deployments.
4
4
 
5
- Built on `ra-core` (the headless half of react-admin) with [shadcn/ui](https://ui.shadcn.com/) and Tailwind v4. This app replaces the older `apps/react-admin`.
5
+ Built on `ra-core` (the headless half of react-admin) with [shadcn/ui](https://ui.shadcn.com/) and Tailwind v4.
6
6
 
7
7
  ## Quick start
8
8
 
@@ -90,6 +90,34 @@ The three branding settings (`appName`, `logoUrl`, `faviconUrl`) are read in thr
90
90
 
91
91
  To replace the default mark, set `VITE_APP_FAVICON_URL` to your own asset; the bundled default lives at [`public/favicon.svg`](public/favicon.svg).
92
92
 
93
+ ## Deploying to Cloudflare Pages
94
+
95
+ The admin is a static SPA, so any static host works. Cloudflare Pages is the recommended target.
96
+
97
+ In the Cloudflare dashboard, **Workers & Pages → Create → Pages → Connect to Git**, then:
98
+
99
+ | Setting | Value |
100
+ | --- | --- |
101
+ | Build command | `pnpm install --no-frozen-lockfile && pnpm --filter "@authhero/admin..." build` |
102
+ | Build output directory | `dist` |
103
+ | Root directory (advanced) | `apps/admin` |
104
+ | Environment variables | `NODE_VERSION=20`, `ENABLE_EXPERIMENTAL_COREPACK=1`, plus the `VITE_*` settings from the table above |
105
+
106
+ The trailing `...` on the pnpm filter is required — it builds admin's workspace dependencies (notably `@authhero/adapter-interfaces`) before admin itself. Without it, vite fails to resolve `@authhero/adapter-interfaces` because the symlinked package has no built `dist/`.
107
+
108
+ For SPA client-side routing, add [`public/_redirects`](public/_redirects):
109
+
110
+ ```text
111
+ /* /index.html 200
112
+ ```
113
+
114
+ ### Multiple Cloudflare accounts
115
+
116
+ Cloudflare's Git integration binds a repo to a single Cloudflare account. To deploy the same codebase to several accounts, you have two options:
117
+
118
+ 1. **GitHub Actions + Wrangler** — disconnect the Pages Git integration and deploy from CI with `cloudflare/wrangler-action`, supplying each account's `CLOUDFLARE_API_TOKEN` and `CLOUDFLARE_ACCOUNT_ID` as separate GitHub secrets. Build once, deploy N times via a matrix job. Per-account `VITE_*` values can be set as workflow env at build time, or use the runtime `window.__AUTHHERO_ADMIN_CONFIG__` to ship a single artifact.
119
+ 2. **Fork per environment** — fork the repo into each Cloudflare account's organisation and connect each fork's Pages project to its own fork. Lower setup cost, at the price of having to merge changes upstream and keep forks in sync.
120
+
93
121
  ## Architecture notes
94
122
 
95
123
  - **Dual router**: the outer router in [`src/index.tsx`](src/index.tsx) handles domain selection (`/`), tenant management (`/tenants/*`), per-tenant admin (`/:tenantId/*`) and the OAuth callback (`/auth-callback`). The inner router in [`src/App.tsx`](src/App.tsx) is the react-admin router mounted with `basename="/:tenantId"`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@authhero/admin",
3
- "version": "0.3.0",
3
+ "version": "0.4.1",
4
4
  "private": false,
5
5
  "packageManager": "pnpm@10.32.1",
6
6
  "files": [
@@ -67,7 +67,7 @@
67
67
  "tailwindcss": "^4.0.6",
68
68
  "tw-animate-css": "^1.4.0",
69
69
  "vaul": "^1.1.2",
70
- "@authhero/adapter-interfaces": "2.4.0"
70
+ "@authhero/adapter-interfaces": "2.5.0"
71
71
  },
72
72
  "devDependencies": {
73
73
  "@testing-library/react": "^16.3.2",