[{"data":1,"prerenderedAt":639},["ShallowReactive",2],{"navigation":3,"\u002Freference\u002Fhow-it-works":178,"\u002Freference\u002Fhow-it-works-surround":634},[4,23,78,95,123,143,158],{"title":5,"path":6,"stem":7,"children":8,"icon":22},"Getting Started","\u002Fgetting-started","1.getting-started\u002F1.index",[9,12,17],{"title":10,"path":6,"stem":7,"icon":11},"Introduction","i-lucide-house",{"title":13,"path":14,"stem":15,"icon":16},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F2.installation","i-lucide-download",{"title":18,"path":19,"stem":20,"icon":21},"Configuration","\u002Fgetting-started\u002Fconfiguration","1.getting-started\u002F3.configuration","i-lucide-settings",false,{"title":24,"icon":22,"path":25,"stem":26,"children":27,"page":22},"Sign-in","\u002Fsign-in","2.sign-in",[28,33,38,43,48,53,58,63,68,73],{"title":29,"path":30,"stem":31,"icon":32},"Sign-in pages","\u002Fsign-in\u002Fpages","2.sign-in\u002F1.pages","i-lucide-log-in",{"title":34,"path":35,"stem":36,"icon":37},"Several accounts","\u002Fsign-in\u002Fmulti-session","2.sign-in\u002F10.multi-session","i-lucide-users-round",{"title":39,"path":40,"stem":41,"icon":42},"Account page","\u002Fsign-in\u002Faccount","2.sign-in\u002F2.account","i-lucide-circle-user",{"title":44,"path":45,"stem":46,"icon":47},"Other methods","\u002Fsign-in\u002Fmethods","2.sign-in\u002F3.methods","i-lucide-key-square",{"title":49,"path":50,"stem":51,"icon":52},"Sign-in providers","\u002Fsign-in\u002Fproviders","2.sign-in\u002F4.providers","i-lucide-share-2",{"title":54,"path":55,"stem":56,"icon":57},"Two-factor","\u002Fsign-in\u002Ftwo-factor","2.sign-in\u002F5.two-factor","i-lucide-shield-check",{"title":59,"path":60,"stem":61,"icon":62},"Passkeys","\u002Fsign-in\u002Fpasskeys","2.sign-in\u002F6.passkeys","i-lucide-fingerprint",{"title":64,"path":65,"stem":66,"icon":67},"Phone numbers","\u002Fsign-in\u002Fphone-numbers","2.sign-in\u002F7.phone-numbers","i-lucide-smartphone",{"title":69,"path":70,"stem":71,"icon":72},"Signing in devices","\u002Fsign-in\u002Fdevices","2.sign-in\u002F8.devices","i-lucide-tv",{"title":74,"path":75,"stem":76,"icon":77},"Security","\u002Fsign-in\u002Fsecurity","2.sign-in\u002F9.security","i-lucide-lock-keyhole",{"title":79,"path":80,"stem":81,"children":82,"icon":22},"Organizations","\u002Forganizations","3.organizations\u002F1.index",[83,85,90],{"title":79,"path":80,"stem":81,"icon":84},"i-lucide-building-2",{"title":86,"path":87,"stem":88,"icon":89},"Roles","\u002Forganizations\u002Froles","3.organizations\u002F2.roles","i-lucide-shield",{"title":91,"path":92,"stem":93,"icon":94},"Single sign-on","\u002Forganizations\u002Fsso","3.organizations\u002F3.sso","i-lucide-key-round",{"title":96,"path":97,"stem":98,"children":99,"icon":22},"Admin dashboard","\u002Fadmin","4.admin\u002F1.index",[100,103,108,113,118],{"title":101,"path":97,"stem":98,"icon":102},"Overview","i-lucide-layout-dashboard",{"title":104,"path":105,"stem":106,"icon":107},"Managing users","\u002Fadmin\u002Fusers","4.admin\u002F2.users","i-lucide-user-cog",{"title":109,"path":110,"stem":111,"icon":112},"Staff roles","\u002Fadmin\u002Froles","4.admin\u002F3.roles","i-lucide-shield-user",{"title":114,"path":115,"stem":116,"icon":117},"Audit log","\u002Fadmin\u002Faudit-log","4.admin\u002F4.audit-log","i-lucide-history",{"title":119,"path":120,"stem":121,"icon":122},"Your own pages","\u002Fadmin\u002Fextending","4.admin\u002F5.extending","i-lucide-layout-panel-left",{"title":124,"icon":22,"path":125,"stem":126,"children":127,"page":22},"Integrations","\u002Fintegrations","5.integrations",[128,133,138],{"title":129,"path":130,"stem":131,"icon":132},"Stripe","\u002Fintegrations\u002Fstripe","5.integrations\u002F1.stripe","i-simple-icons-stripe",{"title":134,"path":135,"stem":136,"icon":137},"API keys","\u002Fintegrations\u002Fapi-keys","5.integrations\u002F2.api-keys","i-lucide-key",{"title":139,"path":140,"stem":141,"icon":142},"Tokens","\u002Fintegrations\u002Ftokens","5.integrations\u002F3.tokens","i-lucide-ticket",{"title":144,"icon":22,"path":145,"stem":146,"children":147,"page":22},"Customization","\u002Fcustomization","6.customization",[148,153],{"title":149,"path":150,"stem":151,"icon":152},"Emails","\u002Fcustomization\u002Femails","6.customization\u002F1.emails","i-lucide-mail",{"title":154,"path":155,"stem":156,"icon":157},"Languages","\u002Fcustomization\u002Flanguages","6.customization\u002F2.languages","i-lucide-languages",{"title":159,"icon":22,"path":160,"stem":161,"children":162,"page":22},"Reference","\u002Freference","7.reference",[163,168,173],{"title":164,"path":165,"stem":166,"icon":167},"How it works","\u002Freference\u002Fhow-it-works","7.reference\u002F1.how-it-works","i-lucide-cog",{"title":169,"path":170,"stem":171,"icon":172},"API reference","\u002Freference\u002Fapi","7.reference\u002F2.api","i-lucide-braces",{"title":174,"path":175,"stem":176,"icon":177},"Contributing","\u002Freference\u002Fcontributing","7.reference\u002F3.contributing","i-lucide-git-pull-request",{"id":179,"title":164,"body":180,"description":627,"extension":628,"links":629,"meta":630,"navigation":631,"path":165,"seo":632,"stem":166,"__hash__":633},"docs\u002F7.reference\u002F1.how-it-works.md",{"type":181,"value":182,"toc":617},"minimark",[183,188,201,204,208,215,219,226,230,271,292,296,380,384,391,500,504,531,535,607,613],[184,185,187],"h2",{"id":186},"better-auths-plugins-added-for-you","Better Auth's plugins, added for you",[189,190,191,192,196,197,200],"p",{},"The module registers Better Auth's plugins (the Admin plugin, and those of the features you turn on) through\n",[193,194,195],"code",{},"@nuxtjs\u002Fbetter-auth","'s ",[193,198,199],{},"better-auth:plugins:extend"," hook, on both the server and the client. Your auth config doesn't\nchange.",[189,202,203],{},"The pages then read your Better Auth set-up at runtime, from a public route that says which features are on (never\nanything about users). That's how they show only what your set-up supports, and pick up plugins your own config adds.",[184,205,207],{"id":206},"better-auth-does-the-checking","Better Auth does the checking",[189,209,210,211,214],{},"Everything goes through Better Auth's own endpoints where it has them. Where it doesn't (listing every user's sessions,\nan admin turning off someone's two-factor), the module adds its own routes under ",[193,212,213],{},"\u002Fapi\u002F_better-auth-ui",", and each\nchecks the same Better Auth permission the matching action needs. Its own tables (the audit log, activity, staff\nnotes) are added through Better Auth's migrations; Better Auth's own tables are never changed.",[184,216,218],{"id":217},"admin-access","Admin access",[189,220,221,222,225],{},"Route rules let only signed-in staff into the admin pages: the admin role, and roles that can list users. Others are\nsent to the sign-in page or get a 403. Better Auth checks permissions again on every ",[193,223,224],{},"\u002Fapi\u002Fauth\u002Fadmin\u002F*"," request.",[184,227,229],{"id":228},"the-pages","The pages",[231,232,233,241,251,265],"ul",{},[234,235,236,240],"li",{},[237,238,239],"strong",{},"Sign-in and account pages"," use your app's own layout.",[234,242,243,246,247,250],{},[237,244,245],{},"The admin dashboard"," uses its own ",[193,248,249],{},"better-auth-ui"," layout, the dashboard template's sidebar layout, separate from\nyour layouts.",[234,252,253,256,257,260,261,264],{},[237,254,255],{},"Components"," are registered with prefixes (",[193,258,259],{},"\u003CAuthOrganizationSwitcher>"," for your app, ",[193,262,263],{},"\u003CBetterAuthUiUserMenu>","\nfor the module's own pages), so they can't clash with yours.",[234,266,267,270],{},[237,268,269],{},"Server-rendered:"," pages fetch their data on the server and hand it to the browser, so there's no loading flash\nand no hydration mismatch.",[189,272,273,274,283,284,287,288,291],{},"The module also installs ",[275,276,280],"a",{"href":277,"rel":278},"https:\u002F\u002Fvueuse.org\u002Fguide\u002F#nuxt",[279],"nofollow",[193,281,282],{},"@vueuse\u002Fnuxt",", which the dashboard's pages use. The\ndashboard template's ",[193,285,286],{},"app.vue",", ",[193,289,290],{},"error.vue",", colours and CSS theme are left out: they belong to your app.",[184,293,295],{"id":294},"composables-and-components","Composables and components",[297,298,299,312],"table",{},[300,301,302],"thead",{},[303,304,305,309],"tr",{},[306,307,308],"th",{},"Name",[306,310,311],{},"What it is",[313,314,315,330,343,355,368],"tbody",{},[303,316,317,323],{},[318,319,320],"td",{},[193,321,322],{},"\u003CAdminImpersonationBanner \u002F>",[318,324,325,326],{},"\"You're signed in as …\", with Stop impersonating. See ",[275,327,329],{"href":328},"\u002Fadmin\u002Fusers#signing-in-as-a-user","Signing in as a user",[303,331,332,337],{},[318,333,334],{},[193,335,336],{},"\u003CAuthOrganizationSwitcher \u002F>",[318,338,339,340],{},"Switch organization and team. See ",[275,341,79],{"href":342},"\u002Forganizations#in-your-app",[303,344,345,350],{},[318,346,347],{},[193,348,349],{},"useAuthActiveOrganization()",[318,351,352,353],{},"The active organization, server-rendered. See ",[275,354,79],{"href":342},[303,356,357,362],{},[318,358,359],{},[193,360,361],{},"\u003CAuthAccountSwitcher \u002F>",[318,363,364,365],{},"Switch between the accounts signed in here. See ",[275,366,34],{"href":367},"\u002Fsign-in\u002Fmulti-session#in-your-app",[303,369,370,375],{},[318,371,372],{},[193,373,374],{},"useAuthDeviceAccounts()",[318,376,377,378],{},"The accounts signed in here, and switching. See ",[275,379,34],{"href":367},[184,381,383],{"id":382},"serverless-hosts","Serverless hosts",[189,385,386,387,390],{},"Emails, texts and some audit log entries are sent or written after the response, through Better Auth's background\ntasks. On serverless hosts, which can stop a function once it has responded, give Better Auth the host's ",[193,388,389],{},"waitUntil",":",[392,393,399],"pre",{"className":394,"code":395,"filename":396,"language":397,"meta":398,"style":398},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { waitUntil } from '@vercel\u002Ffunctions'\n\nexport default defineServerAuth({\n  advanced: { backgroundTasks: { handler: waitUntil } }\n})\n","server\u002Fauth.config.ts","ts","",[193,400,401,434,441,460,492],{"__ignoreMap":398},[402,403,406,410,414,418,421,424,427,431],"span",{"class":404,"line":405},"line",1,[402,407,409],{"class":408},"s7zQu","import",[402,411,413],{"class":412},"sMK4o"," {",[402,415,417],{"class":416},"sTEyZ"," waitUntil",[402,419,420],{"class":412}," }",[402,422,423],{"class":408}," from",[402,425,426],{"class":412}," '",[402,428,430],{"class":429},"sfazB","@vercel\u002Ffunctions",[402,432,433],{"class":412},"'\n",[402,435,437],{"class":404,"line":436},2,[402,438,440],{"emptyLinePlaceholder":439},true,"\n",[402,442,444,447,450,454,457],{"class":404,"line":443},3,[402,445,446],{"class":408},"export",[402,448,449],{"class":408}," default",[402,451,453],{"class":452},"s2Zo4"," defineServerAuth",[402,455,456],{"class":416},"(",[402,458,459],{"class":412},"{\n",[402,461,463,467,469,471,474,476,478,481,483,486,489],{"class":404,"line":462},4,[402,464,466],{"class":465},"swJcz","  advanced",[402,468,390],{"class":412},[402,470,413],{"class":412},[402,472,473],{"class":465}," backgroundTasks",[402,475,390],{"class":412},[402,477,413],{"class":412},[402,479,480],{"class":465}," handler",[402,482,390],{"class":412},[402,484,485],{"class":416}," waitUntil ",[402,487,488],{"class":412},"}",[402,490,491],{"class":412}," }\n",[402,493,495,497],{"class":404,"line":494},5,[402,496,488],{"class":412},[402,498,499],{"class":416},")\n",[184,501,503],{"id":502},"for-ai-agents","For AI agents",[189,505,506,507,512,513,516,517,520,521,526,527,530],{},"The package ships an ",[275,508,511],{"href":509,"rel":510},"https:\u002F\u002Fagentskills.io",[279],"agent skill"," in ",[193,514,515],{},"skills\u002Fnuxt-better-auth-ui",", declared in its\n",[193,518,519],{},"package.json",". With ",[275,522,525],{"href":523,"rel":524},"https:\u002F\u002Fgithub.com\u002Fonmax\u002Fnuxt-skill-hub",[279],"Nuxt Skill Hub"," in your app, ",[193,528,529],{},"nuxt prepare"," installs\nit for your agent, matching the version you have installed.",[184,532,534],{"id":533},"package-entries","Package entries",[297,536,537,547],{},[300,538,539],{},[303,540,541,544],{},[306,542,543],{},"Import",[306,545,546],{},"What's in it",[313,548,549,559,577,589],{},[303,550,551,556],{},[318,552,553],{},[193,554,555],{},"@treygrr\u002Fnuxt-better-auth-ui",[318,557,558],{},"The module",[303,560,561,566],{},[318,562,563],{},[193,564,565],{},"@treygrr\u002Fnuxt-better-auth-ui\u002Femails",[318,567,568,287,571,287,574],{},[193,569,570],{},"betterAuthEmails",[193,572,573],{},"defineBetterAuthEmail",[193,575,576],{},"defineBetterAuthEmailSender",[303,578,579,584],{},[318,580,581],{},[193,582,583],{},"@treygrr\u002Fnuxt-better-auth-ui\u002Fsms",[318,585,586],{},[193,587,588],{},"defineBetterAuthSmsSender",[303,590,591,596],{},[318,592,593],{},[193,594,595],{},"@treygrr\u002Fnuxt-better-auth-ui\u002Fproviders",[318,597,598,287,601,287,604],{},[193,599,600],{},"epicGames",[193,602,603],{},"battleNet",[193,605,606],{},"placeholderEmail",[189,608,609,610,612],{},"Everything in them, and the composables, components and server utilities: ",[275,611,169],{"href":170},".",[614,615,616],"style",{},"html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}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);}",{"title":398,"searchDepth":405,"depth":436,"links":618},[619,620,621,622,623,624,625,626],{"id":186,"depth":436,"text":187},{"id":206,"depth":436,"text":207},{"id":217,"depth":436,"text":218},{"id":228,"depth":436,"text":229},{"id":294,"depth":436,"text":295},{"id":382,"depth":436,"text":383},{"id":502,"depth":436,"text":503},{"id":533,"depth":436,"text":534},"How the module fits into Better Auth and your Nuxt app.","md",null,{},{"icon":167},{"title":164,"description":627},"R_Na7_BLN18zmdSuYc6_CtRCpLXDbu7SNaWQSw1RfHI",[635,637],{"title":154,"path":155,"stem":156,"description":636,"icon":157,"children":-1},"English and Spanish built in, any word renamed, and your own languages.",{"title":169,"path":170,"stem":171,"description":638,"icon":172,"children":-1},"Every composable, component, utility and hook the module gives your app.",1793019845217]