Configuration
app.config.ts and runtimeConfig reference for @xenterprises/nuxt-x-auth-stack.
Configuration
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: [],
},
})
Schema Reference
| Key | Type | Default | Description |
|---|---|---|---|
redirects.login | string | '/auth/login' | Path of the login page. |
redirects.signup | string | '/auth/signup' | Path of the signup page. |
redirects.afterLogin | string | '/' | Redirect destination after a successful login. |
redirects.afterSignup | string | '/' | Redirect destination after a successful signup. |
redirects.afterLogout | string | '/auth/login' | Redirect destination after logout. |
redirects.forgotPassword | string | '/auth/forgot-password' | Path of the forgot-password page. |
features.oauth | boolean | false | Enable OAuth/social login buttons. |
features.magicLink | boolean | false | Enable magic link authentication. |
features.otp | boolean | false | Enable OTP (email code) authentication. |
features.forgotPassword | boolean | true | Enable forgot-password flow. |
features.signup | boolean | true | Enable signup page and link. |
oauthProviders | { id, label, icon }[] | [] | OAuth providers shown by XAuthOAuthButtonGroup. Each entry requires id (Stack Auth provider name), label (display text), and icon (Iconify class). |
oauthProviders example
oauthProviders: [
{ id: 'google', label: 'Google', icon: 'i-simple-icons-google' },
{ id: 'github', label: 'GitHub', icon: 'i-simple-icons-github' },
]
Runtime Config / Environment Variables
| Variable | Required | Description |
|---|---|---|
NUXT_PUBLIC_STACK_PROJECT_ID | Yes | Stack Auth project ID. |
NUXT_PUBLIC_STACK_PUBLISHABLE_CLIENT_KEY | Yes | Stack Auth publishable client key. |
AI Context
package: "@xenterprises/nuxt-x-auth-stack"
config-key: xAuth
use-when: >
Configuring redirect paths, enabling/disabling features (OAuth, magic link,
OTP, forgot password, signup), or listing OAuth providers for nuxt-x-auth-stack.
Set NUXT_PUBLIC_STACK_PROJECT_ID and NUXT_PUBLIC_STACK_PUBLISHABLE_CLIENT_KEY
in environment variables to connect the layer to your Stack Auth project.
