Quickback Docs

CMS and Account UI Configuration

quickback.config.ts options for the bundled CMS and Account SPAs — the sysadmin tier and auth feature flags.

Options in quickback.config.ts for the two bundled SPAs. What each SPA does is on CMS and Account UI; hostnames are on Domains.

CMS Configuration

Embed the Admin UI in your compiled Worker. It reads your schema registry and renders a complete admin interface — zero UI code per table.

// Simple — embed CMS at root
cms: true,

// With custom domain
cms: { domain: "cms.example.com" },

// With access control (only admins can access CMS)
cms: { domain: "cms.example.com", access: "sysadmin" },

// Cross-tenant DB-admin tier — sysadmins see every tenant's data
cms: { domain: "cms.example.com", sysadmin: true },
OptionTypeDefaultDescription
domainstring—Custom domain for CMS. Adds a custom_domain route to wrangler.toml.
access"sysadmin" | "member""sysadmin"Who can use the CMS. "sysadmin" admits user.role === "sysadmin" only; "member" also admits any caller holding an organization membership, scoped to their active organization. appmanager is admitted by neither. The real gate is GET /api/v1/schema (and custom_view CRUD) — both answer 403 with CMS_ACCESS_DENIED naming the requirement (401 AUTH_MISSING when not signed in); the SPA shell is served to any signed-in caller so it can explain. The pre-v0.62 values "admin" and "user" are compile errors. See CMS Connecting for the full enforcement model.
sysadminbooleanfalseCross-tenant DB-admin tier. When true, opts into the SYSADMIN pseudo-role (user.role === "sysadmin"), the firewall escape hatch (sysadmins bypass tenant scopes, soft-delete still enforced), the cross-tenant /auth/v1/admin/list-organizations endpoint (sibling of Better Auth's /auth/v1/admin/list-users, gated to sysadmin only), and the SPA's "All organizations" sentinel. The CMS HTML gate admits userRole === "sysadmin" alongside "appmanager". Off by default. See SYSADMIN pseudo-role.

Sysadmin tier (cms.sysadmin: true)

Quickback's default model assumes every CMS user belongs to at least one organization (member row in the auth DB). For platforms that need a Supabase-style cross-tenant DB-admin tool — debugging a tenant's data, running cross-tenant queries, supporting a customer — that's a poor fit: a sysadmin without member rows would dead-end, and auto-filling their active org from "first membership" silently scopes them to a tenant they have no relationship with.

cms: { sysadmin: true } introduces a separate role tier:

  • Role: user.role === "sysadmin" (set on the Better Auth user table). Distinct from "appmanager" — appmanagers keep platform control-plane access (Better Auth admin surfaces, organization and user management, support tooling — but NOT the CMS), while sysadmins get true cross-tenant data access. ADMIN is now a rejected legacy pseudo-role; use userRole: ["appmanager"] for control-plane gates and roles: ["SYSADMIN"] for cross-tenant access.
  • Firewall: every buildFirewallConditions() emits an if (ctx.userRole === "sysadmin") return undefined (or just the soft-delete predicate when present) at the top, so sysadmins see every tenant's rows. See Firewall escape hatch.
  • Org listing: GET /api/v1/operator/organizations selects directly from the auth-schema organization table — every row, every tenant. Quickback-emitted and gated to user.role appmanager or sysadmin. It sat at /auth/v1/admin/list-organizations before 0.72 (Moved routes). For the membership-bound caller's-orgs listing, use BA's own /auth/v1/organization/list.
  • CMS SPA: when the user is a sysadmin, the header switcher loads from the cross-tenant endpoint, defaults to "All organizations" (which omits ?organizationId= and reaches the firewall escape), and pins selected tenants via ?organizationId= on every API call. Org admins keep the existing membership-based switcher.
  • CMS gate: cms.access: "sysadmin" (the default) admits the sysadmin tier only; cms.access: "member" also admits any caller with an organization membership. appmanager opens the CMS in neither mode — see Access gate.

Off by default. Projects that don't enable it get zero behavior change; setting cms.sysadmin: true and granting a user user.role = "sysadmin" is the only way to unlock the cross-tenant view.

Account UI Configuration

Embed the Account UI in your compiled Worker. Provides login, signup, profile management, organization management, and admin — one prebuilt bundle, configured from your config at serve time.

For post-signup logic — auto-provisioning a workspace, gating signup, setting an active organization — drop a file in quickback/hooks/. See Auth Hooks.

// Simple — embed Account UI with defaults
account: true,

// Full configuration
account: {
  domain: "auth.example.com",
  adminDomain: "admin.example.com",
  name: "My App",
  companyName: "My Company",
  auth: {
    password: true,
    emailOTP: false,
    passkey: true,
    organizations: true,
    admin: true,
  },
},
OptionTypeDescription
domainstringCustom domain for Account UI (e.g., auth.example.com)
adminDomainstringCustom domain for admin-only access (e.g., admin.example.com). Serves the same Account SPA — the client-side router handles admin routing.
appUrlstringOrigin of the tenant's main application. Baked into the Account SPA as VITE_QUICKBACK_APP_URL. Combined with tenantPattern for every Open button (top bar, Home, org switcher). Independent from domain. A deploy-target APP_URL can override this at serve time.
tenantPatternstringURL pattern for a tenant, with {slug} substituted. Default /{slug}. Relative patterns are resolved against appUrl; a full https://{slug}.example.com pattern is used as-is. Baked as VITE_TENANT_URL_PATTERN.
namestringApp display name shown on login, profile, and email templates
companyNamestringCompany name for branding
taglinestringApp tagline shown on login page
descriptionstringApp description

Auth Feature Flags

Control which authentication features are exposed. Disabled features are hidden in the Account UI (each feature route guards itself on its runtime flag) and enforced on the server side via the Better Auth config — so "signup off" actually refuses new accounts on the server, not just the SPA's signup screen.

account.auth.* is a shorthand for providers.auth.config — the compiler maps each flag onto the Better Auth server config before any code is generated. You can write either side directly; setting both incompatibly (e.g. account.auth.signup: false and signup.inviteOnly: false) fails the compile with a precise error rather than picking a silent winner.

FlagTypeDefaultMaps to (server)Description
auth.passwordbooleantrueemailAndPassword.enabledEmail/password authentication — both server endpoint and UI
auth.emailOTPbooleanfalseadds emailOtp pluginEmail one-time password login — adds plugin server-side, surfaces UI
auth.passkeybooleanfalseadds passkey pluginWebAuthn/FIDO2 passkey authentication — adds plugin server-side, surfaces UI
auth.signupbooleantruesignup.inviteOnly (inverted)Self-service account registration — false hides open signup in the UI and makes the server invite-only: every sign-in method refuses new accounts with 403 SIGNUP_NOT_ALLOWED unless the email holds a pending invitation
auth.organizationsbooleantrueUI surface onlyOrganization UI: the switcher, the org list and invitations on Home, and the org pages. Sign-in lands on /home. Server-side organization support stays on regardless; set features.pinnedOrganizationId when you want one fixed org with no switching UI
auth.adminbooleanfalseUI surface onlyAdmin panel for user management in the Account SPA. The Better Auth admin plugin is compiler-managed separately from this UI toggle
auth.emailVerificationbooleanfalseemailAndPassword.requireEmailVerificationRequire email verification before sessions are issued. False = sessions usable immediately after signup

On this page