[{"data":1,"prerenderedAt":570},["ShallowReactive",2],{"navigation_docs":3,"-getting-started-client-setup":152,"-getting-started-client-setup-surround":565},[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":23,"body":154,"description":558,"extension":559,"links":560,"meta":561,"navigation":562,"path":24,"seo":563,"stem":25,"__hash__":564},"docs/1.getting-started/3.client-setup.md",{"type":155,"value":156,"toc":551},"minimark",[157,233,238,250,256,355,363,367,374,457,461,466,542,547],[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","Set up the client auth config for @onmax/nuxt-better-auth.\n\n- Create `app/auth.config.ts` with a default export using `defineClientAuth` from `@onmax/nuxt-better-auth/config`\n- Object syntax: `defineClientAuth({})` or function syntax: `defineClientAuth(({ siteUrl }) => ({}))`\n- Add client plugin equivalents for every server plugin (e.g. `adminClient()` from `better-auth/client/plugins`)\n- The module calls the factory with the correct `baseURL` at runtime\n- `useUserSession()` is auto-imported and provides `user`, `session`, `loggedIn`, `ready`, `signIn`, `signUp`, `signOut`\n\nRead more: https://better-auth.nuxt.dev/raw/getting-started/client-setup.md\nSource: https://github.com/nuxt-modules/better-auth\n","Prompt","txt","",[169,170,171,179,186,192,198,204,210,216,221,227],"code",{"__ignoreMap":167},[172,173,176],"span",{"class":174,"line":175},"line",1,[172,177,178],{},"Set up the client auth config for @onmax/nuxt-better-auth.\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],{},"- Create `app/auth.config.ts` with a default export using `defineClientAuth` from `@onmax/nuxt-better-auth/config`\n",[172,193,195],{"class":174,"line":194},4,[172,196,197],{},"- Object syntax: `defineClientAuth({})` or function syntax: `defineClientAuth(({ siteUrl }) => ({}))`\n",[172,199,201],{"class":174,"line":200},5,[172,202,203],{},"- Add client plugin equivalents for every server plugin (e.g. `adminClient()` from `better-auth/client/plugins`)\n",[172,205,207],{"class":174,"line":206},6,[172,208,209],{},"- The module calls the factory with the correct `baseURL` at runtime\n",[172,211,213],{"class":174,"line":212},7,[172,214,215],{},"- `useUserSession()` is auto-imported and provides `user`, `session`, `loggedIn`, `ready`, `signIn`, `signUp`, `signOut`\n",[172,217,219],{"class":174,"line":218},8,[172,220,185],{"emptyLinePlaceholder":184},[172,222,224],{"class":174,"line":223},9,[172,225,226],{},"Read more: https://better-auth.nuxt.dev/raw/getting-started/client-setup.md\n",[172,228,230],{"class":174,"line":229},10,[172,231,232],{},"Source: https://github.com/nuxt-modules/better-auth\n",[234,235,237],"h2",{"id":236},"create-the-client-config","Create the Client Config",[239,240,241,242,245,246,249],"p",{},"Create ",[169,243,244],{},"app/auth.config.ts"," with a default export using ",[169,247,248],{},"defineClientAuth",".",[239,251,252,253,255],{},"The ",[169,254,248],{}," helper supports two syntaxes: an object for simple configurations, or a function when you need access to context like the resolved site URL.",[161,257,261],{"className":258,"code":259,"filename":244,"language":260,"meta":167,"style":167},"language-ts shiki shiki-themes one-light synthwave-84 synthwave-84","import { defineClientAuth } from '@onmax/nuxt-better-auth/config'\n\n// Object syntax (simplest)\nexport default defineClientAuth({})\n\n// Function syntax (access context)\nexport default defineClientAuth(({ siteUrl }) => ({\n  // siteUrl contains the resolved base URL\n}))\n","ts",[169,262,263,286,290,296,312,316,321,345,350],{"__ignoreMap":167},[172,264,265,269,273,276,279,282],{"class":174,"line":175},[172,266,268],{"class":267},"sqe1H","import",[172,270,272],{"class":271},"s17Py"," { ",[172,274,248],{"class":275},"sYvLG",[172,277,278],{"class":271}," } ",[172,280,281],{"class":267},"from",[172,283,285],{"class":284},"sPAZv"," '@onmax/nuxt-better-auth/config'\n",[172,287,288],{"class":174,"line":181},[172,289,185],{"emptyLinePlaceholder":184},[172,291,292],{"class":174,"line":188},[172,293,295],{"class":294},"st7cf","// Object syntax (simplest)\n",[172,297,298,301,305,309],{"class":174,"line":194},[172,299,300],{"class":267},"export",[172,302,304],{"class":303},"sKg8T"," default",[172,306,308],{"class":307},"sfT9l"," defineClientAuth",[172,310,311],{"class":271},"({})\n",[172,313,314],{"class":174,"line":200},[172,315,185],{"emptyLinePlaceholder":184},[172,317,318],{"class":174,"line":206},[172,319,320],{"class":294},"// Function syntax (access context)\n",[172,322,323,325,327,329,332,336,339,342],{"class":174,"line":212},[172,324,300],{"class":267},[172,326,304],{"class":303},[172,328,308],{"class":307},[172,330,331],{"class":271},"(({ ",[172,333,335],{"class":334},"sgisi","siteUrl",[172,337,338],{"class":271}," }) ",[172,340,341],{"class":267},"=>",[172,343,344],{"class":271}," ({\n",[172,346,347],{"class":174,"line":218},[172,348,349],{"class":294},"  // siteUrl contains the resolved base URL\n",[172,351,352],{"class":174,"line":223},[172,353,354],{"class":271},"}))\n",[356,357,358,359,362],"note",{},"The helper creates a factory function that the module calls with the correct ",[169,360,361],{},"baseURL"," at runtime.",[234,364,366],{"id":365},"using-plugins","Using Plugins",[239,368,369,370,373],{},"If you added a plugin in your server config (",[169,371,372],{},"server/auth.config.ts","), make sure to add its client equivalent here.",[161,375,377],{"className":258,"code":376,"filename":244,"language":260,"meta":167,"style":167},"import { defineClientAuth } from '@onmax/nuxt-better-auth/config'\nimport { adminClient } from 'better-auth/client/plugins'\n\nexport default defineClientAuth({\n  plugins: [\n    adminClient() // Must match the server plugin\n  ]\n})\n",[169,378,379,393,409,413,424,436,447,452],{"__ignoreMap":167},[172,380,381,383,385,387,389,391],{"class":174,"line":175},[172,382,268],{"class":267},[172,384,272],{"class":271},[172,386,248],{"class":275},[172,388,278],{"class":271},[172,390,281],{"class":267},[172,392,285],{"class":284},[172,394,395,397,399,402,404,406],{"class":174,"line":181},[172,396,268],{"class":267},[172,398,272],{"class":271},[172,400,401],{"class":275},"adminClient",[172,403,278],{"class":271},[172,405,281],{"class":267},[172,407,408],{"class":284}," 'better-auth/client/plugins'\n",[172,410,411],{"class":174,"line":188},[172,412,185],{"emptyLinePlaceholder":184},[172,414,415,417,419,421],{"class":174,"line":194},[172,416,300],{"class":267},[172,418,304],{"class":303},[172,420,308],{"class":307},[172,422,423],{"class":271},"({\n",[172,425,426,429,433],{"class":174,"line":200},[172,427,428],{"class":275},"  plugins",[172,430,432],{"class":431},"sVnqq",":",[172,434,435],{"class":271}," [\n",[172,437,438,441,444],{"class":174,"line":206},[172,439,440],{"class":307},"    adminClient",[172,442,443],{"class":271},"() ",[172,445,446],{"class":294},"// Must match the server plugin\n",[172,448,449],{"class":174,"line":212},[172,450,451],{"class":271},"  ]\n",[172,453,454],{"class":174,"line":218},[172,455,456],{"class":271},"})\n",[234,458,460],{"id":459},"common-plugin-combinations","Common Plugin Combinations",[462,463,465],"h3",{"id":464},"admin-two-factor","Admin + Two Factor",[161,467,469],{"className":258,"code":468,"filename":244,"language":260,"meta":167,"style":167},"import { defineClientAuth } from '@onmax/nuxt-better-auth/config'\nimport { adminClient, twoFactorClient } from 'better-auth/client/plugins'\n\nexport default defineClientAuth({\n  plugins: [adminClient(), twoFactorClient()]\n})\n",[169,470,471,485,505,509,519,538],{"__ignoreMap":167},[172,472,473,475,477,479,481,483],{"class":174,"line":175},[172,474,268],{"class":267},[172,476,272],{"class":271},[172,478,248],{"class":275},[172,480,278],{"class":271},[172,482,281],{"class":267},[172,484,285],{"class":284},[172,486,487,489,491,493,496,499,501,503],{"class":174,"line":181},[172,488,268],{"class":267},[172,490,272],{"class":271},[172,492,401],{"class":275},[172,494,495],{"class":271},", ",[172,497,498],{"class":275},"twoFactorClient",[172,500,278],{"class":271},[172,502,281],{"class":267},[172,504,408],{"class":284},[172,506,507],{"class":174,"line":188},[172,508,185],{"emptyLinePlaceholder":184},[172,510,511,513,515,517],{"class":174,"line":194},[172,512,300],{"class":267},[172,514,304],{"class":303},[172,516,308],{"class":307},[172,518,423],{"class":271},[172,520,521,523,525,528,530,533,535],{"class":174,"line":200},[172,522,428],{"class":275},[172,524,432],{"class":431},[172,526,527],{"class":271}," [",[172,529,401],{"class":307},[172,531,532],{"class":271},"(), ",[172,534,498],{"class":307},[172,536,537],{"class":271},"()]\n",[172,539,540],{"class":174,"line":206},[172,541,456],{"class":271},[543,544],"read-more",{"title":545,"to":546},"All Better Auth plugins","https://www.better-auth.com/docs/plugins",[548,549,550],"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 .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 .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}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 .sgisi, html code.shiki .sgisi{--shiki-light:#383A42;--shiki-light-font-style:inherit;--shiki-default:#FF7EDB;--shiki-default-font-style:italic;--shiki-dark:#FF7EDB;--shiki-dark-font-style:italic}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":552},[553,554,555],{"id":236,"depth":181,"text":237},{"id":365,"depth":181,"text":366},{"id":459,"depth":181,"text":460,"children":556},[557],{"id":464,"depth":188,"text":465},"Configure the client-side authentication client.","md",null,{},{"icon":26},{"title":23,"description":558},"OebyRk-JoKv8c31q6gYZPK4kGnMNmQ6Hrh6yuwywv_o",[566,568],{"title":18,"path":19,"stem":20,"description":567,"icon":21,"children":-1},"Configure the module options and your Better Auth server instance.",{"title":28,"path":29,"stem":30,"description":569,"icon":31,"children":-1},"Learn how the module automatically infers types from your configuration.",1774627854156]