[{"data":1,"prerenderedAt":530},["ShallowReactive",2],{"navigation":3,"\u002Fadmin\u002Faudit-log":178,"\u002Fadmin\u002Faudit-log-surround":525},[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":180,"body":181,"description":518,"extension":519,"links":520,"meta":521,"navigation":522,"path":115,"seo":523,"stem":116,"__hash__":524},"docs\u002F4.admin\u002F4.audit-log.md","Audit log and activity",{"type":182,"value":183,"toc":511},"minimark",[184,189,194,198,221,231,344,347,361,365,372,383,386,391,394,398,401,490,501,507],[185,186],"screenshot",{"alt":187,"name":188},"The audit log: each action, who did it, to whom, and when","admin-audit",[190,191,193],"h2",{"id":192},"the-audit-log","The audit log",[195,196,197],"p",{},"On by default. Every successful admin action is recorded, with:",[199,200,201,209,215],"ul",{},[202,203,204,208],"li",{},[205,206,207],"strong",{},"who did it, and to whom",", with names and emails as they were, so deleted users stay readable;",[202,210,211,214],{},[205,212,213],{},"details"," such as the ban reason;",[202,216,217,220],{},[205,218,219],{},"the IP and browser"," it came from.",[195,222,223,224,226,227,230],{},"It records creating, editing, banning and unbanning users, role and password changes, deletions, signing sessions\nout, impersonation, removing sign-in methods, and more. It has its own ",[205,225,114],{}," page, filterable by action, and\nan ",[205,228,229],{},"Activity"," card on each user's page.",[232,233,239],"pre",{"className":234,"code":235,"filename":236,"language":237,"meta":238,"style":238},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","export default defineNuxtConfig({\n  betterAuthUi: {\n    admin: {\n      auditLog: true,\n      \u002F\u002F Days entries are kept; 0 keeps them forever.\n      auditLogRetentionDays: 30\n    }\n  }\n})\n","nuxt.config.ts","ts","",[240,241,242,266,279,289,304,311,323,329,335],"code",{"__ignoreMap":238},[243,244,247,251,254,258,262],"span",{"class":245,"line":246},"line",1,[243,248,250],{"class":249},"s7zQu","export",[243,252,253],{"class":249}," default",[243,255,257],{"class":256},"s2Zo4"," defineNuxtConfig",[243,259,261],{"class":260},"sTEyZ","(",[243,263,265],{"class":264},"sMK4o","{\n",[243,267,269,273,276],{"class":245,"line":268},2,[243,270,272],{"class":271},"swJcz","  betterAuthUi",[243,274,275],{"class":264},":",[243,277,278],{"class":264}," {\n",[243,280,282,285,287],{"class":245,"line":281},3,[243,283,284],{"class":271},"    admin",[243,286,275],{"class":264},[243,288,278],{"class":264},[243,290,292,295,297,301],{"class":245,"line":291},4,[243,293,294],{"class":271},"      auditLog",[243,296,275],{"class":264},[243,298,300],{"class":299},"sfNiH"," true",[243,302,303],{"class":264},",\n",[243,305,307],{"class":245,"line":306},5,[243,308,310],{"class":309},"sHwdD","      \u002F\u002F Days entries are kept; 0 keeps them forever.\n",[243,312,314,317,319],{"class":245,"line":313},6,[243,315,316],{"class":271},"      auditLogRetentionDays",[243,318,275],{"class":264},[243,320,322],{"class":321},"sbssI"," 30\n",[243,324,326],{"class":245,"line":325},7,[243,327,328],{"class":264},"    }\n",[243,330,332],{"class":245,"line":331},8,[243,333,334],{"class":264},"  }\n",[243,336,338,341],{"class":245,"line":337},9,[243,339,340],{"class":264},"}",[243,342,343],{"class":260},")\n",[195,345,346],{},"Older entries are hidden, and deleted as new ones are written.",[348,349,350],"note",{},[195,351,352,353,356,357,360],{},"It's a small Better Auth plugin with its own table, ",[240,354,355],{},"adminAuditLog",": run Better Auth's migrations (or\n",[240,358,359],{},"npx @better-auth\u002Fcli generate"," for Prisma or Drizzle). Better Auth's own tables aren't changed. A failed write is\nlogged and never blocks the action.",[190,362,364],{"id":363},"users-own-activity","Users' own activity",[195,366,367,368,371],{},"Also on by default (",[240,369,370],{},"auditUserEvents","), the same log records:",[199,373,374,377,380],{},[202,375,376],{},"sign-ups and sign-ins, with their method (email, GitHub, a verification link, …);",[202,378,379],{},"failed sign-ins, for real accounts only (typed-in emails without one aren't stored);",[202,381,382],{},"sign-outs, password reset requests and changes, and email verification.",[195,384,385],{},"Every sign-in method counts. Events that look an account up by email are recorded after the response, so they can't\nreveal through timing whether the account exists. One write per event.",[387,388,390],"h3",{"id":389},"last-sign-in","Last sign-in",[195,392,393],{},"From those events, the users list and each user's page show when they last signed in. It needs no extra writes, so it\nonly knows sign-ins within the log's retention: older ones show as \"Not in the last 30 days\".",[190,395,397],{"id":396},"last-active-and-online-now","Last active and online now",[195,399,400],{},"Opt-in. A \"Last active\" column and detail on users, and an \"Online now\" card on the home page:",[232,402,404],{"className":234,"code":403,"filename":236,"language":237,"meta":238,"style":238},"export default defineNuxtConfig({\n  betterAuthUi: {\n    admin: {\n      activityTracking: { enabled: true, updateInterval: 5 * 60 * 1000 }\n    }\n  }\n})\n",[240,405,406,418,426,434,476,480,484],{"__ignoreMap":238},[243,407,408,410,412,414,416],{"class":245,"line":246},[243,409,250],{"class":249},[243,411,253],{"class":249},[243,413,257],{"class":256},[243,415,261],{"class":260},[243,417,265],{"class":264},[243,419,420,422,424],{"class":245,"line":268},[243,421,272],{"class":271},[243,423,275],{"class":264},[243,425,278],{"class":264},[243,427,428,430,432],{"class":245,"line":281},[243,429,284],{"class":271},[243,431,275],{"class":264},[243,433,278],{"class":264},[243,435,436,439,441,444,447,449,451,454,457,459,462,465,468,470,473],{"class":245,"line":291},[243,437,438],{"class":271},"      activityTracking",[243,440,275],{"class":264},[243,442,443],{"class":264}," {",[243,445,446],{"class":271}," enabled",[243,448,275],{"class":264},[243,450,300],{"class":299},[243,452,453],{"class":264},",",[243,455,456],{"class":271}," updateInterval",[243,458,275],{"class":264},[243,460,461],{"class":321}," 5",[243,463,464],{"class":264}," *",[243,466,467],{"class":321}," 60",[243,469,464],{"class":264},[243,471,472],{"class":321}," 1000",[243,474,475],{"class":264}," }\n",[243,477,478],{"class":245,"line":306},[243,479,328],{"class":264},[243,481,482],{"class":245,"line":313},[243,483,334],{"class":264},[243,485,486,488],{"class":245,"line":325},[243,487,340],{"class":264},[243,489,343],{"class":260},[195,491,492,493,496,497,500],{},"When Better Auth checks a signed-in user's session (their pages load), the module records the time in its own\n",[240,494,495],{},"adminUserActivity"," table: at most once per user per ",[240,498,499],{},"updateInterval"," (5 minutes by default) on each server, after\nthe response.",[502,503,504],"warning",{},[195,505,506],{},"That's about one write per signed-in user per interval. Fine for most databases, but it grows with your traffic,\nwhich is why it's off by default.",[508,509,510],"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 .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}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":238,"searchDepth":246,"depth":268,"links":512},[513,514,517],{"id":192,"depth":268,"text":193},{"id":363,"depth":268,"text":364,"children":515},[516],{"id":389,"depth":281,"text":390},{"id":396,"depth":268,"text":397},"Who did what and when, users' sign-ins, and who's online.","md",null,{},{"title":114,"icon":117},{"title":180,"description":518},"6OPBfWa_OVXHm69yLEfSRGHwDzTgOBkL1pUYTJ_vsZ8",[526,528],{"title":109,"path":110,"stem":111,"description":527,"icon":112,"children":-1},"Roles like moderator or support, with some of the admin's permissions.",{"title":119,"path":120,"stem":121,"description":529,"icon":122,"children":-1},"Add your app's pages to the admin dashboard, or replace the module's.",1793019842937]