X Enterprises

Configuration

app.config.ts and runtimeConfig reference for @xenterprises/nuxt-x-auth-better.

Configuration

How to configure this module via app.config.ts and environment variables.

app.config.ts

export default defineAppConfig({
  xAuth: {
    redirects: {
      login: '/auth/login',
      signup: '/auth/signup',
      afterLogin: '/',
      afterSignup: '/',
      afterLogout: '/auth/login',
      forgotPassword: '/auth/forgot-password',
    },

    features: {
      oauth: false,
      magicLink: false,
      otp: false,
      forgotPassword: true,
      signup: true,
    },

    oauthProviders: [],

    ui: {
      showLogo: true,
      showBrandName: true,
      brandName: '',
      tagline: '',
      layout: 'centered', // 'centered' | 'split'
      background: {
        enabled: true,
        imageUrl: '',
        overlayOpacity: 55,
        blur: true,
      },
      card: {
        glass: false,
      },
      split: {
        heroPosition: 'left', // 'left' | 'right'
        headline: '',
        features: [],
      },
      legal: {
        copyright: '',
        links: [],
      },
    },
  },
})

Schema Reference

redirects

KeyTypeDefaultDescription
redirects.loginstring'/auth/login'Path to the login page.
redirects.signupstring'/auth/signup'Path to the signup page.
redirects.afterLoginstring'/'Redirect destination after successful login.
redirects.afterSignupstring'/'Redirect destination after successful signup.
redirects.afterLogoutstring'/auth/login'Redirect destination after logout.
redirects.forgotPasswordstring'/auth/forgot-password'Path to the forgot password page.

features

KeyTypeDefaultDescription
features.oauthbooleanfalseShow OAuth provider buttons on auth forms.
features.magicLinkbooleanfalseShow magic link option on login form.
features.otpbooleanfalseShow OTP input on auth forms.
features.forgotPasswordbooleantrueShow forgot password link on login form.
features.signupbooleantrueShow signup link on login form.

oauthProviders

An array of OAuth provider definitions rendered by <XAuthOAuthButtonGroup />:

FieldTypeDescription
idstringProvider ID (e.g. 'google', 'github').
labelstringDisplay label on the button.
iconstringIconify icon string (e.g. 'i-simple-icons-google').

ui

KeyTypeDefaultDescription
ui.showLogobooleantrueShow logo on auth pages.
ui.showBrandNamebooleantrueShow brand name on auth pages.
ui.brandNamestring''Brand name text displayed on auth pages.
ui.taglinestring''Tagline shown below the brand name.
ui.layout'centered' | 'split''centered'Auth page layout style.
ui.background.enabledbooleantrueShow background decoration on auth pages.
ui.background.imageUrlstring''Background image URL.
ui.background.overlayOpacitynumber55Overlay opacity over the background image (0–100).
ui.background.blurbooleantrueApply blur to the background image.
ui.card.glassbooleanfalseApply glassmorphism effect to the auth card.
ui.split.heroPosition'left' | 'right''left'Position of the hero panel in split layout.
ui.split.headlinestring''Headline text in the split layout hero panel.
ui.split.featuresstring[][]Feature list displayed in the split layout hero panel.
ui.legal.copyrightstring''Copyright text displayed in the auth page footer.
ui.legal.links{ label: string, to: string }[][]Footer legal links (e.g. Privacy Policy, Terms).

Runtime Config (Environment Variables)

The auth API connection is configured via runtimeConfig in nuxt.config.ts:

// nuxt.config.ts
export default defineNuxtConfig({
  extends: [['@xenterprises/nuxt-x-auth-better', { install: true }]],
  runtimeConfig: {
    public: {
      x: {
        auth: {
          baseUrl: process.env.NUXT_PUBLIC_AUTH_BASE_URL || '',
          authPath: '/auth',
        },
      },
    },
  },
})
KeyEnv VariableDefaultDescription
public.x.auth.baseUrlNUXT_PUBLIC_AUTH_BASE_URL''Base URL of the Fastify API server (e.g. https://api.example.com).
public.x.auth.authPath'/auth'Better Auth mount path on the API server. The full auth URL is baseUrl + authPath.
VariableRequiredDescription
NUXT_PUBLIC_AUTH_BASE_URLYesBase URL of the Fastify API server (e.g. https://api.example.com).

AI Context

package: "@xenterprises/nuxt-x-auth-better"
config-key: xAuth
use-when: >
  Configuring redirect paths, enabling/disabling features (OAuth, magic link,
  OTP, forgot password, signup), listing OAuth providers, or customising UI
  appearance (layout, branding, background, glass card, split panel, legal
  footer) for nuxt-x-auth-better. Set NUXT_PUBLIC_AUTH_BASE_URL to point the
  layer at the Fastify API server running Better Auth.
Copyright © 2026