@quickback-dev/cli 0.10.16 → 0.10.20

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 (249) hide show
  1. package/dist/commands/compile.d.ts.map +1 -1
  2. package/dist/commands/compile.js +40 -2
  3. package/dist/commands/compile.js.map +1 -1
  4. package/dist/docs/content.js +6 -6
  5. package/dist/docs/content.js.map +1 -1
  6. package/dist/index.js +1 -1
  7. package/dist/skill/SKILL.md +142 -1051
  8. package/dist/skill/agents/quickback-specialist/AGENT.md +36 -0
  9. package/dist/skill/docs/changelog.md +1192 -0
  10. package/dist/skill/docs/compiler/claude-code-skill.md +312 -0
  11. package/dist/skill/docs/compiler/cloud-compiler/authentication.md +63 -0
  12. package/dist/skill/docs/compiler/cloud-compiler/cli.md +307 -0
  13. package/dist/skill/docs/compiler/cloud-compiler/endpoints.md +78 -0
  14. package/dist/skill/docs/compiler/cloud-compiler/index.md +65 -0
  15. package/dist/skill/docs/compiler/cloud-compiler/local-compiler.md +115 -0
  16. package/dist/skill/docs/compiler/cloud-compiler/troubleshooting.md +76 -0
  17. package/dist/skill/docs/compiler/config/agents.md +144 -0
  18. package/dist/skill/docs/compiler/config/auth.md +109 -0
  19. package/dist/skill/docs/compiler/config/bindings.md +176 -0
  20. package/dist/skill/docs/compiler/config/domains.md +149 -0
  21. package/dist/skill/docs/compiler/config/index.md +419 -0
  22. package/dist/skill/docs/compiler/config/output.md +338 -0
  23. package/dist/skill/docs/compiler/config/providers.md +248 -0
  24. package/dist/skill/docs/compiler/config/security.md +255 -0
  25. package/dist/skill/docs/compiler/config/single-tenant.md +128 -0
  26. package/dist/skill/docs/compiler/config/variables.md +157 -0
  27. package/dist/skill/docs/compiler/definitions/access.md +445 -0
  28. package/dist/skill/docs/compiler/definitions/actions.md +884 -0
  29. package/dist/skill/docs/compiler/definitions/concepts.md +52 -0
  30. package/dist/skill/docs/compiler/definitions/feature.md +164 -0
  31. package/dist/skill/docs/compiler/definitions/firewall.md +285 -0
  32. package/dist/skill/docs/compiler/definitions/guards.md +241 -0
  33. package/dist/skill/docs/compiler/definitions/index.md +219 -0
  34. package/dist/skill/docs/compiler/definitions/masking.md +241 -0
  35. package/dist/skill/docs/compiler/definitions/read.md +220 -0
  36. package/dist/skill/docs/compiler/definitions/schema.md +697 -0
  37. package/dist/skill/docs/compiler/definitions/validation.md +35 -0
  38. package/dist/skill/docs/compiler/definitions/views.md +292 -0
  39. package/dist/skill/docs/compiler/getting-started/claude-code.md +126 -0
  40. package/dist/skill/docs/compiler/getting-started/full-example.md +431 -0
  41. package/dist/skill/docs/compiler/getting-started/hand-crafted.md +178 -0
  42. package/dist/skill/docs/compiler/getting-started/index.md +192 -0
  43. package/dist/skill/docs/compiler/getting-started/patterns.md +225 -0
  44. package/dist/skill/docs/compiler/getting-started/template-blog.md +280 -0
  45. package/dist/skill/docs/compiler/getting-started/template-cloudflare.md +260 -0
  46. package/dist/skill/docs/compiler/getting-started/template-empty.md +112 -0
  47. package/dist/skill/docs/compiler/getting-started/templates.md +111 -0
  48. package/dist/skill/docs/compiler/index.md +85 -0
  49. package/dist/skill/docs/compiler/targets/hono-api/cloudflare.md +94 -0
  50. package/dist/skill/docs/compiler/targets/hono-api/database/d1.md +246 -0
  51. package/dist/skill/docs/compiler/targets/hono-api/database/index.md +16 -0
  52. package/dist/skill/docs/compiler/targets/hono-api/database/neon.md +144 -0
  53. package/dist/skill/docs/compiler/targets/hono-api/database/using-d1.md +39 -0
  54. package/dist/skill/docs/compiler/targets/hono-api/index.md +37 -0
  55. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/actions-api.md +323 -0
  56. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/batch-operations.md +357 -0
  57. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/caching.md +105 -0
  58. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/crud.md +652 -0
  59. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/errors.md +224 -0
  60. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/index.md +37 -0
  61. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/openapi.md +203 -0
  62. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/query-params.md +199 -0
  63. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/views-api.md +161 -0
  64. package/dist/skill/docs/compiler/targets/index.md +47 -0
  65. package/dist/skill/docs/compiler/targets/supabase-rls/index.md +55 -0
  66. package/dist/skill/docs/compiler/targets/supabase-rls/limitations.md +48 -0
  67. package/dist/skill/docs/compiler/targets/supabase-rls/mappings.md +99 -0
  68. package/dist/skill/docs/compiler/targets/supabase-rls/setup.md +88 -0
  69. package/dist/skill/docs/compiler/troubleshooting.md +120 -0
  70. package/dist/skill/docs/index.md +77 -0
  71. package/dist/skill/docs/stack/account-ui/customization.md +378 -0
  72. package/dist/skill/docs/stack/account-ui/environment-variables.md +325 -0
  73. package/dist/skill/docs/stack/account-ui/features/admin.md +76 -0
  74. package/dist/skill/docs/stack/account-ui/features/api-keys.md +22 -0
  75. package/dist/skill/docs/stack/account-ui/features/avatars.md +37 -0
  76. package/dist/skill/docs/stack/account-ui/features/cli-authorize.md +21 -0
  77. package/dist/skill/docs/stack/account-ui/features/index.md +291 -0
  78. package/dist/skill/docs/stack/account-ui/features/organizations.md +29 -0
  79. package/dist/skill/docs/stack/account-ui/features/passkeys.md +31 -0
  80. package/dist/skill/docs/stack/account-ui/features/passwordless.md +28 -0
  81. package/dist/skill/docs/stack/account-ui/features/sessions.md +20 -0
  82. package/dist/skill/docs/stack/account-ui/hooks.md +209 -0
  83. package/dist/skill/docs/stack/account-ui/index.md +147 -0
  84. package/dist/skill/docs/stack/account-ui/library-usage.md +257 -0
  85. package/dist/skill/docs/stack/account-ui/standalone.md +149 -0
  86. package/dist/skill/docs/stack/account-ui/with-quickback.md +160 -0
  87. package/dist/skill/docs/stack/account-ui/worker.md +362 -0
  88. package/dist/skill/docs/stack/auth/api-keys.md +15 -0
  89. package/dist/skill/docs/stack/auth/device-auth.md +14 -0
  90. package/dist/skill/docs/stack/auth/index.md +64 -0
  91. package/dist/skill/docs/stack/auth/jwt-optimization.md +245 -0
  92. package/dist/skill/docs/stack/auth/plugins/aws-ses.md +127 -0
  93. package/dist/skill/docs/stack/auth/plugins/combo-auth.md +74 -0
  94. package/dist/skill/docs/stack/auth/plugins/index.md +228 -0
  95. package/dist/skill/docs/stack/auth/plugins/upgrade-anonymous.md +155 -0
  96. package/dist/skill/docs/stack/auth/security.md +455 -0
  97. package/dist/skill/docs/stack/auth/using-auth.md +39 -0
  98. package/dist/skill/docs/stack/cms/actions.md +199 -0
  99. package/dist/skill/docs/stack/cms/components.md +479 -0
  100. package/dist/skill/docs/stack/cms/connecting.md +199 -0
  101. package/dist/skill/docs/stack/cms/dashboard.md +39 -0
  102. package/dist/skill/docs/stack/cms/index.md +158 -0
  103. package/dist/skill/docs/stack/cms/inline-editing.md +136 -0
  104. package/dist/skill/docs/stack/cms/pages.md +275 -0
  105. package/dist/skill/docs/stack/cms/record-layouts.md +151 -0
  106. package/dist/skill/docs/stack/cms/schema-format.md +437 -0
  107. package/dist/skill/docs/stack/cms/schema-registry.md +200 -0
  108. package/dist/skill/docs/stack/cms/security.md +203 -0
  109. package/dist/skill/docs/stack/cms/table-views.md +142 -0
  110. package/dist/skill/docs/stack/index.md +65 -0
  111. package/dist/skill/docs/stack/queues/handlers.md +317 -0
  112. package/dist/skill/docs/stack/queues/index.md +56 -0
  113. package/dist/skill/docs/stack/queues/using-queues.md +192 -0
  114. package/dist/skill/docs/stack/realtime/durable-objects.md +488 -0
  115. package/dist/skill/docs/stack/realtime/index.md +67 -0
  116. package/dist/skill/docs/stack/realtime/using-realtime.md +211 -0
  117. package/dist/skill/docs/stack/storage/index.md +17 -0
  118. package/dist/skill/docs/stack/storage/kv.md +204 -0
  119. package/dist/skill/docs/stack/storage/r2.md +232 -0
  120. package/dist/skill/docs/stack/storage/using-kv.md +70 -0
  121. package/dist/skill/docs/stack/storage/using-r2.md +55 -0
  122. package/dist/skill/docs/stack/vector/embeddings.md +554 -0
  123. package/dist/skill/docs/stack/vector/index.md +44 -0
  124. package/dist/skill/docs/stack/vector/using-embeddings.md +186 -0
  125. package/dist/skill/docs/stack/webhooks/inbound.md +186 -0
  126. package/dist/skill/docs/stack/webhooks/index.md +36 -0
  127. package/dist/skill/docs/stack/webhooks/outbound.md +281 -0
  128. package/package.json +1 -1
  129. package/src/skill/SKILL.md +142 -1051
  130. package/src/skill/agents/quickback-specialist/AGENT.md +36 -0
  131. package/src/skill/docs/changelog.md +1192 -0
  132. package/src/skill/docs/compiler/claude-code-skill.md +312 -0
  133. package/src/skill/docs/compiler/cloud-compiler/authentication.md +63 -0
  134. package/src/skill/docs/compiler/cloud-compiler/cli.md +307 -0
  135. package/src/skill/docs/compiler/cloud-compiler/endpoints.md +78 -0
  136. package/src/skill/docs/compiler/cloud-compiler/index.md +65 -0
  137. package/src/skill/docs/compiler/cloud-compiler/local-compiler.md +115 -0
  138. package/src/skill/docs/compiler/cloud-compiler/troubleshooting.md +76 -0
  139. package/src/skill/docs/compiler/config/agents.md +144 -0
  140. package/src/skill/docs/compiler/config/auth.md +109 -0
  141. package/src/skill/docs/compiler/config/bindings.md +176 -0
  142. package/src/skill/docs/compiler/config/domains.md +149 -0
  143. package/src/skill/docs/compiler/config/index.md +419 -0
  144. package/src/skill/docs/compiler/config/output.md +338 -0
  145. package/src/skill/docs/compiler/config/providers.md +248 -0
  146. package/src/skill/docs/compiler/config/security.md +255 -0
  147. package/src/skill/docs/compiler/config/single-tenant.md +128 -0
  148. package/src/skill/docs/compiler/config/variables.md +157 -0
  149. package/src/skill/docs/compiler/definitions/access.md +445 -0
  150. package/src/skill/docs/compiler/definitions/actions.md +884 -0
  151. package/src/skill/docs/compiler/definitions/concepts.md +52 -0
  152. package/src/skill/docs/compiler/definitions/feature.md +164 -0
  153. package/src/skill/docs/compiler/definitions/firewall.md +285 -0
  154. package/src/skill/docs/compiler/definitions/guards.md +241 -0
  155. package/src/skill/docs/compiler/definitions/index.md +219 -0
  156. package/src/skill/docs/compiler/definitions/masking.md +241 -0
  157. package/src/skill/docs/compiler/definitions/read.md +220 -0
  158. package/src/skill/docs/compiler/definitions/schema.md +697 -0
  159. package/src/skill/docs/compiler/definitions/validation.md +35 -0
  160. package/src/skill/docs/compiler/definitions/views.md +292 -0
  161. package/src/skill/docs/compiler/getting-started/claude-code.md +126 -0
  162. package/src/skill/docs/compiler/getting-started/full-example.md +431 -0
  163. package/src/skill/docs/compiler/getting-started/hand-crafted.md +178 -0
  164. package/src/skill/docs/compiler/getting-started/index.md +192 -0
  165. package/src/skill/docs/compiler/getting-started/patterns.md +225 -0
  166. package/src/skill/docs/compiler/getting-started/template-blog.md +280 -0
  167. package/src/skill/docs/compiler/getting-started/template-cloudflare.md +260 -0
  168. package/src/skill/docs/compiler/getting-started/template-empty.md +112 -0
  169. package/src/skill/docs/compiler/getting-started/templates.md +111 -0
  170. package/src/skill/docs/compiler/index.md +85 -0
  171. package/src/skill/docs/compiler/targets/hono-api/cloudflare.md +94 -0
  172. package/src/skill/docs/compiler/targets/hono-api/database/d1.md +246 -0
  173. package/src/skill/docs/compiler/targets/hono-api/database/index.md +16 -0
  174. package/src/skill/docs/compiler/targets/hono-api/database/neon.md +144 -0
  175. package/src/skill/docs/compiler/targets/hono-api/database/using-d1.md +39 -0
  176. package/src/skill/docs/compiler/targets/hono-api/index.md +37 -0
  177. package/src/skill/docs/compiler/targets/hono-api/using-the-api/actions-api.md +323 -0
  178. package/src/skill/docs/compiler/targets/hono-api/using-the-api/batch-operations.md +357 -0
  179. package/src/skill/docs/compiler/targets/hono-api/using-the-api/caching.md +105 -0
  180. package/src/skill/docs/compiler/targets/hono-api/using-the-api/crud.md +652 -0
  181. package/src/skill/docs/compiler/targets/hono-api/using-the-api/errors.md +224 -0
  182. package/src/skill/docs/compiler/targets/hono-api/using-the-api/index.md +37 -0
  183. package/src/skill/docs/compiler/targets/hono-api/using-the-api/openapi.md +203 -0
  184. package/src/skill/docs/compiler/targets/hono-api/using-the-api/query-params.md +199 -0
  185. package/src/skill/docs/compiler/targets/hono-api/using-the-api/views-api.md +161 -0
  186. package/src/skill/docs/compiler/targets/index.md +47 -0
  187. package/src/skill/docs/compiler/targets/supabase-rls/index.md +55 -0
  188. package/src/skill/docs/compiler/targets/supabase-rls/limitations.md +48 -0
  189. package/src/skill/docs/compiler/targets/supabase-rls/mappings.md +99 -0
  190. package/src/skill/docs/compiler/targets/supabase-rls/setup.md +88 -0
  191. package/src/skill/docs/compiler/troubleshooting.md +120 -0
  192. package/src/skill/docs/index.md +77 -0
  193. package/src/skill/docs/stack/account-ui/customization.md +378 -0
  194. package/src/skill/docs/stack/account-ui/environment-variables.md +325 -0
  195. package/src/skill/docs/stack/account-ui/features/admin.md +76 -0
  196. package/src/skill/docs/stack/account-ui/features/api-keys.md +22 -0
  197. package/src/skill/docs/stack/account-ui/features/avatars.md +37 -0
  198. package/src/skill/docs/stack/account-ui/features/cli-authorize.md +21 -0
  199. package/src/skill/docs/stack/account-ui/features/index.md +291 -0
  200. package/src/skill/docs/stack/account-ui/features/organizations.md +29 -0
  201. package/src/skill/docs/stack/account-ui/features/passkeys.md +31 -0
  202. package/src/skill/docs/stack/account-ui/features/passwordless.md +28 -0
  203. package/src/skill/docs/stack/account-ui/features/sessions.md +20 -0
  204. package/src/skill/docs/stack/account-ui/hooks.md +209 -0
  205. package/src/skill/docs/stack/account-ui/index.md +147 -0
  206. package/src/skill/docs/stack/account-ui/library-usage.md +257 -0
  207. package/src/skill/docs/stack/account-ui/standalone.md +149 -0
  208. package/src/skill/docs/stack/account-ui/with-quickback.md +160 -0
  209. package/src/skill/docs/stack/account-ui/worker.md +362 -0
  210. package/src/skill/docs/stack/auth/api-keys.md +15 -0
  211. package/src/skill/docs/stack/auth/device-auth.md +14 -0
  212. package/src/skill/docs/stack/auth/index.md +64 -0
  213. package/src/skill/docs/stack/auth/jwt-optimization.md +245 -0
  214. package/src/skill/docs/stack/auth/plugins/aws-ses.md +127 -0
  215. package/src/skill/docs/stack/auth/plugins/combo-auth.md +74 -0
  216. package/src/skill/docs/stack/auth/plugins/index.md +228 -0
  217. package/src/skill/docs/stack/auth/plugins/upgrade-anonymous.md +155 -0
  218. package/src/skill/docs/stack/auth/security.md +455 -0
  219. package/src/skill/docs/stack/auth/using-auth.md +39 -0
  220. package/src/skill/docs/stack/cms/actions.md +199 -0
  221. package/src/skill/docs/stack/cms/components.md +479 -0
  222. package/src/skill/docs/stack/cms/connecting.md +199 -0
  223. package/src/skill/docs/stack/cms/dashboard.md +39 -0
  224. package/src/skill/docs/stack/cms/index.md +158 -0
  225. package/src/skill/docs/stack/cms/inline-editing.md +136 -0
  226. package/src/skill/docs/stack/cms/pages.md +275 -0
  227. package/src/skill/docs/stack/cms/record-layouts.md +151 -0
  228. package/src/skill/docs/stack/cms/schema-format.md +437 -0
  229. package/src/skill/docs/stack/cms/schema-registry.md +200 -0
  230. package/src/skill/docs/stack/cms/security.md +203 -0
  231. package/src/skill/docs/stack/cms/table-views.md +142 -0
  232. package/src/skill/docs/stack/index.md +65 -0
  233. package/src/skill/docs/stack/queues/handlers.md +317 -0
  234. package/src/skill/docs/stack/queues/index.md +56 -0
  235. package/src/skill/docs/stack/queues/using-queues.md +192 -0
  236. package/src/skill/docs/stack/realtime/durable-objects.md +488 -0
  237. package/src/skill/docs/stack/realtime/index.md +67 -0
  238. package/src/skill/docs/stack/realtime/using-realtime.md +211 -0
  239. package/src/skill/docs/stack/storage/index.md +17 -0
  240. package/src/skill/docs/stack/storage/kv.md +204 -0
  241. package/src/skill/docs/stack/storage/r2.md +232 -0
  242. package/src/skill/docs/stack/storage/using-kv.md +70 -0
  243. package/src/skill/docs/stack/storage/using-r2.md +55 -0
  244. package/src/skill/docs/stack/vector/embeddings.md +554 -0
  245. package/src/skill/docs/stack/vector/index.md +44 -0
  246. package/src/skill/docs/stack/vector/using-embeddings.md +186 -0
  247. package/src/skill/docs/stack/webhooks/inbound.md +186 -0
  248. package/src/skill/docs/stack/webhooks/index.md +36 -0
  249. package/src/skill/docs/stack/webhooks/outbound.md +281 -0
