[{"data":1,"prerenderedAt":588},["ShallowReactive",2],{"navigation_docs":3,"-getting-started":152,"-getting-started-surround":585},[4,42,68,110,131],{"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,81,85,89,94,98,102,106],{"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},"OAuth Providers","\u002Fguides\u002Foauth-providers","3.guides\u002F2.oauth-providers",{"title":82,"path":83,"stem":84},"Custom Database","\u002Fguides\u002Fcustom-database","3.guides\u002F3.custom-database",{"title":86,"path":87,"stem":88},"Database-less Mode","\u002Fguides\u002Fdatabase-less-mode","3.guides\u002F4.database-less-mode",{"title":90,"path":91,"stem":92,"icon":93},"External Auth Backend","\u002Fguides\u002Fexternal-auth-backend","3.guides\u002F5.external-auth-backend","i-lucide-server",{"title":95,"path":96,"stem":97},"Migrating from nuxt-auth-utils","\u002Fguides\u002Fmigrate-from-nuxt-auth-utils","3.guides\u002F6.migrate-from-nuxt-auth-utils",{"title":99,"path":100,"stem":101},"Two-Factor Authentication (TOTP + Backup Codes)","\u002Fguides\u002Ftwo-factor-auth","3.guides\u002F7.two-factor-auth",{"title":103,"path":104,"stem":105},"Testing","\u002Fguides\u002Ftesting","3.guides\u002F8.testing",{"title":107,"path":108,"stem":109},"Production Deployment","\u002Fguides\u002Fproduction-deployment","3.guides\u002F9.production-deployment",{"title":111,"path":112,"stem":113,"children":114,"page":67},"Integrations","\u002Fintegrations","4.integrations",[115,119,123,127],{"title":116,"path":117,"stem":118},"NuxtHub","\u002Fintegrations\u002Fnuxthub","4.integrations\u002F1.nuxthub",{"title":120,"path":121,"stem":122},"DevTools","\u002Fintegrations\u002Fdevtools","4.integrations\u002F2.devtools",{"title":124,"path":125,"stem":126},"Convex","\u002Fintegrations\u002Fconvex","4.integrations\u002F3.convex",{"title":128,"path":129,"stem":130},"i18n","\u002Fintegrations\u002Fi18n","4.integrations\u002F4.i18n",{"title":132,"path":133,"stem":134,"children":135,"page":67},"API Reference","\u002Fapi","5.api",[136,140,144,148],{"title":137,"path":138,"stem":139},"Composables","\u002Fapi\u002Fcomposables","5.api\u002F1.composables",{"title":141,"path":142,"stem":143},"Server Utilities","\u002Fapi\u002Fserver-utils","5.api\u002F2.server-utils",{"title":145,"path":146,"stem":147},"Components","\u002Fapi\u002Fcomponents","5.api\u002F3.components",{"title":149,"path":150,"stem":151},"Types","\u002Fapi\u002Ftypes","5.api\u002F4.types",{"id":153,"title":10,"body":154,"description":578,"extension":579,"links":580,"meta":581,"navigation":582,"path":6,"seo":583,"stem":7,"__hash__":584},"docs\u002F1.getting-started\u002F0.index.md",{"type":155,"value":156,"toc":565},"minimark",[157,161,164,181,198,203,206,236,240,255,259,491,495,498,516,526,530,561],[158,159,160],"p",{},"Use this page when you want the fastest path to a working Nuxt setup.",[158,162,163],{},"This quickstart assumes:",[165,166,167,171,178],"ul",{},[168,169,170],"li",{},"you want the default full-mode setup",[168,172,173,174],{},"you are using ",[175,176,177],"code",{},"pnpm",[168,179,180],{},"you want a local login flow working before you customize providers or plugins",[158,182,183,184,188,189,193,194,197],{},"If you already know you need a different architecture, jump to ",[185,186],"brand-badge",{"name":187,"to":117},"nuxthub",", ",[190,191,192],"a",{"href":83},"custom database",", or ",[190,195,196],{"href":91},"external auth backend",".",[199,200,202],"h2",{"id":201},"what-you-will-end-up-with","What you will end up with",[158,204,205],{},"After this guide you should have:",[165,207,208,217,223,229],{},[168,209,210,213,214],{},[175,211,212],{},"server\u002Fauth.config.ts"," and ",[175,215,216],{},"app\u002Fauth.config.ts",[168,218,219,220],{},"Better Auth handlers mounted at ",[175,221,222],{},"\u002Fapi\u002Fauth\u002F*",[168,224,225,226],{},"a valid ",[175,227,228],{},"NUXT_BETTER_AUTH_SECRET",[168,230,231,232,235],{},"a reactive ",[175,233,234],{},"useUserSession()"," composable in your app",[199,237,239],{"id":238},"before-you-begin","Before you begin",[165,241,242,249],{},[168,243,244,245,248],{},"a local ",[175,246,247],{},".env"," file",[168,250,251,252],{},"a development server you can start with ",[175,253,254],{},"pnpm dev",[199,256,258],{"id":257},"quickstart","Quickstart",[260,261,262,267,298,302,308,319,337,341,435,439,475,479],"steps",{},[263,264,266],"h3",{"id":265},"install-the-module","Install the module",[268,269,274],"pre",{"className":270,"code":271,"language":272,"meta":273,"style":273},"language-bash shiki shiki-themes one-light synthwave-84 synthwave-84","npx nuxi module add @nuxtjs\u002Fbetter-auth\n","bash","",[175,275,276],{"__ignoreMap":273},[277,278,281,285,289,292,295],"span",{"class":279,"line":280},"line",1,[277,282,284],{"class":283},"siqUp","npx",[277,286,288],{"class":287},"sI3kV"," nuxi",[277,290,291],{"class":287}," module",[277,293,294],{"class":287}," add",[277,296,297],{"class":287}," @nuxtjs\u002Fbetter-auth\n",[263,299,301],{"id":300},"add-your-secret","Add your secret",[158,303,304,305,307],{},"Create or update ",[175,306,247],{},":",[268,309,313],{"className":310,"code":311,"filename":247,"language":312,"meta":273,"style":273},"language-ini shiki shiki-themes one-light synthwave-84 synthwave-84","NUXT_BETTER_AUTH_SECRET=\"replace-with-a-random-32-character-secret\"\n","ini",[175,314,315],{"__ignoreMap":273},[277,316,317],{"class":279,"line":280},[277,318,311],{},[158,320,321,322,325,326,329,330,333,334,336],{},"Use a high-entropy value. The module also accepts ",[175,323,324],{},"BETTER_AUTH_SECRET"," as a fallback, or Better Auth's versioned ",[175,327,328],{},"BETTER_AUTH_SECRETS","\u002F",[175,331,332],{},"secrets"," configuration for rotation. ",[175,335,228],{}," remains the recommended default.",[263,338,340],{"id":339},"create-the-server-config","Create the server config",[268,342,346],{"className":343,"code":344,"filename":212,"language":345,"meta":273,"style":273},"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",[175,347,348,372,379,396,408,423,429],{"__ignoreMap":273},[277,349,350,354,358,362,365,368],{"class":279,"line":280},[277,351,353],{"class":352},"sqe1H","import",[277,355,357],{"class":356},"s17Py"," { ",[277,359,361],{"class":360},"sYvLG","defineServerAuth",[277,363,364],{"class":356}," } ",[277,366,367],{"class":352},"from",[277,369,371],{"class":370},"sPAZv"," '@nuxtjs\u002Fbetter-auth\u002Fconfig'\n",[277,373,375],{"class":279,"line":374},2,[277,376,378],{"emptyLinePlaceholder":377},true,"\n",[277,380,382,385,389,393],{"class":279,"line":381},3,[277,383,384],{"class":352},"export",[277,386,388],{"class":387},"sKg8T"," default",[277,390,392],{"class":391},"sfT9l"," defineServerAuth",[277,394,395],{"class":356},"({\n",[277,397,399,402,405],{"class":279,"line":398},4,[277,400,401],{"class":360},"  emailAndPassword",[277,403,307],{"class":404},"sVnqq",[277,406,407],{"class":356}," {\n",[277,409,411,414,416,420],{"class":279,"line":410},5,[277,412,413],{"class":360},"    enabled",[277,415,307],{"class":404},[277,417,419],{"class":418},"s3ZNE"," true",[277,421,422],{"class":356},",\n",[277,424,426],{"class":279,"line":425},6,[277,427,428],{"class":356},"  },\n",[277,430,432],{"class":279,"line":431},7,[277,433,434],{"class":356},"})\n",[263,436,438],{"id":437},"create-the-client-config","Create the client config",[268,440,442],{"className":343,"code":441,"filename":216,"language":345,"meta":273,"style":273},"import { defineClientAuth } from '@nuxtjs\u002Fbetter-auth\u002Fconfig'\n\nexport default defineClientAuth({})\n",[175,443,444,459,463],{"__ignoreMap":273},[277,445,446,448,450,453,455,457],{"class":279,"line":280},[277,447,353],{"class":352},[277,449,357],{"class":356},[277,451,452],{"class":360},"defineClientAuth",[277,454,364],{"class":356},[277,456,367],{"class":352},[277,458,371],{"class":370},[277,460,461],{"class":279,"line":374},[277,462,378],{"emptyLinePlaceholder":377},[277,464,465,467,469,472],{"class":279,"line":381},[277,466,384],{"class":352},[277,468,388],{"class":387},[277,470,471],{"class":391}," defineClientAuth",[277,473,474],{"class":356},"({})\n",[263,476,478],{"id":477},"start-nuxt","Start Nuxt",[268,480,482],{"className":270,"code":481,"language":272,"meta":273,"style":273},"pnpm dev\n",[175,483,484],{"__ignoreMap":273},[277,485,486,488],{"class":279,"line":280},[277,487,177],{"class":283},[277,489,490],{"class":287}," dev\n",[199,492,494],{"id":493},"verify-the-result","Verify the result",[158,496,497],{},"Check these success signals:",[165,499,500,503,508,513],{},[168,501,502],{},"your app starts without auth-related module errors",[168,504,505,507],{},[175,506,222],{}," routes are registered",[168,509,510,512],{},[175,511,234],{}," is available in a page or component",[168,514,515],{},"the generated config files match your project structure",[158,517,518,519,522,523,197],{},"If you use a custom ",[175,520,521],{},"srcDir",", the client config lives there instead of ",[175,524,525],{},"app\u002F",[199,527,529],{"id":528},"next-steps","Next steps",[531,532,533,540,547,554],"ol",{},[168,534,535,536,539],{},"Follow ",[190,537,538],{"href":14},"installation"," for the complete setup checklist.",[168,541,542,543,546],{},"Read ",[190,544,545],{"href":19},"configuration"," before adding providers or plugins.",[168,548,549,550,553],{},"Set up ",[190,551,552],{"href":24},"client usage"," in your pages and forms.",[168,555,556,557,560],{},"Add ",[190,558,559],{"href":57},"route protection"," once the login flow works.",[562,563,564],"style",{},"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 .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 .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":273,"searchDepth":374,"depth":374,"links":566},[567,568,569,576,577],{"id":201,"depth":374,"text":202},{"id":238,"depth":374,"text":239},{"id":257,"depth":374,"text":258,"children":570},[571,572,573,574,575],{"id":265,"depth":381,"text":266},{"id":300,"depth":381,"text":301},{"id":339,"depth":381,"text":340},{"id":437,"depth":381,"text":438},{"id":477,"depth":381,"text":478},{"id":493,"depth":374,"text":494},{"id":528,"depth":374,"text":529},"Nuxt Better Auth integrates Better Auth with Nuxt for route protection, session management, and schema generation.","md",null,{},{"icon":11},{"title":10,"description":578},"BCTwHI7-gK6Ix8HiRiBFInKL2Y3KH9sBrfGPP9Y3NnQ",[580,586],{"title":13,"path":14,"stem":15,"description":587,"icon":16,"children":-1},"Learn how to add Nuxt Better Auth to your Nuxt project.",1788606328668]