Configuration
xAuth app.config.ts, branding, consents, and runtimeConfig for nuxt-x-auth-nile.
Configuration
All consumer overrides live in app/app.config.ts (Nuxt 4 app/ directory). An app.config.ts at the project root is ignored and you only get Nuxt UI defaults.
app/app.config.ts
export default defineAppConfig({
ui: {
colors: { primary: 'emerald', neutral: 'zinc' },
},
xAuth: {
publicRoutes: ['/legal'],
redirects: {
login: '/auth/login',
signup: '/auth/signup',
afterLogin: '/',
afterSignup: '/',
afterLogout: '/auth/login',
forgotPassword: '/auth/forgot-password',
},
features: {
oauth: false,
mfa: false,
forgotPassword: true,
signup: true,
createTenant: false,
},
oauthProviders: [
{ id: 'google', label: 'Google', icon: 'i-simple-icons-google' },
],
ui: {
layout: 'centered',
showLogo: true,
showBrandName: true,
showTagline: true,
brandName: 'Acme',
tagline: 'Operations',
logoIcon: 'i-lucide-hexagon',
background: {
enabled: true,
imageUrl: '/auth-bg.jpg',
overlayOpacity: 55,
blur: true,
},
consents: [
{ id: 'tos', label: 'Terms of Service', to: '/legal/terms' },
{ id: 'privacy', label: 'Privacy Policy', to: '/legal/privacy' },
],
legal: {
copyright: 'Acme',
links: [
{ label: 'Terms', to: '/legal/terms' },
{ label: 'Privacy', to: '/legal/privacy' },
],
},
},
},
})
The overlay on the centered layout tints with ui.colors.primary.
Schema reference
| Key | Type | Default | Description |
|---|---|---|---|
publicRoutes | string[] | [] | Extra public routes (exact or prefix). /auth/handler/*, /auth/logout, and /auth/reset-password are always public. |
redirects.login | string | '/auth/login' | Login path. Guest-only. |
redirects.signup | string | '/auth/signup' | Signup path. Guest-only. |
redirects.afterLogin | string | '/' | After successful login. |
redirects.afterSignup | string | '/' | After signup with a session. Verification-required signup stays on check-email. |
redirects.afterLogout | string | '/auth/login' | After logout. |
redirects.forgotPassword | string | '/auth/forgot-password' | Forgot-password page path. |
features.oauth | boolean | false | Show OAuth buttons when providers are configured. |
features.mfa | boolean | false | Enable /auth/mfa. Off → that page redirects to login. |
features.forgotPassword | boolean | true | Enable password reset. |
features.signup | boolean | true | Enable signup (off → /auth/signup redirects to login). |
features.createTenant | boolean | false | Nile creates a tenant named after the user’s email on signup. |
oauthProviders | { id, label, icon }[] | unset | OAuth buttons. Empty/unset = no buttons (no silent Google). |
socialLoginProviders | string[] | unset | Legacy provider ids if oauthProviders is omitted. |
ui.layout | 'centered' | 'split' | 'centered' | Auth chrome. |
ui.showLogo | boolean | true | Show logoUrl / logoIcon. |
ui.showBrandName | boolean | true | Show brandName under the logo. |
ui.showTagline | boolean | true | Show tagline under the brand name. |
ui.brandName | string | '' | Brand title. |
ui.tagline | string | '' | Small label under the brand. |
ui.logoUrl | string | '' | Logo image. |
ui.logoIcon | string | '' | Iconify icon when logoUrl is empty. |
ui.background.enabled | boolean | true | Photo backdrop on the centered layout. |
ui.background.imageUrl | string | '' | Background image (Unsplash fallback when empty). |
ui.background.overlayOpacity | number | 55 | Overlay strength 0–100. Overlay uses ui.colors.primary. |
ui.background.blur | boolean | true | Blur the photo under the overlay. |
ui.split.* | object | — | Hero copy/image when layout is 'split'. |
ui.legal.copyright | string | brand name | Left-side footer copyright. |
ui.legal.links | { label, to }[] | [] | Right-side footer links. |
ui.form.showSeparator | boolean | true | “or” divider above OAuth (hidden when there are no providers). |
ui.consents | { id, label, description?, to?, required? }[] | [] | Signup checkboxes. required defaults to true. Empty = hidden. Google/GitHub stay disabled until required boxes are checked. to opens in a new tab. |
Site-overridable strings on the layer should stay undefined in your overrides when you want the layer default; empty strings win the merge.
Runtime config / environment
Maps to runtimeConfig.public.nile:
| Variable | Runtime config | Required | Description |
|---|---|---|---|
NUXT_PUBLIC_NILE_BASE_URL | public.nile.baseUrl | No | Auth API origin. Unset → current page origin. |
NUXT_PUBLIC_NILE_BASE_PATH | public.nile.basePath | No | Path on that origin (typically /api). |
Point the browser at same-origin
/api (Fastify + Vite proxy, or the UI and API on one host). Hosted *.api.thenile.dev is CORS-blocked for cookie sessions.AI Context
package: "@xenterprises/nuxt-x-auth-nile"
config-key: xAuth
use-when: >
Configuring redirects, features (OAuth, MFA, forgot password, signup,
tenant creation), oauthProviders, xAuth.ui branding/consents/legal,
or publicRoutes. Leave NUXT_PUBLIC_NILE_BASE_URL empty for same-origin
/api; do not point the browser at hosted Nile.
useXAuth
Unified Nile Auth composable — toasts, navigation, state, verification pending, MFA, and SDK authorizer escape hatch.
nuxt-x-app-admin
Nuxt layer for admin portals — user management, Stripe billing, content, support ticketing, AI assistants, roles, tenants, audit logs, and impersonation. Extends nuxt-x-app.
