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