[{"data":1,"prerenderedAt":659},["ShallowReactive",2],{"navigation_docs":3,"-getting-started-installation":152,"-getting-started-installation-surround":654},[4,42,68,110,131],{"title":5,"path":6,"stem":7,"children":8,"icon":11},"Getting Started","/getting-started","1.getting-started/0.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","/getting-started/installation","1.getting-started/1.installation","i-lucide-download",{"title":18,"path":19,"stem":20,"icon":21},"Configuration","/getting-started/configuration","1.getting-started/2.configuration","i-lucide-settings",{"title":23,"path":24,"stem":25,"icon":26},"Client Setup","/getting-started/client-setup","1.getting-started/3.client-setup","i-lucide-monitor",{"title":28,"path":29,"stem":30,"icon":31},"Type Augmentation","/getting-started/type-augmentation","1.getting-started/4.type-augmentation","i-lucide-type",{"title":33,"path":34,"stem":35,"icon":36},"Schema Generation (NuxtHub)","/getting-started/schema-generation","1.getting-started/5.schema-generation","i-lucide-database",{"title":38,"path":39,"stem":40,"icon":41},"How It Works","/getting-started/how-it-works","1.getting-started/6.how-it-works","i-lucide-workflow",{"title":43,"path":44,"stem":45,"children":46,"page":67},"Core Concepts","/core-concepts","2.core-concepts",[47,51,55,59,63],{"title":48,"path":49,"stem":50},"serverAuth()","/core-concepts/server-auth","2.core-concepts/1.server-auth",{"title":52,"path":53,"stem":54},"Sessions","/core-concepts/sessions","2.core-concepts/2.sessions",{"title":56,"path":57,"stem":58},"Route Protection","/core-concepts/route-protection","2.core-concepts/3.route-protection",{"title":60,"path":61,"stem":62},"Auto‑Imports and Aliases","/core-concepts/auto-imports-aliases","2.core-concepts/4.auto-imports-aliases",{"title":64,"path":65,"stem":66},"Security & Caveats","/core-concepts/security-caveats","2.core-concepts/5.security-caveats",false,{"title":69,"path":70,"stem":71,"children":72,"page":67},"Guides","/guides","3.guides",[73,77,81,85,89,94,98,102,106],{"title":74,"path":75,"stem":76},"Role‑Based Access","/guides/role-based-access","3.guides/1.role-based-access",{"title":78,"path":79,"stem":80},"OAuth Providers","/guides/oauth-providers","3.guides/2.oauth-providers",{"title":82,"path":83,"stem":84},"Custom Database","/guides/custom-database","3.guides/3.custom-database",{"title":86,"path":87,"stem":88},"Database-less Mode","/guides/database-less-mode","3.guides/4.database-less-mode",{"title":90,"path":91,"stem":92,"icon":93},"External Auth Backend","/guides/external-auth-backend","3.guides/5.external-auth-backend","i-lucide-server",{"title":95,"path":96,"stem":97},"Migrating from nuxt-auth-utils","/guides/migrate-from-nuxt-auth-utils","3.guides/6.migrate-from-nuxt-auth-utils",{"title":99,"path":100,"stem":101},"Two-Factor Authentication (TOTP + Backup Codes)","/guides/two-factor-auth","3.guides/7.two-factor-auth",{"title":103,"path":104,"stem":105},"Testing","/guides/testing","3.guides/8.testing",{"title":107,"path":108,"stem":109},"Production Deployment","/guides/production-deployment","3.guides/9.production-deployment",{"title":111,"path":112,"stem":113,"children":114,"page":67},"Integrations","/integrations","4.integrations",[115,119,123,127],{"title":116,"path":117,"stem":118},"NuxtHub","/integrations/nuxthub","4.integrations/1.nuxthub",{"title":120,"path":121,"stem":122},"DevTools","/integrations/devtools","4.integrations/2.devtools",{"title":124,"path":125,"stem":126},"Convex","/integrations/convex","4.integrations/3.convex",{"title":128,"path":129,"stem":130},"i18n","/integrations/i18n","4.integrations/4.i18n",{"title":132,"path":133,"stem":134,"children":135,"page":67},"API Reference","/api","5.api",[136,140,144,148],{"title":137,"path":138,"stem":139},"Composables","/api/composables","5.api/1.composables",{"title":141,"path":142,"stem":143},"Server Utilities","/api/server-utils","5.api/2.server-utils",{"title":145,"path":146,"stem":147},"Components","/api/components","5.api/3.components",{"title":149,"path":150,"stem":151},"Types","/api/types","5.api/4.types",{"id":153,"title":13,"body":154,"description":647,"extension":648,"links":649,"meta":650,"navigation":651,"path":14,"seo":652,"stem":15,"__hash__":653},"docs/1.getting-started/1.installation.md",{"type":155,"value":156,"toc":637},"minimark",[157,222,226,231,248,252,554,558,561,584,588,615,626,633],[158,159,160],"code-collapse",{},[161,162,168],"pre",{"className":163,"code":164,"filename":165,"language":166,"meta":167,"style":167},"language-txt shiki shiki-themes one-light synthwave-84 synthwave-84","Install @onmax/nuxt-better-auth in my Nuxt 4 app.\n\n- Run `npx nuxi module add @onmax/nuxt-better-auth@alpha`\n- Set `BETTER_AUTH_SECRET` in `.env` (at least 32 chars, high entropy). Optionally prefix with `NUXT_` for runtime config\n- Optionally set `NUXT_PUBLIC_SITE_URL` for non-auto-detected platforms\n- Create `server/auth.config.ts` using `defineServerAuth` from `@onmax/nuxt-better-auth/config`\n- Create `app/auth.config.ts` using `defineClientAuth` from `@onmax/nuxt-better-auth/config`\n- The module auto-injects `secret` and `baseURL` — do not configure them manually\n","Prompt","txt","",[169,170,171,179,186,192,198,204,210,216],"code",{"__ignoreMap":167},[172,173,176],"span",{"class":174,"line":175},"line",1,[172,177,178],{},"Install @onmax/nuxt-better-auth in my Nuxt 4 app.\n",[172,180,182],{"class":174,"line":181},2,[172,183,185],{"emptyLinePlaceholder":184},true,"\n",[172,187,189],{"class":174,"line":188},3,[172,190,191],{},"- Run `npx nuxi module add @onmax/nuxt-better-auth@alpha`\n",[172,193,195],{"class":174,"line":194},4,[172,196,197],{},"- Set `BETTER_AUTH_SECRET` in `.env` (at least 32 chars, high entropy). Optionally prefix with `NUXT_` for runtime config\n",[172,199,201],{"class":174,"line":200},5,[172,202,203],{},"- Optionally set `NUXT_PUBLIC_SITE_URL` for non-auto-detected platforms\n",[172,205,207],{"class":174,"line":206},6,[172,208,209],{},"- Create `server/auth.config.ts` using `defineServerAuth` from `@onmax/nuxt-better-auth/config`\n",[172,211,213],{"class":174,"line":212},7,[172,214,215],{},"- Create `app/auth.config.ts` using `defineClientAuth` from `@onmax/nuxt-better-auth/config`\n",[172,217,219],{"class":174,"line":218},8,[172,220,221],{},"- The module auto-injects `secret` and `baseURL` — do not configure them manually\n",[223,224,225],"p",{},"Use this page when you want the full install checklist rather than the shorter quickstart.",[227,228,230],"h2",{"id":229},"prerequisites","Prerequisites",[232,233,234,238,241],"ul",{},[235,236,237],"li",{},"Nuxt v4.0+",[235,239,240],{},"a package manager configured for your app",[235,242,243,244,247],{},"a local ",[169,245,246],{},".env"," file or deployment environment variable system",[227,249,251],{"id":250},"add-to-project","Add to project",[253,254,255,260,286,290,309,315,324,327,336,339,342,362,371,379,382,391,395,414,417,438,441,518],"steps",{},[256,257,259],"h3",{"id":258},"install-the-module","Install the module",[161,261,265],{"className":262,"code":263,"language":264,"meta":167,"style":167},"language-bash shiki shiki-themes one-light synthwave-84 synthwave-84","npx nuxi module add @onmax/nuxt-better-auth@alpha\n","bash",[169,266,267],{"__ignoreMap":167},[172,268,269,273,277,280,283],{"class":174,"line":175},[172,270,272],{"class":271},"siqUp","npx",[172,274,276],{"class":275},"sI3kV"," nuxi",[172,278,279],{"class":275}," module",[172,281,282],{"class":275}," add",[172,284,285],{"class":275}," @onmax/nuxt-better-auth@alpha\n",[256,287,289],{"id":288},"set-environment-variables","Set environment variables",[291,292,293,294,297,298,301,302,304,305,308],"tip",{"icon":11},"When you install the module with ",[169,295,296],{},"nuxi module add",", it prompts you to generate ",[169,299,300],{},"NUXT_BETTER_AUTH_SECRET"," and can append it to your ",[169,303,246],{},". ",[169,306,307],{},"BETTER_AUTH_SECRET"," still works as a compatibility fallback. In CI/test environments it auto-generates the secret.",[223,310,311,312,314],{},"Add these environment variables to ",[169,313,246],{},":",[316,317,318],"ol",{},[235,319,320],{},[321,322,323],"strong",{},"Secret Key",[223,325,326],{},"The secret encrypts and hashes sensitive data. Must be at least 32 characters with high entropy.",[161,328,330],{"className":163,"code":329,"filename":246,"language":166,"meta":167,"style":167},"NUXT_BETTER_AUTH_SECRET=\n",[169,331,332],{"__ignoreMap":167},[172,333,334],{"class":174,"line":175},[172,335,329],{},[337,338],"generate-secret",{},[223,340,341],{},"Or generate via terminal:",[161,343,345],{"className":262,"code":344,"language":264,"meta":167,"style":167},"openssl rand -base64 32\n",[169,346,347],{"__ignoreMap":167},[172,348,349,352,355,359],{"class":174,"line":175},[172,350,351],{"class":271},"openssl",[172,353,354],{"class":275}," rand",[172,356,358],{"class":357},"s3ZNE"," -base64",[172,360,361],{"class":357}," 32\n",[291,363,364,365,367,368,370],{},"Use ",[169,366,300],{}," for Nuxt runtime config and multi-environment deployments. ",[169,369,307],{}," remains supported as a fallback.",[316,372,373],{"start":181},[235,374,375,378],{},[321,376,377],{},"Base URL"," (Optional)",[223,380,381],{},"The module auto-detects the URL on Vercel, Cloudflare Pages, and Netlify. Set manually for other platforms.",[161,383,385],{"className":163,"code":384,"filename":246,"language":166,"meta":167,"style":167},"NUXT_PUBLIC_SITE_URL=https://your-domain.com\n",[169,386,387],{"__ignoreMap":167},[172,388,389],{"class":174,"line":175},[172,390,384],{},[256,392,394],{"id":393},"create-configuration-files","Create configuration files",[291,396,397,398,401,402,405,406,409,410,413],{"icon":11},"During module install, ",[169,399,400],{},"server/auth.config.ts"," and ",[169,403,404],{},"\u003CsrcDir>/auth.config.ts"," are scaffolded if missing. The client config is placed in your ",[169,407,408],{},"srcDir"," (e.g., ",[169,411,412],{},"app/"," or project root).",[223,415,416],{},"The module requires two configuration files:",[316,418,419,427],{},[235,420,421,424,425],{},[321,422,423],{},"Server Configuration",": ",[169,426,400],{},[235,428,429,424,432,409,434,437],{},[321,430,431],{},"Client Configuration",[169,433,404],{},[169,435,436],{},"app/auth.config.ts",")",[223,439,440],{},"Create these files with the following content:",[161,442,446],{"className":443,"code":444,"filename":400,"language":445,"meta":167,"style":167},"language-ts shiki shiki-themes one-light synthwave-84 synthwave-84","import { defineServerAuth } from '@onmax/nuxt-better-auth/config'\n\nexport default defineServerAuth({\n  emailAndPassword: { enabled: true }\n})\n","ts",[169,447,448,472,476,492,513],{"__ignoreMap":167},[172,449,450,454,458,462,465,468],{"class":174,"line":175},[172,451,453],{"class":452},"sqe1H","import",[172,455,457],{"class":456},"s17Py"," { ",[172,459,461],{"class":460},"sYvLG","defineServerAuth",[172,463,464],{"class":456}," } ",[172,466,467],{"class":452},"from",[172,469,471],{"class":470},"sPAZv"," '@onmax/nuxt-better-auth/config'\n",[172,473,474],{"class":174,"line":181},[172,475,185],{"emptyLinePlaceholder":184},[172,477,478,481,485,489],{"class":174,"line":188},[172,479,480],{"class":452},"export",[172,482,484],{"class":483},"sKg8T"," default",[172,486,488],{"class":487},"sfT9l"," defineServerAuth",[172,490,491],{"class":456},"({\n",[172,493,494,497,500,502,505,507,510],{"class":174,"line":194},[172,495,496],{"class":460},"  emailAndPassword",[172,498,314],{"class":499},"sVnqq",[172,501,457],{"class":456},[172,503,504],{"class":460},"enabled",[172,506,314],{"class":499},[172,508,509],{"class":357}," true",[172,511,512],{"class":456}," }\n",[172,514,515],{"class":174,"line":200},[172,516,517],{"class":456},"})\n",[161,519,521],{"className":443,"code":520,"filename":436,"language":445,"meta":167,"style":167},"import { defineClientAuth } from '@onmax/nuxt-better-auth/config'\n\nexport default defineClientAuth({})\n",[169,522,523,538,542],{"__ignoreMap":167},[172,524,525,527,529,532,534,536],{"class":174,"line":175},[172,526,453],{"class":452},[172,528,457],{"class":456},[172,530,531],{"class":460},"defineClientAuth",[172,533,464],{"class":456},[172,535,467],{"class":452},[172,537,471],{"class":470},[172,539,540],{"class":174,"line":181},[172,541,185],{"emptyLinePlaceholder":184},[172,543,544,546,548,551],{"class":174,"line":188},[172,545,480],{"class":452},[172,547,484],{"class":483},[172,549,550],{"class":487}," defineClientAuth",[172,552,553],{"class":456},"({})\n",[227,555,557],{"id":556},"verify-the-installation","Verify the installation",[223,559,560],{},"Confirm all of the following:",[232,562,563,566,571,579],{},[235,564,565],{},"Nuxt starts without missing-config errors",[235,567,568,570],{},[169,569,400],{}," exists",[235,572,573,575,576,578],{},[169,574,436],{}," or your ",[169,577,408],{}," equivalent exists",[235,580,581,583],{},[169,582,300],{}," is available at runtime",[227,585,587],{"id":586},"next-steps","Next steps",[232,589,590,598,604],{},[235,591,592,593,597],{},"Continue with ",[594,595,596],"a",{"href":19},"configuration"," to set module options and route protection.",[235,599,592,600,603],{},[594,601,602],{"href":24},"client setup"," to wire sign-in and sign-out flows.",[235,605,606,607,610,611,614],{},"If you need durable persistence, pick either ",[594,608,609],{"href":117},"NuxtHub integration"," or ",[594,612,613],{"href":83},"custom database",".",[616,617,618,621,622,625],"callout",{"icon":36,"to":117},[321,619,620],{},"Need database persistence?"," See ",[594,623,624],{"href":117},"NuxtHub Integration"," for auto-generated schemas and full database support.",[616,627,629,632],{"icon":628,"to":83},"i-lucide-hard-drive",[321,630,631],{},"Bring your own database?"," Use Drizzle, Prisma, or Kysely adapters with any database.",[634,635,636],"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 .s3ZNE, html code.shiki .s3ZNE{--shiki-light:#986801;--shiki-default:#F97E72;--shiki-dark:#F97E72}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}",{"title":167,"searchDepth":181,"depth":181,"links":638},[639,640,645,646],{"id":229,"depth":181,"text":230},{"id":250,"depth":181,"text":251,"children":641},[642,643,644],{"id":258,"depth":188,"text":259},{"id":288,"depth":188,"text":289},{"id":393,"depth":188,"text":394},{"id":556,"depth":181,"text":557},{"id":586,"depth":181,"text":587},"Learn how to add Nuxt Better Auth to your Nuxt project.","md",null,{},{"icon":16},{"title":13,"description":647},"YlTqWusQPKccphOsnoP5KeKaugwdxU1_WC4M0DRNF7s",[655,657],{"title":10,"path":6,"stem":7,"description":656,"icon":11,"children":-1},"Nuxt Better Auth integrates Better Auth with Nuxt for route protection, session management, and schema generation.",{"title":18,"path":19,"stem":20,"description":658,"icon":21,"children":-1},"Configure the module options and your Better Auth server instance.",1777450760655]