@@ -0,0 +1,291 @@
1
+ # Feature Flags
2
+
3
+ Control which features are available in your Account UI deployment using feature flags. All features are configured via environment variables.
4
+
5
+ ## Authentication Features
6
+
7
+ ### User Signup
8
+
9
+ ```bash
10
+ ENABLE_SIGNUP=true # default: true
11
+ ```
12
+
13
+ Controls whether new users can register. Wired to the `ENABLE_SIGNUP` env var.
14
+
15
+ **When enabled:**
16
+ - Shows "Sign Up" link on login page
17
+ - `/signup` route is accessible
18
+ - New users can create accounts
19
+
20
+ **When disabled:**
21
+ - Signup route returns 404
22
+ - Only existing users can log in
23
+ - Useful for invite-only applications
24
+
25
+ ### Email Verification
26
+
27
+ ```bash
28
+ ENABLE_EMAIL_VERIFICATION=true # default: true
29
+ ```
30
+
31
+ Controls the email verification flow. Wired to the frontend via the `ENABLE_EMAIL_VERIFICATION` env var.
32
+
33
+ **When enabled:**
34
+ - Users must verify email before full access
35
+ - Verification email sent on signup
36
+ - "Resend verification email" option available
37
+ - Unverified users see verification prompt
38
+
39
+ **When disabled:**
40
+ - Email addresses are trusted without verification
41
+ - Users have immediate access after signup
42
+
43
+ > **Security Consideration**
44
+ >
45
+ > Disabling email verification can allow fake email addresses. Only disable if you have another verification mechanism.
46
+
47
+
48
+ ### Email Deliverability Check
49
+
50
+ ```bash
51
+ DISABLE_EMAIL_STATUS_CHECK=false # default: false
52
+ ```
53
+
54
+ **When `false` (checking enabled):**
55
+ - System validates email addresses are deliverable
56
+ - Rejects disposable/temporary email providers
57
+ - Prevents typos in domain names
58
+
59
+ **When `true` (checking disabled):**
60
+ - Accepts all email formats
61
+ - Useful for development/testing
62
+ - Allows `@test.com`, `@localhost`, etc.
63
+
64
+ ### Passkey Login
65
+
66
+ ```bash
67
+ ENABLE_PASSKEY=true # default: true
68
+ ```
69
+
70
+ Controls passkey LOGIN only (not signup). When enabled, users can authenticate using passkeys.
71
+
72
+ **When enabled:**
73
+ - Users can register passkeys (fingerprint, Face ID, hardware keys)
74
+ - Passwordless login option
75
+ - "Manage Passkeys" page available
76
+
77
+ **When disabled:**
78
+ - No passkey registration
79
+ - No passkey login option
80
+
81
+ **Requirements:**
82
+ - HTTPS (passkeys require secure context)
83
+ - Modern browser with WebAuthn support
84
+
85
+ ### Email OTP
86
+
87
+ ```bash
88
+ ENABLE_EMAIL_OTP=true # default: true
89
+ ```
90
+
91
+ **When enabled:**
92
+ - Users can receive one-time passwords via email
93
+ - Alternative to password login
94
+ - `/email-otp` route available
95
+
96
+ **When disabled:**
97
+ - No email OTP option
98
+ - Password or passkey required
99
+
100
+ ### Password Authentication
101
+
102
+ ```bash
103
+ ENABLE_PASSWORD=false # default: false
104
+ ```
105
+
106
+ **When enabled:**
107
+ - Email + password fields on login page
108
+ - Password field on signup page
109
+ - Traditional username/password authentication
110
+
111
+ **When disabled:**
112
+ - No password fields shown
113
+ - Users authenticate via email OTP or passkey
114
+
115
+ ## Account Management Features
116
+
117
+ ### File Uploads
118
+
119
+ ```bash
120
+ VITE_ENABLE_FILE_UPLOADS=false # default: false
121
+ ```
122
+
123
+ **When enabled:**
124
+ - Avatar/profile picture upload
125
+ - Image cropping and editing
126
+ - File upload to R2/S3
127
+
128
+ **When disabled:**
129
+ - No file upload functionality
130
+ - Users can only use default avatars
131
+
132
+ **Requirements:**
133
+ - R2 bucket or S3 configured
134
+ - Upload endpoints in your API
135
+
136
+ ## Organization Features
137
+
138
+ ### Organizations (Multi-Tenancy)
139
+
140
+ ```bash
141
+ ENABLE_ORGANIZATIONS=true # default: true
142
+ ```
143
+
144
+ **When enabled:**
145
+ - Users can create organizations
146
+ - Organization management pages
147
+ - Member invitations and roles
148
+ - `/organizations/*` routes
149
+
150
+ **When disabled:**
151
+ - Single-user mode only
152
+ - No organization features
153
+ - Simpler user experience
154
+
155
+ **Includes:**
156
+ - Organization creation and deletion
157
+ - Member management (owner, admin, member roles)
158
+ - Invitation system
159
+ - Organization settings
160
+
161
+ ## Admin Features
162
+
163
+ ### Admin Panel
164
+
165
+ ```bash
166
+ ENABLE_ADMIN=true # default: true
167
+ ```
168
+
169
+ **When enabled:**
170
+ - `/admin` route accessible to admin users
171
+ - User management dashboard
172
+ - Subscription management
173
+ - Admin-only features:
174
+ - Create users manually
175
+ - Ban/unban users
176
+ - Reset user passwords
177
+ - View all sessions
178
+ - Manage subscriptions
179
+
180
+ **When disabled:**
181
+ - No admin panel
182
+ - Admin must use database directly
183
+
184
+ **Requirements:**
185
+ - User must have admin role in database
186
+
187
+ ## Feature Combinations
188
+
189
+ ### Minimal Configuration (Password-Only)
190
+
191
+ ```bash
192
+ ENABLE_PASSKEY=false
193
+ ENABLE_EMAIL_OTP=false
194
+ ENABLE_PASSWORD=true
195
+ ENABLE_ORGANIZATIONS=false
196
+ ENABLE_ADMIN=false
197
+ ```
198
+
199
+ Simple email/password authentication for single-tenant apps.
200
+
201
+ ### Maximum Security
202
+
203
+ ```bash
204
+ ENABLE_PASSKEY=true
205
+ ENABLE_EMAIL_OTP=true
206
+ ENABLE_PASSWORD=false
207
+ ENABLE_EMAIL_VERIFICATION=true
208
+ ```
209
+
210
+ All authentication methods with email verification and deliverability checks.
211
+
212
+ ### Multi-Tenant SaaS
213
+
214
+ ```bash
215
+ ENABLE_PASSKEY=true
216
+ ENABLE_EMAIL_OTP=true
217
+ ENABLE_ORGANIZATIONS=true
218
+ ENABLE_ADMIN=true
219
+ ```
220
+
221
+ Full-featured SaaS with organizations, teams, and admin panel.
222
+
223
+ ### Invite-Only Platform
224
+
225
+ ```bash
226
+ ENABLE_SIGNUP=false
227
+ ENABLE_PASSKEY=true
228
+ ENABLE_ORGANIZATIONS=true
229
+ ENABLE_ADMIN=true
230
+ ```
231
+
232
+ No public signup - users must be created by admin or invited to organizations.
233
+
234
+ ## Feature Detection
235
+
236
+ Check if a feature is enabled in your code:
237
+
238
+ ```ts
239
+ import { isFeatureEnabled } from '@/config/app';
240
+
241
+ if (isFeatureEnabled('organizations')) {
242
+ // Show organizations menu
243
+ }
244
+
245
+ if (isFeatureEnabled('passkey')) {
246
+ // Offer passkey setup
247
+ }
248
+ ```
249
+
250
+ ## Dynamic Feature Configuration
251
+
252
+ Override features at runtime:
253
+
254
+ ```ts
255
+ import { setAppConfig } from '@/config/app';
256
+
257
+ setAppConfig({
258
+ features: {
259
+ organizations: false, // Disable organizations
260
+ passkey: true, // Enable passkey
261
+ },
262
+ });
263
+ ```
264
+
265
+ > **Environment Takes Precedence**
266
+ >
267
+ > Environment variables set at build time take precedence over runtime configuration. Use runtime config for progressive feature rollouts or A/B testing.
268
+
269
+
270
+ ## Testing Features
271
+
272
+ For local development, create `.env.local`:
273
+
274
+ ```bash title=".env.local"
275
+ # Test with all features enabled
276
+ ENABLE_SIGNUP=true
277
+ ENABLE_EMAIL_VERIFICATION=true
278
+ ENABLE_PASSKEY=true
279
+ ENABLE_EMAIL_OTP=true
280
+ ENABLE_PASSWORD=true
281
+ ENABLE_ORGANIZATIONS=true
282
+ ENABLE_ADMIN=true
283
+ VITE_ENABLE_FILE_UPLOADS=true
284
+ DISABLE_EMAIL_STATUS_CHECK=true # Allow test emails
285
+ ```
286
+
287
+ ## Next Steps
288
+
289
+ - **[Environment Variables](/stack/account-ui/environment-variables)** - Complete variable reference
290
+ - **[Customization](/stack/account-ui/customization)** - Customize UI text and labels
291
+ - **[Worker Setup](/stack/account-ui/worker)** - Deploy your configuration
@@ -0,0 +1,29 @@
1
+ # Organizations
2
+
3
+ Account UI provides a complete organization management interface when `ENABLE_ORGANIZATIONS=true`.
4
+
5
+ ## Organization CRUD
6
+
7
+ - Create new organizations
8
+ - Update organization name and settings
9
+ - Delete organizations (owner only)
10
+
11
+ ## Member Management
12
+
13
+ - Invite members by email
14
+ - Assign roles: **owner**, **admin**, **member**
15
+ - Remove members
16
+ - Transfer ownership
17
+
18
+ ## Invitations
19
+
20
+ - Pending invitation list
21
+ - Resend invitations
22
+ - Cancel invitations
23
+
24
+ > **Note:** These three roles (`owner`, `admin`, `member`) are Better Auth's built-in organization roles and map directly to Account UI's role picker. Use the same roles in your Quickback [Access](/compiler/definitions/access) rules — with [`auth.roleHierarchy`](/compiler/definitions/access#role-hierarchy) configured, you can write `roles: ["member+"]` to mean "member and above."
25
+
26
+ ## Related
27
+
28
+ - [Environment Variables](/stack/account-ui/environment-variables)
29
+ - [Account UI Overview](/stack/account-ui)
@@ -0,0 +1,31 @@
1
+ # Passkeys
2
+
3
+ When `ENABLE_PASSKEY=true`, Account UI provides passkey registration and management.
4
+
5
+ ## Passkey Registration
6
+
7
+ - Setup wizard guides users through passkey creation
8
+ - Supports fingerprint, Face ID, and hardware security keys
9
+ - Multiple passkeys can be registered per account
10
+
11
+ ## Passkey Login
12
+
13
+ - "Sign in with passkey" button on login page
14
+ - Browser's native WebAuthn dialog
15
+ - No password required
16
+
17
+ ## Managing Passkeys
18
+
19
+ - View registered passkeys
20
+ - Remove individual passkeys
21
+ - Register additional passkeys
22
+
23
+ ## Requirements
24
+
25
+ - HTTPS (WebAuthn requires secure context)
26
+ - Modern browser with WebAuthn support
27
+
28
+ ## Related
29
+
30
+ - [Auth Plugins](/stack/auth/plugins) — Plugin configuration
31
+ - [Environment Variables](/stack/account-ui/environment-variables)
@@ -0,0 +1,28 @@
1
+ # Passwordless Authentication
2
+
3
+ Account UI supports passwordless authentication via email OTP and magic links.
4
+
5
+ ## Email OTP
6
+
7
+ When `ENABLE_EMAIL_OTP=true`:
8
+
9
+ - Users enter their email address
10
+ - A one-time password is sent via email
11
+ - User enters the OTP code to authenticate
12
+
13
+ ## Magic Links
14
+
15
+ When `ENABLE_MAGIC_LINK=true`:
16
+
17
+ - Users enter their email address
18
+ - A login link is sent via email
19
+ - Clicking the link authenticates the user
20
+
21
+ ## Combo Auth
22
+
23
+ When both are enabled, Account UI uses the `@quickback-dev/better-auth-combo-auth` plugin to combine them into a single flow — the email contains both a clickable link and a code.
24
+
25
+ ## Related
26
+
27
+ - [Auth Plugins](/stack/auth/plugins) — Plugin configuration
28
+ - [Environment Variables](/stack/account-ui/environment-variables)
@@ -0,0 +1,20 @@
1
+ # Session Management
2
+
3
+ Account UI includes a session management page where users can view and revoke their active sessions.
4
+
5
+ ## Active Sessions
6
+
7
+ Users can see all devices where they're currently logged in, including:
8
+
9
+ - Device type and browser
10
+ - IP address and approximate location
11
+ - Last active timestamp
12
+
13
+ ## Revoking Sessions
14
+
15
+ Users can revoke any session except their current one. This immediately invalidates the session token.
16
+
17
+ ## Related
18
+
19
+ - [Environment Variables](/stack/account-ui/environment-variables)
20
+ - [Account UI Overview](/stack/account-ui)
@@ -0,0 +1,209 @@
1
+ # Auth Hooks
2
+
3
+ Quickback discovers project-level auth hooks at `quickback/hooks/` and wires them into [Better Auth's `databaseHooks`](https://www.better-auth.com/docs/concepts/database#database-hooks). Use them for post-signup bootstrap, signup gating, and other lifecycle work.
4
+
5
+ The classic case is multi-tenant: when `account.auth.organizations: true` is set, a freshly signed-up user has no `activeOrganizationId`, so every authenticated `/api/v1/*` returns `400 ORG_REQUIRED`. An `after-user-create` hook can auto-provision a personal workspace + member row so the next request just works.
6
+
7
+ ## Folder layout
8
+
9
+ ```
10
+ quickback/
11
+ hooks/
12
+ after-user-create.ts
13
+ before-user-create.ts
14
+ after-session-create.ts
15
+ ```
16
+
17
+ Each file has a single default export — an `async (entity, ctx) => ...` function. The filename determines which Better Auth event the hook fires on.
18
+
19
+ ## Recognized events
20
+
21
+ | Filename | Better Auth path | Entity | Return |
22
+ |--------------------------------|-----------------------------------|----------|---------------------------------|
23
+ | `before-user-create.ts` | `databaseHooks.user.create.before` | `User` | `void \| { data?: Partial<User> }` |
24
+ | `after-user-create.ts` | `databaseHooks.user.create.after` | `User` | `void` |
25
+ | `after-session-create.ts` | `databaseHooks.session.create.after` | `Session` | `void` |
26
+
27
+ Filenames outside this set are a hard compile-time error so a typo never silently disables a hook. Add events by extending [`apps/compiler/src/parser/hooks.ts`](https://github.com/paulstenhouse/quickback-compiler) (and the matching CLI mirror).
28
+
29
+ ## ctx shape
30
+
31
+ Every hook receives `(entity, ctx)`:
32
+
33
+ ```ts
34
+ type HookCtx = {
35
+ /** Drizzle client bound to the auth DB binding (split-DB aware). */
36
+ authDb: DrizzleClient;
37
+ /**
38
+ * Auth schema namespace — destructure to access the BA-managed tables
39
+ * (`user`, `session`, `organization`, `member`, …) without writing an
40
+ * import path. The hook source lives in `quickback/hooks/` pre-compile
41
+ * and `src/lib/auth-hooks/` post-stage; relying on `authSchema`
42
+ * removes the dual-path import problem.
43
+ */
44
+ authSchema: typeof import('../../auth/schema');
45
+ /** Cloudflare bindings (Cloudflare runtime) or process.env (Bun/Node). */
46
+ env: Bindings;
47
+ /** Better Auth's own context object — request, hook metadata, etc. */
48
+ baContext: any;
49
+ };
50
+ ```
51
+
52
+ `authDb` is the load-bearing piece: hooks must write to the auth DB via Drizzle directly. See the [CSRF caveat](#csrf-caveat-server-side-org-create) below. `authSchema` is the namespace export of the generated auth schema module; destructure the tables you need.
53
+
54
+ ## Writing hooks: use built-ins where possible
55
+
56
+ Hook source files are evaluated by the Better Auth schema-generation step at compile time, which runs in a stripped-down sandbox that **does not see your project's `node_modules`**. A hook that imports `@paralleldrive/cuid2`, `nanoid`, or any other third-party package will fail compile with a "module not found" error during the auth-schema-generation step — even if the package is installed and runs fine in the deployed Worker.
57
+
58
+ Stick to runtime built-ins for ID generation, hashing, and similar primitives:
59
+
60
+ | Need | Built-in |
61
+ |--------------------|---------------------------------------------------------|
62
+ | Random ID | `crypto.randomUUID()` |
63
+ | SHA-256 / digest | `crypto.subtle.digest(...)` (Workers / Node 19+) |
64
+ | Random bytes | `crypto.getRandomValues(new Uint8Array(n))` |
65
+ | Time | `Date.now()`, `new Date().toISOString()` |
66
+
67
+ `drizzle-orm` is already available in the schema-gen sandbox (the auth schema imports from it), so `eq`, `and`, `inArray`, etc. are safe to import.
68
+
69
+ ## Throw semantics
70
+
71
+ What happens when a hook throws is the #1 thing that bites people:
72
+
73
+ | Hook | Throw effect |
74
+ |-----------------------|------------------------------------------------------------------------------|
75
+ | `before-user-create` | Signup aborts. The user is **not** created. Throw a typed error to gate. |
76
+ | `after-user-create` | The user **is** created (the BA insert already committed). Any derived rows your hook started writing become orphans. |
77
+ | `after-session-create`| Same as above — the session row exists; partial writes leak. |
78
+
79
+ For `after-*` hooks, design for **idempotency**: use the entity's `id` as a stable seed for any derived rows so re-running the hook (manually or via a background reconciler) is safe. Don't generate fresh `cuid()`s for derived rows you'd want to recover.
80
+
81
+ ## Examples
82
+
83
+ ### Auto-provision a personal workspace on signup
84
+
85
+ The QB-9 case. Without this, `organizations: true` projects break immediately for new users.
86
+
87
+ ```ts title="quickback/hooks/after-user-create.ts"
88
+ import { eq } from 'drizzle-orm';
89
+
90
+ export default async (user, { authDb, authSchema }) => {
91
+ const { organization, member } = authSchema;
92
+
93
+ // Idempotency: derive a stable org id from the user id so re-running this
94
+ // hook (after a partial failure) doesn't create a second workspace.
95
+ const orgId = `org_${user.id}`;
96
+ const slug = `${(user.name ?? 'workspace').toLowerCase().replace(/\s+/g, '-')}-${user.id.slice(0, 6)}`;
97
+
98
+ // Skip if the workspace already exists (idempotent).
99
+ const existing = await authDb
100
+ .select({ id: organization.id })
101
+ .from(organization)
102
+ .where(eq(organization.id, orgId));
103
+ if (existing.length > 0) return;
104
+
105
+ await authDb.insert(organization).values({
106
+ id: orgId,
107
+ name: `${user.name ?? 'Personal'} Workspace`,
108
+ slug,
109
+ createdAt: new Date(),
110
+ });
111
+
112
+ await authDb.insert(member).values({
113
+ id: crypto.randomUUID(),
114
+ userId: user.id,
115
+ organizationId: orgId,
116
+ role: 'owner',
117
+ createdAt: new Date(),
118
+ });
119
+ };
120
+ ```
121
+
122
+ ### Set the active organization on next session
123
+
124
+ Setting `activeOrganizationId` from a hook means writing to `session.active_organization_id` via Drizzle directly — calling Better Auth's `setActiveOrganization` API server-side is awkward (see the CSRF caveat). The reliable pattern:
125
+
126
+ ```ts title="quickback/hooks/after-session-create.ts"
127
+ import { eq } from 'drizzle-orm';
128
+
129
+ export default async (newSession, { authDb, authSchema }) => {
130
+ const { session, member } = authSchema;
131
+
132
+ // Pick the user's first membership as their active org. Projects that
133
+ // want a sticky last-active-org should track that separately.
134
+ const memberships = await authDb
135
+ .select({ organizationId: member.organizationId })
136
+ .from(member)
137
+ .where(eq(member.userId, newSession.userId))
138
+ .limit(1);
139
+
140
+ if (memberships.length === 0) return;
141
+
142
+ await authDb
143
+ .update(session)
144
+ .set({ activeOrganizationId: memberships[0].organizationId })
145
+ .where(eq(session.id, newSession.id));
146
+ };
147
+ ```
148
+
149
+ ### Normalize and gate signup
150
+
151
+ `before-*` hooks can return `{ data: Partial<User> }` to mutate the row before insert. Throw to abort.
152
+
153
+ ```ts title="quickback/hooks/before-user-create.ts"
154
+ export default async (user: { email: string; name?: string }) => {
155
+ // Block disposable inboxes.
156
+ if (/@(?:mailinator|10minutemail)\.com$/i.test(user.email)) {
157
+ throw new Error('Disposable email addresses are not allowed.');
158
+ }
159
+ // Trim whitespace from display name.
160
+ return { data: { name: user.name?.trim() } };
161
+ };
162
+ ```
163
+
164
+ The compiler-generated wrapper merges your `data` onto the original entity, so you only return the fields you actually want to change.
165
+
166
+ ## CSRF caveat — server-side org create
167
+
168
+ `POST /auth/v1/organization/create` (and Better Auth's `auth.api.createOrganization(...)` server helper) require an `Origin` header. A hook running inside `databaseHooks.user.create.after` is server-side — there is no incoming request, so no `Origin`. Calling those APIs from a hook may also validate `Origin` internally and reject.
169
+
170
+ **The only safe path is direct Drizzle writes via `authDb`.** Treat the org/member tables as your source of truth and let the SPA call the BA API for user-initiated org creation.
171
+
172
+ ## Generated output
173
+
174
+ Compile picks up `quickback/hooks/*.ts` and produces:
175
+
176
+ ```
177
+ src/lib/auth.ts # imports the hook + adds a databaseHooks block
178
+ src/lib/auth-hooks/<file> # your hook source, copied verbatim
179
+ ```
180
+
181
+ Inside the generated `auth.ts`:
182
+
183
+ ```ts
184
+ import __qbHook_afterUserCreate from "./auth-hooks/after-user-create";
185
+
186
+ // ...inside createAuth(env)...
187
+ return betterAuth({
188
+ // ...
189
+ database: drizzleAdapter(db, { /* ... */ }),
190
+ databaseHooks: {
191
+ user: {
192
+ create: {
193
+ after: async (entity, _baCtx) => {
194
+ const _qbCtx = { authDb: db, authSchema: schema, env, baContext: _baCtx };
195
+ await __qbHook_afterUserCreate(entity, _qbCtx);
196
+ },
197
+ },
198
+ },
199
+ },
200
+ });
201
+ ```
202
+
203
+ No hooks → no `databaseHooks` block emitted. The whole feature is opt-in by file presence.
204
+
205
+ ## See also
206
+
207
+ - [With Quickback Compiler](/stack/account-ui/with-quickback) — how `account.auth.organizations` flows through the build
208
+ - [Configuration → account block](/compiler/config) — `account.appUrl` and other account-level options
209
+ - [Better Auth: Database Hooks](https://www.better-auth.com/docs/concepts/database#database-hooks)