[{"data":1,"prerenderedAt":644},["ShallowReactive",2],{"navigation_docs":3,"-getting-started":208,"-getting-started-surround":641},[4,42,68,115,136,157],{"title":5,"path":6,"stem":7,"children":8,"icon":11},"Getting Started","\u002Fgetting-started","1.getting-started\u002F0.index",[9,12,17,22,27,32,37],{"title":10,"path":6,"stem":7,"icon":11},"Introduction","i-lucide-sparkles",{"title":13,"path":14,"stem":15,"icon":16},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F1.installation","i-lucide-download",{"title":18,"path":19,"stem":20,"icon":21},"Configuration","\u002Fgetting-started\u002Fconfiguration","1.getting-started\u002F2.configuration","i-lucide-settings",{"title":23,"path":24,"stem":25,"icon":26},"Client Setup","\u002Fgetting-started\u002Fclient-setup","1.getting-started\u002F3.client-setup","i-lucide-monitor",{"title":28,"path":29,"stem":30,"icon":31},"Type Augmentation","\u002Fgetting-started\u002Ftype-augmentation","1.getting-started\u002F4.type-augmentation","i-lucide-type",{"title":33,"path":34,"stem":35,"icon":36},"Schema Generation (NuxtHub)","\u002Fgetting-started\u002Fschema-generation","1.getting-started\u002F5.schema-generation","i-lucide-database",{"title":38,"path":39,"stem":40,"icon":41},"How It Works","\u002Fgetting-started\u002Fhow-it-works","1.getting-started\u002F6.how-it-works","i-lucide-workflow",{"title":43,"path":44,"stem":45,"children":46,"page":67},"Core Concepts","\u002Fcore-concepts","2.core-concepts",[47,51,55,59,63],{"title":48,"path":49,"stem":50},"serverAuth()","\u002Fcore-concepts\u002Fserver-auth","2.core-concepts\u002F1.server-auth",{"title":52,"path":53,"stem":54},"Sessions","\u002Fcore-concepts\u002Fsessions","2.core-concepts\u002F2.sessions",{"title":56,"path":57,"stem":58},"Route Protection","\u002Fcore-concepts\u002Froute-protection","2.core-concepts\u002F3.route-protection",{"title":60,"path":61,"stem":62},"Auto‑Imports and Aliases","\u002Fcore-concepts\u002Fauto-imports-aliases","2.core-concepts\u002F4.auto-imports-aliases",{"title":64,"path":65,"stem":66},"Security & Caveats","\u002Fcore-concepts\u002Fsecurity-caveats","2.core-concepts\u002F5.security-caveats",false,{"title":69,"path":70,"stem":71,"children":72,"page":67},"Guides","\u002Fguides","3.guides",[73,77,82,86,90,94,99,103,107,111],{"title":74,"path":75,"stem":76},"Role‑Based Access","\u002Fguides\u002Frole-based-access","3.guides\u002F1.role-based-access",{"title":78,"path":79,"stem":80,"icon":81},"Setup diagnostics","\u002Fguides\u002Fdiagnostics","3.guides\u002F10.diagnostics","i-lucide-circle-alert",{"title":83,"path":84,"stem":85},"OAuth Providers","\u002Fguides\u002Foauth-providers","3.guides\u002F2.oauth-providers",{"title":87,"path":88,"stem":89},"Custom Database","\u002Fguides\u002Fcustom-database","3.guides\u002F3.custom-database",{"title":91,"path":92,"stem":93},"Database-less Mode","\u002Fguides\u002Fdatabase-less-mode","3.guides\u002F4.database-less-mode",{"title":95,"path":96,"stem":97,"icon":98},"External Auth Backend","\u002Fguides\u002Fexternal-auth-backend","3.guides\u002F5.external-auth-backend","i-lucide-server",{"title":100,"path":101,"stem":102},"Migrating from nuxt-auth-utils","\u002Fguides\u002Fmigrate-from-nuxt-auth-utils","3.guides\u002F6.migrate-from-nuxt-auth-utils",{"title":104,"path":105,"stem":106},"Two-Factor Authentication (TOTP + Backup Codes)","\u002Fguides\u002Ftwo-factor-auth","3.guides\u002F7.two-factor-auth",{"title":108,"path":109,"stem":110},"Testing","\u002Fguides\u002Ftesting","3.guides\u002F8.testing",{"title":112,"path":113,"stem":114},"Production Deployment","\u002Fguides\u002Fproduction-deployment","3.guides\u002F9.production-deployment",{"title":116,"path":117,"stem":118,"children":119,"page":67},"Integrations","\u002Fintegrations","4.integrations",[120,124,128,132],{"title":121,"path":122,"stem":123},"NuxtHub","\u002Fintegrations\u002Fnuxthub","4.integrations\u002F1.nuxthub",{"title":125,"path":126,"stem":127},"DevTools","\u002Fintegrations\u002Fdevtools","4.integrations\u002F2.devtools",{"title":129,"path":130,"stem":131},"Convex","\u002Fintegrations\u002Fconvex","4.integrations\u002F3.convex",{"title":133,"path":134,"stem":135},"i18n","\u002Fintegrations\u002Fi18n","4.integrations\u002F4.i18n",{"title":137,"path":138,"stem":139,"children":140,"page":67},"API Reference","\u002Fapi","5.api",[141,145,149,153],{"title":142,"path":143,"stem":144},"Composables","\u002Fapi\u002Fcomposables","5.api\u002F1.composables",{"title":146,"path":147,"stem":148},"Server Utilities","\u002Fapi\u002Fserver-utils","5.api\u002F2.server-utils",{"title":150,"path":151,"stem":152},"Components","\u002Fapi\u002Fcomponents","5.api\u002F3.components",{"title":154,"path":155,"stem":156},"Types","\u002Fapi\u002Ftypes","5.api\u002F4.types",{"title":158,"path":159,"stem":160,"children":161,"icon":81},"Errors","\u002Ferrors","6.errors\u002F0.index",[162,164,168,172,176,180,184,188,192,196,200,204],{"title":163,"path":159,"stem":160},"Overview",{"title":165,"path":166,"stem":167},"Auth configuration failed to load","\u002Ferrors\u002Fnuxt-auth-config-load-failed","6.errors\u002Fnuxt-auth-config-load-failed",{"title":169,"path":170,"stem":171},"Schema generator returned no code","\u002Ferrors\u002Fnuxt-auth-empty-schema","6.errors\u002Fnuxt-auth-empty-schema",{"title":173,"path":174,"stem":175},"Invalid server auth config export","\u002Ferrors\u002Fnuxt-auth-invalid-config-export","6.errors\u002Fnuxt-auth-invalid-config-export",{"title":177,"path":178,"stem":179},"Auth plugin path must be absolute","\u002Ferrors\u002Fnuxt-auth-invalid-plugin-source","6.errors\u002Fnuxt-auth-invalid-plugin-source",{"title":181,"path":182,"stem":183},"Missing auth configuration","\u002Ferrors\u002Fnuxt-auth-missing-config","6.errors\u002Fnuxt-auth-missing-config",{"title":185,"path":186,"stem":187},"NuxtHub database alias is missing","\u002Ferrors\u002Fnuxt-auth-missing-hub-db","6.errors\u002Fnuxt-auth-missing-hub-db",{"title":189,"path":190,"stem":191},"No database provider is enabled","\u002Ferrors\u002Fnuxt-auth-no-database-provider","6.errors\u002Fnuxt-auth-no-database-provider",{"title":193,"path":194,"stem":195},"Auth schema generation failed","\u002Ferrors\u002Fnuxt-auth-schema-generation-failed","6.errors\u002Fnuxt-auth-schema-generation-failed",{"title":197,"path":198,"stem":199},"Custom session storage is missing","\u002Ferrors\u002Fnuxt-auth-schema-storage-required","6.errors\u002Fnuxt-auth-schema-storage-required",{"title":201,"path":202,"stem":203},"Secondary storage in client-only mode","\u002Ferrors\u002Fnuxt-auth-storage-client-only","6.errors\u002Fnuxt-auth-storage-client-only",{"title":205,"path":206,"stem":207},"Unsupported database dialect","\u002Ferrors\u002Fnuxt-auth-unsupported-dialect","6.errors\u002Fnuxt-auth-unsupported-dialect",{"id":209,"title":10,"body":210,"description":634,"extension":635,"links":636,"meta":637,"navigation":638,"path":6,"seo":639,"stem":7,"__hash__":640},"docs\u002F1.getting-started\u002F0.index.md",{"type":211,"value":212,"toc":621},"minimark",[213,217,220,237,254,259,262,292,296,311,315,547,551,554,572,582,586,617],[214,215,216],"p",{},"Use this page when you want the fastest path to a working Nuxt setup.",[214,218,219],{},"This quickstart assumes:",[221,222,223,227,234],"ul",{},[224,225,226],"li",{},"you want the default full-mode setup",[224,228,229,230],{},"you are using ",[231,232,233],"code",{},"pnpm",[224,235,236],{},"you want a local login flow working before you customize providers or plugins",[214,238,239,240,244,245,249,250,253],{},"If you already know you need a different architecture, jump to ",[241,242],"brand-badge",{"name":243,"to":122},"nuxthub",", ",[246,247,248],"a",{"href":88},"custom database",", or ",[246,251,252],{"href":96},"external auth backend",".",[255,256,258],"h2",{"id":257},"what-you-will-end-up-with","What you will end up with",[214,260,261],{},"After this guide you should have:",[221,263,264,273,279,285],{},[224,265,266,269,270],{},[231,267,268],{},"server\u002Fauth.config.ts"," and ",[231,271,272],{},"app\u002Fauth.config.ts",[224,274,275,276],{},"Better Auth handlers mounted at ",[231,277,278],{},"\u002Fapi\u002Fauth\u002F*",[224,280,281,282],{},"a valid ",[231,283,284],{},"NUXT_BETTER_AUTH_SECRET",[224,286,287,288,291],{},"a reactive ",[231,289,290],{},"useUserSession()"," composable in your app",[255,293,295],{"id":294},"before-you-begin","Before you begin",[221,297,298,305],{},[224,299,300,301,304],{},"a local ",[231,302,303],{},".env"," file",[224,306,307,308],{},"a development server you can start with ",[231,309,310],{},"pnpm dev",[255,312,314],{"id":313},"quickstart","Quickstart",[316,317,318,323,354,358,364,375,393,397,491,495,531,535],"steps",{},[319,320,322],"h3",{"id":321},"install-the-module","Install the module",[324,325,330],"pre",{"className":326,"code":327,"language":328,"meta":329,"style":329},"language-bash shiki shiki-themes one-light synthwave-84 synthwave-84","npx nuxi module add @nuxtjs\u002Fbetter-auth\n","bash","",[231,331,332],{"__ignoreMap":329},[333,334,337,341,345,348,351],"span",{"class":335,"line":336},"line",1,[333,338,340],{"class":339},"siqUp","npx",[333,342,344],{"class":343},"sI3kV"," nuxi",[333,346,347],{"class":343}," module",[333,349,350],{"class":343}," add",[333,352,353],{"class":343}," @nuxtjs\u002Fbetter-auth\n",[319,355,357],{"id":356},"add-your-secret","Add your secret",[214,359,360,361,363],{},"Create or update ",[231,362,303],{},":",[324,365,369],{"className":366,"code":367,"filename":303,"language":368,"meta":329,"style":329},"language-ini shiki shiki-themes one-light synthwave-84 synthwave-84","NUXT_BETTER_AUTH_SECRET=\"replace-with-a-random-32-character-secret\"\n","ini",[231,370,371],{"__ignoreMap":329},[333,372,373],{"class":335,"line":336},[333,374,367],{},[214,376,377,378,381,382,385,386,389,390,392],{},"Use a high-entropy value. The module also accepts ",[231,379,380],{},"BETTER_AUTH_SECRET"," as a fallback, or Better Auth's versioned ",[231,383,384],{},"BETTER_AUTH_SECRETS","\u002F",[231,387,388],{},"secrets"," configuration for rotation. ",[231,391,284],{}," remains the recommended default.",[319,394,396],{"id":395},"create-the-server-config","Create the server config",[324,398,402],{"className":399,"code":400,"filename":268,"language":401,"meta":329,"style":329},"language-ts shiki shiki-themes one-light synthwave-84 synthwave-84","import { defineServerAuth } from '@nuxtjs\u002Fbetter-auth\u002Fconfig'\n\nexport default defineServerAuth({\n  emailAndPassword: {\n    enabled: true,\n  },\n})\n","ts",[231,403,404,428,435,452,464,479,485],{"__ignoreMap":329},[333,405,406,410,414,418,421,424],{"class":335,"line":336},[333,407,409],{"class":408},"sqe1H","import",[333,411,413],{"class":412},"s17Py"," { ",[333,415,417],{"class":416},"sYvLG","defineServerAuth",[333,419,420],{"class":412}," } ",[333,422,423],{"class":408},"from",[333,425,427],{"class":426},"sPAZv"," '@nuxtjs\u002Fbetter-auth\u002Fconfig'\n",[333,429,431],{"class":335,"line":430},2,[333,432,434],{"emptyLinePlaceholder":433},true,"\n",[333,436,438,441,445,449],{"class":335,"line":437},3,[333,439,440],{"class":408},"export",[333,442,444],{"class":443},"sKg8T"," default",[333,446,448],{"class":447},"sfT9l"," defineServerAuth",[333,450,451],{"class":412},"({\n",[333,453,455,458,461],{"class":335,"line":454},4,[333,456,457],{"class":416},"  emailAndPassword",[333,459,363],{"class":460},"sVnqq",[333,462,463],{"class":412}," {\n",[333,465,467,470,472,476],{"class":335,"line":466},5,[333,468,469],{"class":416},"    enabled",[333,471,363],{"class":460},[333,473,475],{"class":474},"s3ZNE"," true",[333,477,478],{"class":412},",\n",[333,480,482],{"class":335,"line":481},6,[333,483,484],{"class":412},"  },\n",[333,486,488],{"class":335,"line":487},7,[333,489,490],{"class":412},"})\n",[319,492,494],{"id":493},"create-the-client-config","Create the client config",[324,496,498],{"className":399,"code":497,"filename":272,"language":401,"meta":329,"style":329},"import { defineClientAuth } from '@nuxtjs\u002Fbetter-auth\u002Fconfig'\n\nexport default defineClientAuth({})\n",[231,499,500,515,519],{"__ignoreMap":329},[333,501,502,504,506,509,511,513],{"class":335,"line":336},[333,503,409],{"class":408},[333,505,413],{"class":412},[333,507,508],{"class":416},"defineClientAuth",[333,510,420],{"class":412},[333,512,423],{"class":408},[333,514,427],{"class":426},[333,516,517],{"class":335,"line":430},[333,518,434],{"emptyLinePlaceholder":433},[333,520,521,523,525,528],{"class":335,"line":437},[333,522,440],{"class":408},[333,524,444],{"class":443},[333,526,527],{"class":447}," defineClientAuth",[333,529,530],{"class":412},"({})\n",[319,532,534],{"id":533},"start-nuxt","Start Nuxt",[324,536,538],{"className":326,"code":537,"language":328,"meta":329,"style":329},"pnpm dev\n",[231,539,540],{"__ignoreMap":329},[333,541,542,544],{"class":335,"line":336},[333,543,233],{"class":339},[333,545,546],{"class":343}," dev\n",[255,548,550],{"id":549},"verify-the-result","Verify the result",[214,552,553],{},"Check these success signals:",[221,555,556,559,564,569],{},[224,557,558],{},"your app starts without auth-related module errors",[224,560,561,563],{},[231,562,278],{}," routes are registered",[224,565,566,568],{},[231,567,290],{}," is available in a page or component",[224,570,571],{},"the generated config files match your project structure",[214,573,574,575,578,579,253],{},"If you use a custom ",[231,576,577],{},"srcDir",", the client config lives there instead of ",[231,580,581],{},"app\u002F",[255,583,585],{"id":584},"next-steps","Next steps",[587,588,589,596,603,610],"ol",{},[224,590,591,592,595],{},"Follow ",[246,593,594],{"href":14},"installation"," for the complete setup checklist.",[224,597,598,599,602],{},"Read ",[246,600,601],{"href":19},"configuration"," before adding providers or plugins.",[224,604,605,606,609],{},"Set up ",[246,607,608],{"href":24},"client usage"," in your pages and forms.",[224,611,612,613,616],{},"Add ",[246,614,615],{"href":57},"route protection"," once the login flow works.",[618,619,620],"style",{},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .siqUp, html code.shiki .siqUp{--shiki-light:#4078F2;--shiki-default:#FE4450;--shiki-dark:#FE4450}html pre.shiki code .sI3kV, html code.shiki .sI3kV{--shiki-light:#50A14F;--shiki-default:#BBBBBB;--shiki-dark:#BBBBBB}html pre.shiki code .sqe1H, html code.shiki .sqe1H{--shiki-light:#A626A4;--shiki-default:#FEDE5D;--shiki-dark:#FEDE5D}html pre.shiki code .s17Py, html code.shiki .s17Py{--shiki-light:#383A42;--shiki-default:#BBBBBB;--shiki-dark:#BBBBBB}html pre.shiki code .sYvLG, html code.shiki .sYvLG{--shiki-light:#E45649;--shiki-default:#FF7EDB;--shiki-dark:#FF7EDB}html pre.shiki code .sPAZv, html code.shiki .sPAZv{--shiki-light:#50A14F;--shiki-default:#FF8B39;--shiki-dark:#FF8B39}html pre.shiki code .sKg8T, html code.shiki .sKg8T{--shiki-light:#E45649;--shiki-default:#FEDE5D;--shiki-dark:#FEDE5D}html pre.shiki code .sfT9l, html code.shiki .sfT9l{--shiki-light:#4078F2;--shiki-default:#36F9F6;--shiki-dark:#36F9F6}html pre.shiki code .sVnqq, html code.shiki .sVnqq{--shiki-light:#0184BC;--shiki-default:#B6B1B1;--shiki-dark:#B6B1B1}html pre.shiki code .s3ZNE, html code.shiki .s3ZNE{--shiki-light:#986801;--shiki-default:#F97E72;--shiki-dark:#F97E72}",{"title":329,"searchDepth":430,"depth":430,"links":622},[623,624,625,632,633],{"id":257,"depth":430,"text":258},{"id":294,"depth":430,"text":295},{"id":313,"depth":430,"text":314,"children":626},[627,628,629,630,631],{"id":321,"depth":437,"text":322},{"id":356,"depth":437,"text":357},{"id":395,"depth":437,"text":396},{"id":493,"depth":437,"text":494},{"id":533,"depth":437,"text":534},{"id":549,"depth":430,"text":550},{"id":584,"depth":430,"text":585},"Nuxt Better Auth integrates Better Auth with Nuxt for route protection, session management, and schema generation.","md",null,{},{"icon":11},{"title":10,"description":634},"tfQmonzilSSfV7sgB0fdRGXNPTrPHxpQQ3GMZ9DuCiQ",[636,642],{"title":13,"path":14,"stem":15,"description":643,"icon":16,"children":-1},"Learn how to add Nuxt Better Auth to your Nuxt project.",1791073725977]