[{"data":1,"prerenderedAt":713},["ShallowReactive",2],{"navigation_docs":3,"-guides-database-less-mode":216,"-guides-database-less-mode-surround":708},[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,208,212],{"title":163,"path":159,"stem":160},"Overview",{"title":165,"path":166,"stem":167},"Better Auth CLI is not installed","\u002Ferrors\u002Fnuxt-auth-cli-missing","6.errors\u002Fnuxt-auth-cli-missing",{"title":169,"path":170,"stem":171},"Better Auth CLI version does not match better-auth","\u002Ferrors\u002Fnuxt-auth-cli-version-mismatch","6.errors\u002Fnuxt-auth-cli-version-mismatch",{"title":173,"path":174,"stem":175},"Auth configuration failed to load","\u002Ferrors\u002Fnuxt-auth-config-load-failed","6.errors\u002Fnuxt-auth-config-load-failed",{"title":177,"path":178,"stem":179},"Schema generator returned no code","\u002Ferrors\u002Fnuxt-auth-empty-schema","6.errors\u002Fnuxt-auth-empty-schema",{"title":181,"path":182,"stem":183},"Invalid server auth config export","\u002Ferrors\u002Fnuxt-auth-invalid-config-export","6.errors\u002Fnuxt-auth-invalid-config-export",{"title":185,"path":186,"stem":187},"Auth plugin path must be absolute","\u002Ferrors\u002Fnuxt-auth-invalid-plugin-source","6.errors\u002Fnuxt-auth-invalid-plugin-source",{"title":189,"path":190,"stem":191},"Missing auth configuration","\u002Ferrors\u002Fnuxt-auth-missing-config","6.errors\u002Fnuxt-auth-missing-config",{"title":193,"path":194,"stem":195},"NuxtHub database alias is missing","\u002Ferrors\u002Fnuxt-auth-missing-hub-db","6.errors\u002Fnuxt-auth-missing-hub-db",{"title":197,"path":198,"stem":199},"No database provider is enabled","\u002Ferrors\u002Fnuxt-auth-no-database-provider","6.errors\u002Fnuxt-auth-no-database-provider",{"title":201,"path":202,"stem":203},"Auth schema generation failed","\u002Ferrors\u002Fnuxt-auth-schema-generation-failed","6.errors\u002Fnuxt-auth-schema-generation-failed",{"title":205,"path":206,"stem":207},"Custom session storage is missing","\u002Ferrors\u002Fnuxt-auth-schema-storage-required","6.errors\u002Fnuxt-auth-schema-storage-required",{"title":209,"path":210,"stem":211},"Secondary storage in client-only mode","\u002Ferrors\u002Fnuxt-auth-storage-client-only","6.errors\u002Fnuxt-auth-storage-client-only",{"title":213,"path":214,"stem":215},"Unsupported database dialect","\u002Ferrors\u002Fnuxt-auth-unsupported-dialect","6.errors\u002Fnuxt-auth-unsupported-dialect",{"id":217,"title":91,"body":218,"description":702,"extension":703,"links":704,"meta":705,"navigation":450,"path":92,"seo":706,"stem":93,"__hash__":707},"docs\u002F3.guides\u002F4.database-less-mode.md",{"type":219,"value":220,"toc":691},"minimark",[221,225,228,239,246,251,275,280,285,288,294,298,301,305,313,317,320,325,329,332,337,348,352,355,413,417,420,648,651,655,660,671,676,687],[222,223,224],"p",{},"Use this guide when you want stateless sessions and you accept the operational tradeoffs that come with not having persistent auth records.",[222,226,227],{},"Better Auth supports running without a database using encrypted cookie sessions (JWE).",[229,230,233,234,238],"callout",{"icon":231,"to":232},"i-lucide-external-link","https:\u002F\u002Fwww.better-auth.com\u002Fdocs\u002Fconcepts\u002Fdatabase#primitives-for-database-less-auth","See the official ",[235,236,237],"strong",{},"Better Auth documentation"," for database-less setup.",[222,240,241,242,245],{},"Database-less mode uses ",[235,243,244],{},"JWE (JSON Web Encryption)"," sessions. Instead of storing sessions in a database, the session data is encrypted and stored entirely in the cookie.",[222,247,248],{},[235,249,250],{},"How it works:",[252,253,254,266,269,272],"ul",{},[255,256,257,258,262,263],"li",{},"Session data is encrypted with your singular secret or the current key in ",[259,260,261],"code",{},"BETTER_AUTH_SECRETS","\u002F",[259,264,265],{},"secrets",[255,267,268],{},"The encrypted token is stored in a cookie",[255,270,271],{},"On each request, the server decrypts the cookie to get session data",[255,273,274],{},"No database queries needed for session validation",[276,277,279],"h2",{"id":278},"limitations","Limitations",[281,282,284],"h3",{"id":283},"no-server-side-session-revocation","No Server-Side Session Revocation",[222,286,287],{},"You cannot invalidate a session before it expires. The user must wait for the cookie to expire.",[222,289,290,293],{},[235,291,292],{},"Workaround:"," Use short session lifetimes (e.g., 1 hour) and implement token refresh.",[281,295,297],{"id":296},"no-emailpassword-without-external-storage","No Email\u002FPassword Without External Storage",[222,299,300],{},"Email\u002Fpassword requires storing user credentials somewhere.",[222,302,303],{},[235,304,292],{},[252,306,307,310],{},[255,308,309],{},"Use OAuth providers only (GitHub, Google store the credentials)",[255,311,312],{},"Or use an external user database while keeping sessions database-less",[281,314,316],{"id":315},"no-multi-device-session-management","No Multi-Device Session Management",[222,318,319],{},"Cannot list or revoke sessions across devices.",[222,321,322,324],{},[235,323,292],{}," Implement device tracking in your application layer if needed.",[281,326,328],{"id":327},"oauth-considerations","OAuth Considerations",[222,330,331],{},"OAuth can work in database-less mode, but account state is stored in encrypted cookies (JWE) instead of a database. This limits server-side management and auditing.",[333,334,336],"h4",{"id":335},"when-to-avoid-db-less-oauth","When to avoid DB-less OAuth",[252,338,339,342,345],{},[255,340,341],{},"You need to list\u002Frevoke sessions across devices",[255,343,344],{},"You need durable account records (admin tools, audits)",[255,346,347],{},"You rely on server-side account linking or management",[276,349,351],{"id":350},"nuxt-configuration","Nuxt Configuration",[222,353,354],{},"Simply don't configure a database adapter:",[356,357,363],"pre",{"className":358,"code":359,"filename":360,"language":361,"meta":362,"style":362},"language-ts shiki shiki-themes one-light synthwave-84 synthwave-84","export default defineNuxtConfig({\n  modules: ['@nuxtjs\u002Fbetter-auth'],\n})\n","nuxt.config.ts","ts","",[259,364,365,386,407],{"__ignoreMap":362},[366,367,370,374,378,382],"span",{"class":368,"line":369},"line",1,[366,371,373],{"class":372},"sqe1H","export",[366,375,377],{"class":376},"sKg8T"," default",[366,379,381],{"class":380},"sfT9l"," defineNuxtConfig",[366,383,385],{"class":384},"s17Py","({\n",[366,387,389,393,397,400,404],{"class":368,"line":388},2,[366,390,392],{"class":391},"sYvLG","  modules",[366,394,396],{"class":395},"sVnqq",":",[366,398,399],{"class":384}," [",[366,401,403],{"class":402},"sPAZv","'@nuxtjs\u002Fbetter-auth'",[366,405,406],{"class":384},"],\n",[366,408,410],{"class":368,"line":409},3,[366,411,412],{"class":384},"})\n",[276,414,416],{"id":415},"auth-configuration","Auth Configuration",[222,418,419],{},"Enable JWE sessions and cookie-based OAuth state:",[356,421,424],{"className":358,"code":422,"filename":423,"language":361,"meta":362,"style":362},"import { defineServerAuth } from '@nuxtjs\u002Fbetter-auth\u002Fconfig'\n\nexport default defineServerAuth({\n  socialProviders: {\n    github: { clientId: '...', clientSecret: '...' },\n  },\n  session: {\n    cookieCache: {\n      enabled: true,\n      maxAge: 7 * 24 * 60 * 60, \u002F\u002F 7 days\n      strategy: 'jwe',\n    },\n  },\n  account: {\n    storeStateStrategy: 'cookie',\n    storeAccountCookie: true,\n  },\n})\n","server\u002Fauth.config.ts",[259,425,426,446,452,463,474,505,511,521,531,546,579,592,598,603,613,626,638,643],{"__ignoreMap":362},[366,427,428,431,434,437,440,443],{"class":368,"line":369},[366,429,430],{"class":372},"import",[366,432,433],{"class":384}," { ",[366,435,436],{"class":391},"defineServerAuth",[366,438,439],{"class":384}," } ",[366,441,442],{"class":372},"from",[366,444,445],{"class":402}," '@nuxtjs\u002Fbetter-auth\u002Fconfig'\n",[366,447,448],{"class":368,"line":388},[366,449,451],{"emptyLinePlaceholder":450},true,"\n",[366,453,454,456,458,461],{"class":368,"line":409},[366,455,373],{"class":372},[366,457,377],{"class":376},[366,459,460],{"class":380}," defineServerAuth",[366,462,385],{"class":384},[366,464,466,469,471],{"class":368,"line":465},4,[366,467,468],{"class":391},"  socialProviders",[366,470,396],{"class":395},[366,472,473],{"class":384}," {\n",[366,475,477,480,482,484,487,489,492,495,498,500,502],{"class":368,"line":476},5,[366,478,479],{"class":391},"    github",[366,481,396],{"class":395},[366,483,433],{"class":384},[366,485,486],{"class":391},"clientId",[366,488,396],{"class":395},[366,490,491],{"class":402}," '...'",[366,493,494],{"class":384},", ",[366,496,497],{"class":391},"clientSecret",[366,499,396],{"class":395},[366,501,491],{"class":402},[366,503,504],{"class":384}," },\n",[366,506,508],{"class":368,"line":507},6,[366,509,510],{"class":384},"  },\n",[366,512,514,517,519],{"class":368,"line":513},7,[366,515,516],{"class":391},"  session",[366,518,396],{"class":395},[366,520,473],{"class":384},[366,522,524,527,529],{"class":368,"line":523},8,[366,525,526],{"class":391},"    cookieCache",[366,528,396],{"class":395},[366,530,473],{"class":384},[366,532,534,537,539,543],{"class":368,"line":533},9,[366,535,536],{"class":391},"      enabled",[366,538,396],{"class":395},[366,540,542],{"class":541},"s3ZNE"," true",[366,544,545],{"class":384},",\n",[366,547,549,552,554,557,561,564,566,569,571,573,575],{"class":368,"line":548},10,[366,550,551],{"class":391},"      maxAge",[366,553,396],{"class":395},[366,555,556],{"class":541}," 7",[366,558,560],{"class":559},"sn-Jc"," *",[366,562,563],{"class":541}," 24",[366,565,560],{"class":559},[366,567,568],{"class":541}," 60",[366,570,560],{"class":559},[366,572,568],{"class":541},[366,574,494],{"class":384},[366,576,578],{"class":577},"st7cf","\u002F\u002F 7 days\n",[366,580,582,585,587,590],{"class":368,"line":581},11,[366,583,584],{"class":391},"      strategy",[366,586,396],{"class":395},[366,588,589],{"class":402}," 'jwe'",[366,591,545],{"class":384},[366,593,595],{"class":368,"line":594},12,[366,596,597],{"class":384},"    },\n",[366,599,601],{"class":368,"line":600},13,[366,602,510],{"class":384},[366,604,606,609,611],{"class":368,"line":605},14,[366,607,608],{"class":391},"  account",[366,610,396],{"class":395},[366,612,473],{"class":384},[366,614,616,619,621,624],{"class":368,"line":615},15,[366,617,618],{"class":391},"    storeStateStrategy",[366,620,396],{"class":395},[366,622,623],{"class":402}," 'cookie'",[366,625,545],{"class":384},[366,627,629,632,634,636],{"class":368,"line":628},16,[366,630,631],{"class":391},"    storeAccountCookie",[366,633,396],{"class":395},[366,635,542],{"class":541},[366,637,545],{"class":384},[366,639,641],{"class":368,"line":640},17,[366,642,510],{"class":384},[366,644,646],{"class":368,"line":645},18,[366,647,412],{"class":384},[222,649,650],{},"This stores sessions and OAuth state in encrypted cookies instead of a database.",[276,652,654],{"id":653},"when-to-use-database-less-mode","When to Use Database-less Mode",[222,656,657],{},[235,658,659],{},"Good fit:",[252,661,662,665,668],{},[255,663,664],{},"OAuth-only authentication (GitHub, Google, etc.)",[255,666,667],{},"Serverless deployments with cold start concerns",[255,669,670],{},"Simple applications without session management needs",[222,672,673],{},[235,674,675],{},"Not recommended:",[252,677,678,681,684],{},[255,679,680],{},"Applications requiring session revocation",[255,682,683],{},"Multi-device session management",[255,685,686],{},"Email\u002Fpassword authentication",[688,689,690],"style",{},"html pre.shiki code .sqe1H, html code.shiki .sqe1H{--shiki-light:#A626A4;--shiki-default:#FEDE5D;--shiki-dark:#FEDE5D}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 .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 .sVnqq, html code.shiki .sVnqq{--shiki-light:#0184BC;--shiki-default:#B6B1B1;--shiki-dark:#B6B1B1}html pre.shiki code .sPAZv, html code.shiki .sPAZv{--shiki-light:#50A14F;--shiki-default:#FF8B39;--shiki-dark:#FF8B39}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 .s3ZNE, html code.shiki .s3ZNE{--shiki-light:#986801;--shiki-default:#F97E72;--shiki-dark:#F97E72}html pre.shiki code .sn-Jc, html code.shiki .sn-Jc{--shiki-light:#0184BC;--shiki-default:#FEDE5D;--shiki-dark:#FEDE5D}html pre.shiki code .st7cf, html code.shiki .st7cf{--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-default:#848BBD;--shiki-default-font-style:italic;--shiki-dark:#848BBD;--shiki-dark-font-style:italic}",{"title":362,"searchDepth":388,"depth":388,"links":692},[693,699,700,701],{"id":278,"depth":388,"text":279,"children":694},[695,696,697,698],{"id":283,"depth":409,"text":284},{"id":296,"depth":409,"text":297},{"id":315,"depth":409,"text":316},{"id":327,"depth":409,"text":328},{"id":350,"depth":388,"text":351},{"id":415,"depth":388,"text":416},{"id":653,"depth":388,"text":654},"Run Better Auth without a database for edge and serverless deployments.","md",null,{},{"title":91,"description":702},"m9tKHYvLMEDCF20Ic6O3PczPR92LcHa1DGbQDu3ITN8",[709,711],{"title":87,"path":88,"stem":89,"description":710,"children":-1},"Use your own database with Drizzle, Prisma, or Kysely adapters.",{"title":95,"path":96,"stem":97,"description":712,"icon":98,"children":-1},"Use nuxt-better-auth with a separate Better Auth server.",1792532579245]