@quickback-dev/cli 0.10.16 → 0.11.0
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.
- package/dist/commands/compile.d.ts.map +1 -1
- package/dist/commands/compile.js +40 -2
- package/dist/commands/compile.js.map +1 -1
- package/dist/docs/content.d.ts.map +1 -1
- package/dist/docs/content.js +15 -10
- package/dist/docs/content.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/skill/SKILL.md +142 -1051
- package/dist/skill/agents/quickback-specialist/AGENT.md +36 -0
- package/dist/skill/docs/changelog.md +1225 -0
- package/dist/skill/docs/compiler/claude-code-skill.md +312 -0
- package/dist/skill/docs/compiler/cloud-compiler/authentication.md +63 -0
- package/dist/skill/docs/compiler/cloud-compiler/cli.md +307 -0
- package/dist/skill/docs/compiler/cloud-compiler/endpoints.md +78 -0
- package/dist/skill/docs/compiler/cloud-compiler/index.md +65 -0
- package/dist/skill/docs/compiler/cloud-compiler/local-compiler.md +115 -0
- package/dist/skill/docs/compiler/cloud-compiler/troubleshooting.md +76 -0
- package/dist/skill/docs/compiler/config/agents.md +144 -0
- package/dist/skill/docs/compiler/config/auth.md +109 -0
- package/dist/skill/docs/compiler/config/bindings.md +176 -0
- package/dist/skill/docs/compiler/config/domains.md +149 -0
- package/dist/skill/docs/compiler/config/index.md +419 -0
- package/dist/skill/docs/compiler/config/output.md +338 -0
- package/dist/skill/docs/compiler/config/providers.md +248 -0
- package/dist/skill/docs/compiler/config/security.md +255 -0
- package/dist/skill/docs/compiler/config/single-tenant.md +128 -0
- package/dist/skill/docs/compiler/config/variables.md +157 -0
- package/dist/skill/docs/compiler/definitions/access.md +445 -0
- package/dist/skill/docs/compiler/definitions/actions.md +884 -0
- package/dist/skill/docs/compiler/definitions/concepts.md +52 -0
- package/dist/skill/docs/compiler/definitions/feature.md +164 -0
- package/dist/skill/docs/compiler/definitions/firewall.md +285 -0
- package/dist/skill/docs/compiler/definitions/guards.md +241 -0
- package/dist/skill/docs/compiler/definitions/index.md +219 -0
- package/dist/skill/docs/compiler/definitions/masking.md +241 -0
- package/dist/skill/docs/compiler/definitions/read.md +220 -0
- package/dist/skill/docs/compiler/definitions/schema.md +697 -0
- package/dist/skill/docs/compiler/definitions/validation.md +35 -0
- package/dist/skill/docs/compiler/definitions/views.md +292 -0
- package/dist/skill/docs/compiler/getting-started/claude-code.md +126 -0
- package/dist/skill/docs/compiler/getting-started/full-example.md +431 -0
- package/dist/skill/docs/compiler/getting-started/hand-crafted.md +178 -0
- package/dist/skill/docs/compiler/getting-started/index.md +192 -0
- package/dist/skill/docs/compiler/getting-started/patterns.md +225 -0
- package/dist/skill/docs/compiler/getting-started/template-blog.md +280 -0
- package/dist/skill/docs/compiler/getting-started/template-cloudflare.md +260 -0
- package/dist/skill/docs/compiler/getting-started/template-empty.md +112 -0
- package/dist/skill/docs/compiler/getting-started/templates.md +111 -0
- package/dist/skill/docs/compiler/index.md +85 -0
- package/dist/skill/docs/compiler/targets/hono-api/cloudflare.md +94 -0
- package/dist/skill/docs/compiler/targets/hono-api/database/d1.md +246 -0
- package/dist/skill/docs/compiler/targets/hono-api/database/index.md +16 -0
- package/dist/skill/docs/compiler/targets/hono-api/database/neon.md +144 -0
- package/dist/skill/docs/compiler/targets/hono-api/database/using-d1.md +39 -0
- package/dist/skill/docs/compiler/targets/hono-api/index.md +37 -0
- package/dist/skill/docs/compiler/targets/hono-api/using-the-api/actions-api.md +323 -0
- package/dist/skill/docs/compiler/targets/hono-api/using-the-api/batch-operations.md +357 -0
- package/dist/skill/docs/compiler/targets/hono-api/using-the-api/caching.md +105 -0
- package/dist/skill/docs/compiler/targets/hono-api/using-the-api/crud.md +652 -0
- package/dist/skill/docs/compiler/targets/hono-api/using-the-api/errors.md +224 -0
- package/dist/skill/docs/compiler/targets/hono-api/using-the-api/index.md +37 -0
- package/dist/skill/docs/compiler/targets/hono-api/using-the-api/openapi.md +203 -0
- package/dist/skill/docs/compiler/targets/hono-api/using-the-api/query-params.md +199 -0
- package/dist/skill/docs/compiler/targets/hono-api/using-the-api/views-api.md +161 -0
- package/dist/skill/docs/compiler/targets/index.md +47 -0
- package/dist/skill/docs/compiler/targets/supabase-rls/index.md +55 -0
- package/dist/skill/docs/compiler/targets/supabase-rls/limitations.md +48 -0
- package/dist/skill/docs/compiler/targets/supabase-rls/mappings.md +99 -0
- package/dist/skill/docs/compiler/targets/supabase-rls/setup.md +88 -0
- package/dist/skill/docs/compiler/troubleshooting.md +120 -0
- package/dist/skill/docs/index.md +77 -0
- package/dist/skill/docs/stack/account-ui/customization.md +378 -0
- package/dist/skill/docs/stack/account-ui/environment-variables.md +325 -0
- package/dist/skill/docs/stack/account-ui/features/admin.md +76 -0
- package/dist/skill/docs/stack/account-ui/features/api-keys.md +22 -0
- package/dist/skill/docs/stack/account-ui/features/avatars.md +37 -0
- package/dist/skill/docs/stack/account-ui/features/cli-authorize.md +21 -0
- package/dist/skill/docs/stack/account-ui/features/index.md +291 -0
- package/dist/skill/docs/stack/account-ui/features/organizations.md +29 -0
- package/dist/skill/docs/stack/account-ui/features/passkeys.md +31 -0
- package/dist/skill/docs/stack/account-ui/features/passwordless.md +28 -0
- package/dist/skill/docs/stack/account-ui/features/sessions.md +20 -0
- package/dist/skill/docs/stack/account-ui/hooks.md +209 -0
- package/dist/skill/docs/stack/account-ui/index.md +147 -0
- package/dist/skill/docs/stack/account-ui/library-usage.md +257 -0
- package/dist/skill/docs/stack/account-ui/standalone.md +149 -0
- package/dist/skill/docs/stack/account-ui/with-quickback.md +160 -0
- package/dist/skill/docs/stack/account-ui/worker.md +362 -0
- package/dist/skill/docs/stack/auth/api-keys.md +15 -0
- package/dist/skill/docs/stack/auth/device-auth.md +14 -0
- package/dist/skill/docs/stack/auth/index.md +64 -0
- package/dist/skill/docs/stack/auth/jwt-optimization.md +245 -0
- package/dist/skill/docs/stack/auth/plugins/aws-ses.md +127 -0
- package/dist/skill/docs/stack/auth/plugins/combo-auth.md +74 -0
- package/dist/skill/docs/stack/auth/plugins/index.md +340 -0
- package/dist/skill/docs/stack/auth/plugins/upgrade-anonymous.md +155 -0
- package/dist/skill/docs/stack/auth/security.md +455 -0
- package/dist/skill/docs/stack/auth/using-auth.md +39 -0
- package/dist/skill/docs/stack/cms/actions.md +199 -0
- package/dist/skill/docs/stack/cms/components.md +479 -0
- package/dist/skill/docs/stack/cms/connecting.md +199 -0
- package/dist/skill/docs/stack/cms/dashboard.md +39 -0
- package/dist/skill/docs/stack/cms/index.md +158 -0
- package/dist/skill/docs/stack/cms/inline-editing.md +136 -0
- package/dist/skill/docs/stack/cms/pages.md +275 -0
- package/dist/skill/docs/stack/cms/record-layouts.md +151 -0
- package/dist/skill/docs/stack/cms/schema-format.md +437 -0
- package/dist/skill/docs/stack/cms/schema-registry.md +200 -0
- package/dist/skill/docs/stack/cms/security.md +203 -0
- package/dist/skill/docs/stack/cms/table-views.md +142 -0
- package/dist/skill/docs/stack/index.md +65 -0
- package/dist/skill/docs/stack/queues/handlers.md +317 -0
- package/dist/skill/docs/stack/queues/index.md +56 -0
- package/dist/skill/docs/stack/queues/using-queues.md +192 -0
- package/dist/skill/docs/stack/realtime/durable-objects.md +488 -0
- package/dist/skill/docs/stack/realtime/index.md +73 -0
- package/dist/skill/docs/stack/realtime/partyserver-rooms.md +146 -0
- package/dist/skill/docs/stack/realtime/using-realtime.md +211 -0
- package/dist/skill/docs/stack/storage/index.md +17 -0
- package/dist/skill/docs/stack/storage/kv.md +204 -0
- package/dist/skill/docs/stack/storage/r2.md +232 -0
- package/dist/skill/docs/stack/storage/using-kv.md +70 -0
- package/dist/skill/docs/stack/storage/using-r2.md +55 -0
- package/dist/skill/docs/stack/vector/embeddings.md +554 -0
- package/dist/skill/docs/stack/vector/index.md +44 -0
- package/dist/skill/docs/stack/vector/using-embeddings.md +186 -0
- package/dist/skill/docs/stack/webhooks/inbound.md +186 -0
- package/dist/skill/docs/stack/webhooks/index.md +36 -0
- package/dist/skill/docs/stack/webhooks/outbound.md +281 -0
- package/package.json +1 -1
- package/src/skill/SKILL.md +142 -1051
- package/src/skill/agents/quickback-specialist/AGENT.md +36 -0
- package/src/skill/docs/changelog.md +1225 -0
- package/src/skill/docs/compiler/claude-code-skill.md +312 -0
- package/src/skill/docs/compiler/cloud-compiler/authentication.md +63 -0
- package/src/skill/docs/compiler/cloud-compiler/cli.md +307 -0
- package/src/skill/docs/compiler/cloud-compiler/endpoints.md +78 -0
- package/src/skill/docs/compiler/cloud-compiler/index.md +65 -0
- package/src/skill/docs/compiler/cloud-compiler/local-compiler.md +115 -0
- package/src/skill/docs/compiler/cloud-compiler/troubleshooting.md +76 -0
- package/src/skill/docs/compiler/config/agents.md +144 -0
- package/src/skill/docs/compiler/config/auth.md +109 -0
- package/src/skill/docs/compiler/config/bindings.md +176 -0
- package/src/skill/docs/compiler/config/domains.md +149 -0
- package/src/skill/docs/compiler/config/index.md +419 -0
- package/src/skill/docs/compiler/config/output.md +338 -0
- package/src/skill/docs/compiler/config/providers.md +248 -0
- package/src/skill/docs/compiler/config/security.md +255 -0
- package/src/skill/docs/compiler/config/single-tenant.md +128 -0
- package/src/skill/docs/compiler/config/variables.md +157 -0
- package/src/skill/docs/compiler/definitions/access.md +445 -0
- package/src/skill/docs/compiler/definitions/actions.md +884 -0
- package/src/skill/docs/compiler/definitions/concepts.md +52 -0
- package/src/skill/docs/compiler/definitions/feature.md +164 -0
- package/src/skill/docs/compiler/definitions/firewall.md +285 -0
- package/src/skill/docs/compiler/definitions/guards.md +241 -0
- package/src/skill/docs/compiler/definitions/index.md +219 -0
- package/src/skill/docs/compiler/definitions/masking.md +241 -0
- package/src/skill/docs/compiler/definitions/read.md +220 -0
- package/src/skill/docs/compiler/definitions/schema.md +697 -0
- package/src/skill/docs/compiler/definitions/validation.md +35 -0
- package/src/skill/docs/compiler/definitions/views.md +292 -0
- package/src/skill/docs/compiler/getting-started/claude-code.md +126 -0
- package/src/skill/docs/compiler/getting-started/full-example.md +431 -0
- package/src/skill/docs/compiler/getting-started/hand-crafted.md +178 -0
- package/src/skill/docs/compiler/getting-started/index.md +192 -0
- package/src/skill/docs/compiler/getting-started/patterns.md +225 -0
- package/src/skill/docs/compiler/getting-started/template-blog.md +280 -0
- package/src/skill/docs/compiler/getting-started/template-cloudflare.md +260 -0
- package/src/skill/docs/compiler/getting-started/template-empty.md +112 -0
- package/src/skill/docs/compiler/getting-started/templates.md +111 -0
- package/src/skill/docs/compiler/index.md +85 -0
- package/src/skill/docs/compiler/targets/hono-api/cloudflare.md +94 -0
- package/src/skill/docs/compiler/targets/hono-api/database/d1.md +246 -0
- package/src/skill/docs/compiler/targets/hono-api/database/index.md +16 -0
- package/src/skill/docs/compiler/targets/hono-api/database/neon.md +144 -0
- package/src/skill/docs/compiler/targets/hono-api/database/using-d1.md +39 -0
- package/src/skill/docs/compiler/targets/hono-api/index.md +37 -0
- package/src/skill/docs/compiler/targets/hono-api/using-the-api/actions-api.md +323 -0
- package/src/skill/docs/compiler/targets/hono-api/using-the-api/batch-operations.md +357 -0
- package/src/skill/docs/compiler/targets/hono-api/using-the-api/caching.md +105 -0
- package/src/skill/docs/compiler/targets/hono-api/using-the-api/crud.md +652 -0
- package/src/skill/docs/compiler/targets/hono-api/using-the-api/errors.md +224 -0
- package/src/skill/docs/compiler/targets/hono-api/using-the-api/index.md +37 -0
- package/src/skill/docs/compiler/targets/hono-api/using-the-api/openapi.md +203 -0
- package/src/skill/docs/compiler/targets/hono-api/using-the-api/query-params.md +199 -0
- package/src/skill/docs/compiler/targets/hono-api/using-the-api/views-api.md +161 -0
- package/src/skill/docs/compiler/targets/index.md +47 -0
- package/src/skill/docs/compiler/targets/supabase-rls/index.md +55 -0
- package/src/skill/docs/compiler/targets/supabase-rls/limitations.md +48 -0
- package/src/skill/docs/compiler/targets/supabase-rls/mappings.md +99 -0
- package/src/skill/docs/compiler/targets/supabase-rls/setup.md +88 -0
- package/src/skill/docs/compiler/troubleshooting.md +120 -0
- package/src/skill/docs/index.md +77 -0
- package/src/skill/docs/stack/account-ui/customization.md +378 -0
- package/src/skill/docs/stack/account-ui/environment-variables.md +325 -0
- package/src/skill/docs/stack/account-ui/features/admin.md +76 -0
- package/src/skill/docs/stack/account-ui/features/api-keys.md +22 -0
- package/src/skill/docs/stack/account-ui/features/avatars.md +37 -0
- package/src/skill/docs/stack/account-ui/features/cli-authorize.md +21 -0
- package/src/skill/docs/stack/account-ui/features/index.md +291 -0
- package/src/skill/docs/stack/account-ui/features/organizations.md +29 -0
- package/src/skill/docs/stack/account-ui/features/passkeys.md +31 -0
- package/src/skill/docs/stack/account-ui/features/passwordless.md +28 -0
- package/src/skill/docs/stack/account-ui/features/sessions.md +20 -0
- package/src/skill/docs/stack/account-ui/hooks.md +209 -0
- package/src/skill/docs/stack/account-ui/index.md +147 -0
- package/src/skill/docs/stack/account-ui/library-usage.md +257 -0
- package/src/skill/docs/stack/account-ui/standalone.md +149 -0
- package/src/skill/docs/stack/account-ui/with-quickback.md +160 -0
- package/src/skill/docs/stack/account-ui/worker.md +362 -0
- package/src/skill/docs/stack/auth/api-keys.md +15 -0
- package/src/skill/docs/stack/auth/device-auth.md +14 -0
- package/src/skill/docs/stack/auth/index.md +64 -0
- package/src/skill/docs/stack/auth/jwt-optimization.md +245 -0
- package/src/skill/docs/stack/auth/plugins/aws-ses.md +127 -0
- package/src/skill/docs/stack/auth/plugins/combo-auth.md +74 -0
- package/src/skill/docs/stack/auth/plugins/index.md +340 -0
- package/src/skill/docs/stack/auth/plugins/upgrade-anonymous.md +155 -0
- package/src/skill/docs/stack/auth/security.md +455 -0
- package/src/skill/docs/stack/auth/using-auth.md +39 -0
- package/src/skill/docs/stack/cms/actions.md +199 -0
- package/src/skill/docs/stack/cms/components.md +479 -0
- package/src/skill/docs/stack/cms/connecting.md +199 -0
- package/src/skill/docs/stack/cms/dashboard.md +39 -0
- package/src/skill/docs/stack/cms/index.md +158 -0
- package/src/skill/docs/stack/cms/inline-editing.md +136 -0
- package/src/skill/docs/stack/cms/pages.md +275 -0
- package/src/skill/docs/stack/cms/record-layouts.md +151 -0
- package/src/skill/docs/stack/cms/schema-format.md +437 -0
- package/src/skill/docs/stack/cms/schema-registry.md +200 -0
- package/src/skill/docs/stack/cms/security.md +203 -0
- package/src/skill/docs/stack/cms/table-views.md +142 -0
- package/src/skill/docs/stack/index.md +65 -0
- package/src/skill/docs/stack/queues/handlers.md +317 -0
- package/src/skill/docs/stack/queues/index.md +56 -0
- package/src/skill/docs/stack/queues/using-queues.md +192 -0
- package/src/skill/docs/stack/realtime/durable-objects.md +488 -0
- package/src/skill/docs/stack/realtime/index.md +73 -0
- package/src/skill/docs/stack/realtime/partyserver-rooms.md +146 -0
- package/src/skill/docs/stack/realtime/using-realtime.md +211 -0
- package/src/skill/docs/stack/storage/index.md +17 -0
- package/src/skill/docs/stack/storage/kv.md +204 -0
- package/src/skill/docs/stack/storage/r2.md +232 -0
- package/src/skill/docs/stack/storage/using-kv.md +70 -0
- package/src/skill/docs/stack/storage/using-r2.md +55 -0
- package/src/skill/docs/stack/vector/embeddings.md +554 -0
- package/src/skill/docs/stack/vector/index.md +44 -0
- package/src/skill/docs/stack/vector/using-embeddings.md +186 -0
- package/src/skill/docs/stack/webhooks/inbound.md +186 -0
- package/src/skill/docs/stack/webhooks/index.md +36 -0
- package/src/skill/docs/stack/webhooks/outbound.md +281 -0
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
# Quickback Account UI
|
|
2
|
+
|
|
3
|
+
A complete authentication and account management frontend. It handles login, signup, password reset, profile management, device sessions, passkeys, organizations, and admin — so you don't have to build any of it.
|
|
4
|
+
|
|
5
|
+
## What's Included
|
|
6
|
+
|
|
7
|
+
Account UI is a single React SPA that contains three distinct sections:
|
|
8
|
+
|
|
9
|
+
### Account (every user)
|
|
10
|
+
|
|
11
|
+
Login, signup, profile editing, password management, device sessions, email changes, and account deletion. This is what every user interacts with.
|
|
12
|
+
|
|
13
|
+
Served on its own domain (e.g., `auth.example.com`) or at `/account/` when embedded alongside the CMS.
|
|
14
|
+
|
|
15
|
+
### Organization Management (multi-tenant)
|
|
16
|
+
|
|
17
|
+
Dashboard with org switching, org creation, member invitations, role management, and org settings. Only available when `auth.organizations` is enabled.
|
|
18
|
+
|
|
19
|
+
### Admin Panel (admin users only)
|
|
20
|
+
|
|
21
|
+
User management dashboard — view all users, search, create accounts, ban/unban, reset passwords, and manage sessions. Only accessible to users with the `admin` role. Can be served on its own domain (e.g., `admin.example.com`) via the `adminDomain` config.
|
|
22
|
+
|
|
23
|
+
## Quick Start (Compiler-Embedded)
|
|
24
|
+
|
|
25
|
+
The recommended approach: add `account` to your `quickback.config.ts` and compile. The compiler builds the SPA from source with your project-specific settings baked in.
|
|
26
|
+
|
|
27
|
+
```typescript title="quickback/quickback.config.ts"
|
|
28
|
+
export default {
|
|
29
|
+
name: "my-app",
|
|
30
|
+
template: "hono",
|
|
31
|
+
cms: { domain: "cms.example.com" },
|
|
32
|
+
account: {
|
|
33
|
+
domain: "auth.example.com",
|
|
34
|
+
name: "My App",
|
|
35
|
+
auth: {
|
|
36
|
+
password: true,
|
|
37
|
+
passkey: true,
|
|
38
|
+
organizations: true,
|
|
39
|
+
admin: true,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
// ...providers
|
|
43
|
+
};
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
quickback compile
|
|
48
|
+
npx wrangler deploy
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
That's it. The compiler:
|
|
52
|
+
1. Reads your auth feature flags and branding from the config
|
|
53
|
+
2. Generates a `.env` file with the correct `VITE_*` variables
|
|
54
|
+
3. Builds the SPA from source with Vite (inside Docker)
|
|
55
|
+
4. Excludes routes for disabled features (compile-time tree shaking)
|
|
56
|
+
5. Outputs the built assets alongside your API code
|
|
57
|
+
|
|
58
|
+
No manual `.env` configuration needed. No separate deployment.
|
|
59
|
+
|
|
60
|
+
See [Configuration](/compiler/config) for all `account` options and [Multi-Domain Architecture](/compiler/config/domains) for custom domain setup.
|
|
61
|
+
|
|
62
|
+
### Skip SPA Rebuild
|
|
63
|
+
|
|
64
|
+
After the first compile, skip rebuilding the Account SPA on subsequent compiles:
|
|
65
|
+
|
|
66
|
+
```typescript
|
|
67
|
+
account: { build: false, /* ...other options */ }
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Useful when iterating on API features — saves significant compile time. Set back to `true` (or omit) when you need to update the Account UI.
|
|
71
|
+
|
|
72
|
+
### Custom Output Directory
|
|
73
|
+
|
|
74
|
+
```typescript
|
|
75
|
+
account: { outputDir: "my-custom-path/account" }
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Changes where compiled Account assets are placed, instead of the default `src/apps/account/`.
|
|
79
|
+
|
|
80
|
+
## Compile-Time Feature Gating
|
|
81
|
+
|
|
82
|
+
Auth feature flags control which pages are included in the bundle:
|
|
83
|
+
|
|
84
|
+
| Flag | Pages Included |
|
|
85
|
+
|------|---------------|
|
|
86
|
+
| `auth.password` | Password login, inline password change on profile |
|
|
87
|
+
| `auth.emailOTP` | Email OTP login flow, email-based password reset |
|
|
88
|
+
| `auth.passkey` | Passkey setup and management |
|
|
89
|
+
| `auth.organizations` | Dashboard, org creation, member management, invitations |
|
|
90
|
+
| `auth.admin` | Admin panel (user management) |
|
|
91
|
+
|
|
92
|
+
When a flag is `false`, the corresponding route files are **removed before the Vite build** — they never appear in the JavaScript bundle. This keeps production bundles minimal.
|
|
93
|
+
|
|
94
|
+
## Standalone Usage
|
|
95
|
+
|
|
96
|
+
Account UI also works outside of Quickback:
|
|
97
|
+
|
|
98
|
+
### Template (own the source)
|
|
99
|
+
|
|
100
|
+
Clone the repo and customize directly:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
npx degit Kardoe-com/quickback-better-auth-account-ui my-account-app
|
|
104
|
+
cd my-account-app
|
|
105
|
+
npm install
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Configure via `.env` files and deploy as a standalone Cloudflare Worker. See [Standalone Usage](/stack/account-ui/standalone) for Better Auth backends or [With Quickback](/stack/account-ui/with-quickback) for Quickback-compiled backends.
|
|
109
|
+
|
|
110
|
+
### Library (npm package)
|
|
111
|
+
|
|
112
|
+
Install as a dependency:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
npm install quickback-better-auth-account-ui
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
```tsx
|
|
119
|
+
import { AuthApp, setAppConfig } from 'quickback-better-auth-account-ui';
|
|
120
|
+
import 'quickback-better-auth-account-ui/styles.css';
|
|
121
|
+
|
|
122
|
+
setAppConfig({
|
|
123
|
+
authRoute: 'quickback',
|
|
124
|
+
name: 'My App',
|
|
125
|
+
});
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
See [Library Usage](/stack/account-ui/library-usage) for details.
|
|
129
|
+
|
|
130
|
+
## Features
|
|
131
|
+
|
|
132
|
+
- **Authentication** — Email/password, passkeys (WebAuthn), email OTP, magic links, email verification, password reset
|
|
133
|
+
- **Account Management** — Profile editing, avatar upload, password changes, device/session management, account deletion
|
|
134
|
+
- **Organizations** — Multi-tenant org management with owner/admin/member roles, invitations, and org settings
|
|
135
|
+
- **Admin Panel** — User management dashboard with search, create, ban/unban, password reset, and session viewing
|
|
136
|
+
- **API Keys** — Generate and manage API keys for programmatic access
|
|
137
|
+
- **CLI Authorization** — Device authorization flow for `quickback login`
|
|
138
|
+
|
|
139
|
+
## Next Steps
|
|
140
|
+
|
|
141
|
+
- **[With Quickback](/stack/account-ui/with-quickback)** — Compiler-embedded and standalone setup
|
|
142
|
+
- **[Standalone Usage](/stack/account-ui/standalone)** — Use with any Better Auth backend
|
|
143
|
+
- **[Library Usage](/stack/account-ui/library-usage)** — Import as an npm package
|
|
144
|
+
- **[Feature Flags](/stack/account-ui/features)** — Enable and disable features
|
|
145
|
+
- **[Environment Variables](/stack/account-ui/environment-variables)** — Configuration reference
|
|
146
|
+
- **[Customization](/stack/account-ui/customization)** — Branding, labels, and theming
|
|
147
|
+
- **[Multi-Domain Architecture](/compiler/config/domains)** — Custom domains and hostname routing
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
# Library Usage
|
|
2
|
+
|
|
3
|
+
Instead of cloning the template, you can install Account UI as an npm package. This gives you automatic updates via `npm update` while configuring the UI through `setAppConfig()`.
|
|
4
|
+
|
|
5
|
+
> **When to use library mode**
|
|
6
|
+
>
|
|
7
|
+
> Use library mode when you want to embed Account UI into an existing React application without owning the source. For full control over the source code, use the [standalone template](/stack/account-ui/standalone) instead.
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install quickback-better-auth-account-ui
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
### Peer Dependencies
|
|
17
|
+
|
|
18
|
+
Account UI expects these packages in your app:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install react react-dom react-router-dom @tanstack/react-query
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Basic Setup
|
|
25
|
+
|
|
26
|
+
### 1. Import and Configure
|
|
27
|
+
|
|
28
|
+
```tsx title="src/main.tsx"
|
|
29
|
+
import React from 'react';
|
|
30
|
+
import ReactDOM from 'react-dom/client';
|
|
31
|
+
import { BrowserRouter } from 'react-router-dom';
|
|
32
|
+
import { AuthApp, setAppConfig } from 'quickback-better-auth-account-ui';
|
|
33
|
+
import 'quickback-better-auth-account-ui/styles.css';
|
|
34
|
+
|
|
35
|
+
setAppConfig({
|
|
36
|
+
authRoute: 'quickback', // or 'better-auth' for standalone Better Auth
|
|
37
|
+
name: 'My App',
|
|
38
|
+
companyName: 'My Company Inc.',
|
|
39
|
+
tagline: 'Build faster, ship sooner',
|
|
40
|
+
description: 'My app description',
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
ReactDOM.createRoot(document.getElementById('root')!).render(
|
|
44
|
+
<React.StrictMode>
|
|
45
|
+
<BrowserRouter>
|
|
46
|
+
<AuthApp />
|
|
47
|
+
</BrowserRouter>
|
|
48
|
+
</React.StrictMode>
|
|
49
|
+
);
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### 2. Set API URLs
|
|
53
|
+
|
|
54
|
+
The library reads API URLs from `globalThis` variables. Set these before importing the library:
|
|
55
|
+
|
|
56
|
+
```tsx title="src/main.tsx"
|
|
57
|
+
// Single catch-all: API + Account + CMS URLs are all derived from this origin.
|
|
58
|
+
(globalThis as any).__QUICKBACK_URL__ = 'https://secure.example.com';
|
|
59
|
+
(globalThis as any).__QUICKBACK_APP_URL__ = 'https://app.example.com';
|
|
60
|
+
|
|
61
|
+
// Then import dynamically to ensure globals are set first
|
|
62
|
+
const { AuthApp, setAppConfig } = await import('quickback-better-auth-account-ui');
|
|
63
|
+
await import('quickback-better-auth-account-ui/styles.css');
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
If your API lives on a different subdomain, set `__QUICKBACK_API_URL__` explicitly instead (or alongside) — it takes precedence over the catch-all:
|
|
67
|
+
|
|
68
|
+
```tsx
|
|
69
|
+
(globalThis as any).__QUICKBACK_URL__ = 'https://secure.example.com'; // catch-all
|
|
70
|
+
(globalThis as any).__QUICKBACK_API_URL__ = 'https://api.example.com'; // explicit override
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Or with Vite environment variables:
|
|
74
|
+
|
|
75
|
+
```tsx title="src/main.tsx"
|
|
76
|
+
(globalThis as any).__QUICKBACK_URL__ = import.meta.env.VITE_QUICKBACK_URL;
|
|
77
|
+
(globalThis as any).__QUICKBACK_API_URL__ = import.meta.env.VITE_QUICKBACK_API_URL;
|
|
78
|
+
(globalThis as any).__QUICKBACK_APP_URL__ = import.meta.env.VITE_QUICKBACK_APP_URL;
|
|
79
|
+
|
|
80
|
+
Promise.all([
|
|
81
|
+
import('quickback-better-auth-account-ui'),
|
|
82
|
+
import('quickback-better-auth-account-ui/styles.css'),
|
|
83
|
+
]).then(([{ AuthApp, setAppConfig }]) => {
|
|
84
|
+
setAppConfig({
|
|
85
|
+
authRoute: 'quickback',
|
|
86
|
+
name: import.meta.env.VITE_APP_NAME || 'My App',
|
|
87
|
+
companyName: import.meta.env.VITE_COMPANY_NAME || 'My Company',
|
|
88
|
+
tagline: import.meta.env.VITE_APP_TAGLINE || 'Welcome',
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
ReactDOM.createRoot(document.getElementById('root')!).render(
|
|
92
|
+
<React.StrictMode>
|
|
93
|
+
<BrowserRouter>
|
|
94
|
+
<AuthApp />
|
|
95
|
+
</BrowserRouter>
|
|
96
|
+
</React.StrictMode>
|
|
97
|
+
);
|
|
98
|
+
});
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Cloudflare Worker
|
|
102
|
+
|
|
103
|
+
The library exports a Cloudflare Worker entry point for SPA routing and static asset serving:
|
|
104
|
+
|
|
105
|
+
```ts title="src/worker.ts"
|
|
106
|
+
export { default } from 'quickback-better-auth-account-ui/worker';
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Or extend it with custom logic:
|
|
110
|
+
|
|
111
|
+
```ts title="src/worker.ts"
|
|
112
|
+
import { createAuthWorker } from 'quickback-better-auth-account-ui/worker';
|
|
113
|
+
|
|
114
|
+
export default createAuthWorker();
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Configuration via `setAppConfig()`
|
|
118
|
+
|
|
119
|
+
In library mode, all configuration happens through `setAppConfig()` instead of environment variables.
|
|
120
|
+
|
|
121
|
+
### Auth Route Mode
|
|
122
|
+
|
|
123
|
+
```ts
|
|
124
|
+
setAppConfig({
|
|
125
|
+
authRoute: 'quickback', // Quickback API: /auth/v1, /api/v1, /storage/v1
|
|
126
|
+
// or
|
|
127
|
+
authRoute: 'better-auth', // Better Auth default: /api/auth
|
|
128
|
+
});
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Branding
|
|
132
|
+
|
|
133
|
+
```ts
|
|
134
|
+
setAppConfig({
|
|
135
|
+
name: 'Acme SaaS',
|
|
136
|
+
companyName: 'Acme Corporation',
|
|
137
|
+
tagline: 'Build faster, ship sooner',
|
|
138
|
+
description: 'The complete platform for modern web applications',
|
|
139
|
+
branding: {
|
|
140
|
+
primaryColor: '#3b82f6',
|
|
141
|
+
logoUrl: '/logo.png',
|
|
142
|
+
faviconUrl: '/favicon.ico',
|
|
143
|
+
},
|
|
144
|
+
});
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### Labels and Messages
|
|
148
|
+
|
|
149
|
+
```ts
|
|
150
|
+
setAppConfig({
|
|
151
|
+
labels: {
|
|
152
|
+
organizations: 'Workspaces',
|
|
153
|
+
terms: 'Terms and Conditions',
|
|
154
|
+
privacy: 'Privacy Notice',
|
|
155
|
+
},
|
|
156
|
+
messages: {
|
|
157
|
+
noOrganizations: "You haven't joined any workspaces yet.",
|
|
158
|
+
createOrganization: 'Create Workspace',
|
|
159
|
+
},
|
|
160
|
+
});
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Routes
|
|
164
|
+
|
|
165
|
+
```ts
|
|
166
|
+
setAppConfig({
|
|
167
|
+
routes: {
|
|
168
|
+
public: {
|
|
169
|
+
login: '/sign-in',
|
|
170
|
+
signup: '/sign-up',
|
|
171
|
+
},
|
|
172
|
+
organizations: {
|
|
173
|
+
list: '/workspaces',
|
|
174
|
+
create: '/workspaces/new',
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
});
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### Password and Session
|
|
181
|
+
|
|
182
|
+
```ts
|
|
183
|
+
setAppConfig({
|
|
184
|
+
auth: {
|
|
185
|
+
passwordRequirements: {
|
|
186
|
+
minLength: 12,
|
|
187
|
+
requireSymbols: true,
|
|
188
|
+
},
|
|
189
|
+
sessionDuration: 7 * 24 * 60 * 60, // 7 days
|
|
190
|
+
},
|
|
191
|
+
});
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
See [Customization](/stack/account-ui/customization) for the full reference of all configurable options.
|
|
195
|
+
|
|
196
|
+
## Exports
|
|
197
|
+
|
|
198
|
+
The library provides the following exports:
|
|
199
|
+
|
|
200
|
+
### Main Entry (`quickback-better-auth-account-ui`)
|
|
201
|
+
|
|
202
|
+
| Export | Type | Description |
|
|
203
|
+
|--------|------|-------------|
|
|
204
|
+
| `AuthApp` | Component | The main React application component |
|
|
205
|
+
| `authClient` | Object | Pre-configured Better Auth client |
|
|
206
|
+
| `appConfig` | Object | Current app configuration |
|
|
207
|
+
| `setAppConfig` | Function | Set app configuration overrides |
|
|
208
|
+
| `createAppConfig` | Function | Create a new config object |
|
|
209
|
+
| `getApiBase` | Function | Get the current API base URL |
|
|
210
|
+
| `setApiBase` | Function | Override the API base URL |
|
|
211
|
+
| `getAuthApiUrl` | Function | Get the auth API URL |
|
|
212
|
+
| `getDataApiUrl` | Function | Get the data API URL |
|
|
213
|
+
| `getStorageApiUrl` | Function | Get the storage API URL |
|
|
214
|
+
|
|
215
|
+
### Styles (`quickback-better-auth-account-ui/styles.css`)
|
|
216
|
+
|
|
217
|
+
The compiled CSS for the Account UI. Must be imported for the UI to render correctly.
|
|
218
|
+
|
|
219
|
+
### Worker (`quickback-better-auth-account-ui/worker`)
|
|
220
|
+
|
|
221
|
+
| Export | Type | Description |
|
|
222
|
+
|--------|------|-------------|
|
|
223
|
+
| `default` | Worker | Cloudflare Worker with SPA routing |
|
|
224
|
+
| `createAuthWorker` | Function | Factory for creating a worker instance |
|
|
225
|
+
|
|
226
|
+
## Custom Styles
|
|
227
|
+
|
|
228
|
+
Override styles by importing your CSS after the library styles:
|
|
229
|
+
|
|
230
|
+
```ts
|
|
231
|
+
import 'quickback-better-auth-account-ui/styles.css';
|
|
232
|
+
import './my-overrides.css';
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
```css title="my-overrides.css"
|
|
236
|
+
:root {
|
|
237
|
+
--primary: 59 130 246;
|
|
238
|
+
--primary-foreground: 255 255 255;
|
|
239
|
+
}
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
## Updating
|
|
243
|
+
|
|
244
|
+
Update to the latest version:
|
|
245
|
+
|
|
246
|
+
```bash
|
|
247
|
+
npm update quickback-better-auth-account-ui
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
The library follows semantic versioning. Check the [changelog](https://github.com/Kardoe-com/quickback-better-auth-account-ui/releases) for breaking changes.
|
|
251
|
+
|
|
252
|
+
## Next Steps
|
|
253
|
+
|
|
254
|
+
- **[Customization](/stack/account-ui/customization)** — Full configuration reference
|
|
255
|
+
- **[Feature Flags](/stack/account-ui/features)** — Enable and disable features
|
|
256
|
+
- **[Worker Setup](/stack/account-ui/worker)** — Deploy to Cloudflare Workers
|
|
257
|
+
- **[With Quickback](/stack/account-ui/with-quickback)** — Quickback-specific configuration
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# Standalone Usage
|
|
2
|
+
|
|
3
|
+
Account UI can be used with **any Better Auth-powered backend**, not just Quickback-compiled projects. This makes it a drop-in authentication frontend for any app using Better Auth.
|
|
4
|
+
|
|
5
|
+
> **Prefer npm install?**
|
|
6
|
+
>
|
|
7
|
+
> If you'd rather import Account UI as a library into an existing React app instead of cloning the template, see [Library Usage](/stack/account-ui/library-usage).
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## Requirements
|
|
11
|
+
|
|
12
|
+
- A backend running [Better Auth](https://better-auth.com) with API endpoints
|
|
13
|
+
- Node.js 18+ and npm/pnpm/bun
|
|
14
|
+
- A Cloudflare account (for deployment)
|
|
15
|
+
|
|
16
|
+
## Setup
|
|
17
|
+
|
|
18
|
+
### 1. Clone or Install the Account UI
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npx degit Kardoe-com/quickback-better-auth-account-ui my-account-app
|
|
22
|
+
cd my-account-app
|
|
23
|
+
npm install
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### 2. Configure the Auth Route Mode
|
|
27
|
+
|
|
28
|
+
The key difference from Quickback mode is the `VITE_AUTH_ROUTE` variable. Set it to `better-auth` to use Better Auth's default API paths:
|
|
29
|
+
|
|
30
|
+
```bash title=".env"
|
|
31
|
+
# Auth route mode — use 'better-auth' for standalone
|
|
32
|
+
VITE_AUTH_ROUTE=better-auth
|
|
33
|
+
|
|
34
|
+
# Your Better Auth backend URL (single catch-all — see below)
|
|
35
|
+
VITE_QUICKBACK_URL=https://secure.example.com
|
|
36
|
+
|
|
37
|
+
# Where this Account UI is hosted
|
|
38
|
+
VITE_ACCOUNT_APP_URL=https://account.example.com
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
`VITE_QUICKBACK_URL` is the recommended one-variable setup. If your API lives on a separate subdomain, set `VITE_QUICKBACK_API_URL` explicitly — it takes precedence.
|
|
42
|
+
|
|
43
|
+
This configures the auth client to use `/api/auth` as the base path (Better Auth's default), instead of Quickback's `/auth/v1`.
|
|
44
|
+
|
|
45
|
+
### 3. Configure Your App
|
|
46
|
+
|
|
47
|
+
```bash title=".env"
|
|
48
|
+
# App identity
|
|
49
|
+
VITE_APP_NAME=My App
|
|
50
|
+
VITE_APP_TAGLINE=Welcome to My App
|
|
51
|
+
|
|
52
|
+
# Redirect after login
|
|
53
|
+
VITE_QUICKBACK_APP_URL=https://app.example.com
|
|
54
|
+
|
|
55
|
+
# Feature flags
|
|
56
|
+
ENABLE_SIGNUP=true
|
|
57
|
+
ENABLE_ORGANIZATIONS=true
|
|
58
|
+
ENABLE_PASSKEY=true
|
|
59
|
+
ENABLE_EMAIL_OTP=true
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
See [Environment Variables](/stack/account-ui/environment-variables) for the complete reference.
|
|
63
|
+
|
|
64
|
+
### 4. Build and Deploy
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
npm run build
|
|
68
|
+
npx wrangler deploy
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Auth Route Modes
|
|
72
|
+
|
|
73
|
+
Account UI supports three routing modes, controlled by `VITE_AUTH_ROUTE`:
|
|
74
|
+
|
|
75
|
+
| Mode | Value | Auth Path | Data Path | Storage Path |
|
|
76
|
+
|------|-------|-----------|-----------|--------------|
|
|
77
|
+
| Better Auth | `better-auth` | `/api/auth` | — | — |
|
|
78
|
+
| Quickback | `quickback` | `/auth/v1` | `/api/v1` | `/storage/v1` |
|
|
79
|
+
| Custom | `custom` | Custom | Custom | Custom |
|
|
80
|
+
|
|
81
|
+
### Better Auth Mode (Default)
|
|
82
|
+
|
|
83
|
+
Routes all auth requests to `/api/auth/*` — the standard Better Auth convention:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
VITE_AUTH_ROUTE=better-auth
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Custom Mode
|
|
90
|
+
|
|
91
|
+
For non-standard setups, use custom mode with explicit paths:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
VITE_AUTH_ROUTE=custom
|
|
95
|
+
VITE_AUTH_BASE_PATH=/my-auth
|
|
96
|
+
VITE_DATA_BASE_PATH=/my-api
|
|
97
|
+
VITE_STORAGE_BASE_PATH=/my-storage
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Backend Requirements
|
|
101
|
+
|
|
102
|
+
Your Better Auth backend must have the following plugins enabled for full Account UI functionality:
|
|
103
|
+
|
|
104
|
+
| Feature | Required Plugin | Required For |
|
|
105
|
+
|---------|----------------|--------------|
|
|
106
|
+
| Organizations | `organization` | Multi-tenant org management |
|
|
107
|
+
| Admin panel | `admin` | User management dashboard |
|
|
108
|
+
| API keys | `apiKey` | API key generation UI |
|
|
109
|
+
| Passkeys | `@better-auth/passkey` | WebAuthn authentication |
|
|
110
|
+
| Email OTP | `emailOTP` | One-time password login |
|
|
111
|
+
| CLI login | `deviceAuthorization` | `quickback login` flow |
|
|
112
|
+
|
|
113
|
+
Only enable the features that match your backend's plugin configuration. Disable features for plugins you haven't installed:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
# If your backend doesn't have the organization plugin:
|
|
117
|
+
ENABLE_ORGANIZATIONS=false
|
|
118
|
+
|
|
119
|
+
# If you haven't set up passkeys:
|
|
120
|
+
ENABLE_PASSKEYS=false
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## CORS Configuration
|
|
124
|
+
|
|
125
|
+
Your Better Auth backend must allow requests from the Account UI's domain. Configure CORS to include:
|
|
126
|
+
|
|
127
|
+
```typescript
|
|
128
|
+
// In your Better Auth config
|
|
129
|
+
trustedOrigins: [
|
|
130
|
+
"https://account.example.com", // Account UI domain
|
|
131
|
+
],
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Differences from Quickback Mode
|
|
135
|
+
|
|
136
|
+
| Aspect | Standalone | With Quickback |
|
|
137
|
+
|--------|-----------|----------------|
|
|
138
|
+
| Auth routes | `/api/auth/*` | `/auth/v1/*` |
|
|
139
|
+
| Data API | Not used | `/api/v1/*` |
|
|
140
|
+
| Storage API | Not used | `/storage/v1/*` |
|
|
141
|
+
| File uploads | Manual setup | Auto-configured |
|
|
142
|
+
| Backend | Any Better Auth app | Quickback-compiled |
|
|
143
|
+
|
|
144
|
+
## Next Steps
|
|
145
|
+
|
|
146
|
+
- [Environment Variables](/stack/account-ui/environment-variables) — Complete configuration reference
|
|
147
|
+
- [Customization](/stack/account-ui/customization) — Branding, labels, and theming
|
|
148
|
+
- [Worker Setup](/stack/account-ui/worker) — Cloudflare Workers deployment
|
|
149
|
+
- [Feature Flags](/stack/account-ui/features) — Enable and disable features
|