[{"data":1,"prerenderedAt":1351},["ShallowReactive",2],{"navigation":3,"\u002Forganizations":178,"\u002Forganizations-surround":1346},[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":79,"body":180,"description":1339,"extension":1340,"links":1341,"meta":1342,"navigation":1343,"path":80,"seo":1344,"stem":81,"__hash__":1345},"docs\u002F3.organizations\u002F1.index.md",{"type":181,"value":182,"toc":1326},"minimark",[183,188,200,205,339,343,347,350,354,360,469,473,480,484,487,608,611,864,868,881,888,944,956,960,1119,1123,1139,1307,1310,1322],[184,185],"screenshot",{"alt":186,"name":187},"An organization's page: its members with their roles, and tabs for invitations, teams, roles and SSO","organization",[189,190,191,192,199],"p",{},"Better Auth's ",[193,194,198],"a",{"href":195,"rel":196},"https:\u002F\u002Fbetter-auth.com\u002Fdocs\u002Fplugins\u002Forganization",[197],"nofollow","Organization plugin",", as it is, for whatever your\napp uses organizations for: teams, workspaces, companies.",[201,202,204],"h2",{"id":203},"turning-it-on","Turning it on",[206,207,209,214,300,304,322,326],"steps",{"level":208},"3",[210,211,213],"h3",{"id":212},"enable-it","Enable it",[215,216,222],"pre",{"className":217,"code":218,"filename":219,"language":220,"meta":221,"style":221},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","export default defineNuxtConfig({\n  betterAuthUi: {\n    organization: { enabled: true }\n  }\n})\n","nuxt.config.ts","ts","",[223,224,225,249,262,285,291],"code",{"__ignoreMap":221},[226,227,230,234,237,241,245],"span",{"class":228,"line":229},"line",1,[226,231,233],{"class":232},"s7zQu","export",[226,235,236],{"class":232}," default",[226,238,240],{"class":239},"s2Zo4"," defineNuxtConfig",[226,242,244],{"class":243},"sTEyZ","(",[226,246,248],{"class":247},"sMK4o","{\n",[226,250,252,256,259],{"class":228,"line":251},2,[226,253,255],{"class":254},"swJcz","  betterAuthUi",[226,257,258],{"class":247},":",[226,260,261],{"class":247}," {\n",[226,263,265,268,270,273,276,278,282],{"class":228,"line":264},3,[226,266,267],{"class":254},"    organization",[226,269,258],{"class":247},[226,271,272],{"class":247}," {",[226,274,275],{"class":254}," enabled",[226,277,258],{"class":247},[226,279,281],{"class":280},"sfNiH"," true",[226,283,284],{"class":247}," }\n",[226,286,288],{"class":228,"line":287},4,[226,289,290],{"class":247},"  }\n",[226,292,294,297],{"class":228,"line":293},5,[226,295,296],{"class":247},"}",[226,298,299],{"class":243},")\n",[210,301,303],{"id":302},"run-better-auths-migrations","Run Better Auth's migrations",[189,305,306,307,309,310,313,314,317,318,321],{},"The plugin adds ",[223,308,187],{},", ",[223,311,312],{},"member"," and ",[223,315,316],{},"invitation"," tables, and the session's ",[223,319,320],{},"activeOrganizationId",". Teams and\ndynamic roles add their own tables too.",[210,323,325],{"id":324},"send-invitations-by-email-optional","Send invitations by email (optional)",[189,327,328,329,334,335,338],{},"Invitations are emailed when ",[193,330,331],{"href":150},[223,332,333],{},"emails.send"," is set, with the ",[223,336,337],{},"organization-invitation","\ntemplate. Their links can be copied either way.",[201,340,342],{"id":341},"what-people-get","What people get",[210,344,346],{"id":345},"on-the-account-page","On the account page",[189,348,349],{},"An \"Organizations\" tab with their organizations (and their teams in each), the active one marked, switching to\nanother, and creating one: a name, a slug made from it and checked as they type, and your own fields. Invitations sent\nto them show at the top, with Accept and Decline. Better Auth lists them only for a verified email.",[210,351,353],{"id":352},"the-organizations-page","The organization's page",[189,355,356,359],{},[223,357,358],{},"\u002Forganization\u002F\u003Cid>",", for signed-in members. Each part shows to those whose role allows it, from Better Auth's own\npermission check, so your roles and dynamic roles count:",[361,362,363,379],"table",{},[364,365,366],"thead",{},[367,368,369,373,376],"tr",{},[370,371,372],"th",{},"Tab",[370,374,375],{},"What it does",[370,377,378],{},"Permissions",[380,381,382,399,415,431,444,456],"tbody",{},[367,383,384,388,391],{},[385,386,387],"td",{},"General",[385,389,390],{},"Name, slug, logo and your fields; leaving; deleting",[385,392,393,309,396],{},[223,394,395],{},"organization:update",[223,397,398],{},"organization:delete",[367,400,401,404,407],{},[385,402,403],{},"Members",[385,405,406],{},"A page at a time, with your member fields; changing roles (several each); removing",[385,408,409,309,412],{},[223,410,411],{},"member:update",[223,413,414],{},"member:delete",[367,416,417,420,423],{},[385,418,419],{},"Invitations",[385,421,422],{},"Invite by email with roles, a team and your fields; send again, copy the link, cancel",[385,424,425,309,428],{},[223,426,427],{},"invitation:create",[223,429,430],{},"invitation:cancel",[367,432,433,436,439],{},[385,434,435],{},"Teams",[385,437,438],{},"Create, rename and remove teams; add and remove members; set your active team",[385,440,441],{},[223,442,443],{},"team:*",[367,445,446,448,451],{},[385,447,86],{},[385,449,450],{},"The app's roles and what each allows; the organization's own roles",[385,452,453],{},[223,454,455],{},"ac:*",[367,457,458,461,464],{},[385,459,460],{},"SSO",[385,462,463],{},"The organization's identity providers, for owners and admins",[385,465,466,467],{},"See ",[193,468,91],{"href":92},[210,470,472],{"id":471},"the-invitation-page","The invitation page",[189,474,475,476,479],{},"The email's link (",[223,477,478],{},"\u002Faccept-invitation\u002F\u003Cid>",", signed in) shows who invited them, to which organization and as what,\nthen Accept or Decline.",[201,481,483],{"id":482},"in-your-app","In your app",[189,485,486],{},"The module gives you a composable and a component for your own layout:",[488,489,490,535],"code-group",{},[215,491,496],{"className":492,"code":493,"filename":494,"language":495,"meta":221,"style":221},"language-vue shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u003Ctemplate>\n  \u003C!-- Switch organization and team, open its page, create one. -->\n  \u003CAuthOrganizationSwitcher \u002F>\n\u003C\u002Ftemplate>\n","Switcher","vue",[223,497,498,509,515,526],{"__ignoreMap":221},[226,499,500,503,506],{"class":228,"line":229},[226,501,502],{"class":247},"\u003C",[226,504,505],{"class":254},"template",[226,507,508],{"class":247},">\n",[226,510,511],{"class":228,"line":251},[226,512,514],{"class":513},"sHwdD","  \u003C!-- Switch organization and team, open its page, create one. -->\n",[226,516,517,520,523],{"class":228,"line":264},[226,518,519],{"class":247},"  \u003C",[226,521,522],{"class":254},"AuthOrganizationSwitcher",[226,524,525],{"class":247}," \u002F>\n",[226,527,528,531,533],{"class":228,"line":287},[226,529,530],{"class":247},"\u003C\u002F",[226,532,505],{"class":254},[226,534,508],{"class":247},[215,536,539],{"className":492,"code":537,"filename":538,"language":495,"meta":221,"style":221},"\u003Cscript setup lang=\"ts\">\n\u002F\u002F The active organization, with its members, server-rendered and following the session.\nconst { organization, activeTeamId } = useAuthActiveOrganization()\n\u003C\u002Fscript>\n","Composable",[223,540,541,568,573,600],{"__ignoreMap":221},[226,542,543,545,548,552,555,558,561,564,566],{"class":228,"line":229},[226,544,502],{"class":247},[226,546,547],{"class":254},"script",[226,549,551],{"class":550},"spNyl"," setup",[226,553,554],{"class":550}," lang",[226,556,557],{"class":247},"=",[226,559,560],{"class":247},"\"",[226,562,220],{"class":563},"sfazB",[226,565,560],{"class":247},[226,567,508],{"class":247},[226,569,570],{"class":228,"line":251},[226,571,572],{"class":513},"\u002F\u002F The active organization, with its members, server-rendered and following the session.\n",[226,574,575,578,580,583,586,589,591,594,597],{"class":228,"line":264},[226,576,577],{"class":550},"const",[226,579,272],{"class":247},[226,581,582],{"class":243}," organization",[226,584,585],{"class":247},",",[226,587,588],{"class":243}," activeTeamId ",[226,590,296],{"class":247},[226,592,593],{"class":247}," =",[226,595,596],{"class":239}," useAuthActiveOrganization",[226,598,599],{"class":243},"()\n",[226,601,602,604,606],{"class":228,"line":287},[226,603,530],{"class":247},[226,605,547],{"class":254},[226,607,508],{"class":247},[189,609,610],{},"Check permissions on your server with Better Auth's own API:",[215,612,615],{"className":217,"code":613,"filename":614,"language":220,"meta":221,"style":221},"export default defineEventHandler(async (event) => {\n  const auth = serverAuth(event)\n  const { success } = await auth.api.hasPermission({\n    headers: event.headers,\n    body: { permissions: { project: ['create'] } }\n  })\n  if (!success) throw createError({ statusCode: 403 })\n  \u002F\u002F The member's role in the active organization, if you need it:\n  const { role } = await auth.api.getActiveMemberRole({ headers: event.headers })\n})\n","server\u002Fapi\u002Fprojects.post.ts",[223,616,617,646,665,699,717,756,764,805,811,857],{"__ignoreMap":221},[226,618,619,621,623,626,628,631,634,638,641,644],{"class":228,"line":229},[226,620,233],{"class":232},[226,622,236],{"class":232},[226,624,625],{"class":239}," defineEventHandler",[226,627,244],{"class":243},[226,629,630],{"class":550},"async",[226,632,633],{"class":247}," (",[226,635,637],{"class":636},"sHdIc","event",[226,639,640],{"class":247},")",[226,642,643],{"class":550}," =>",[226,645,261],{"class":247},[226,647,648,651,654,656,659,661,663],{"class":228,"line":251},[226,649,650],{"class":550},"  const",[226,652,653],{"class":243}," auth",[226,655,593],{"class":247},[226,657,658],{"class":239}," serverAuth",[226,660,244],{"class":254},[226,662,637],{"class":243},[226,664,299],{"class":254},[226,666,667,669,671,674,677,679,682,684,687,690,692,695,697],{"class":228,"line":264},[226,668,650],{"class":550},[226,670,272],{"class":247},[226,672,673],{"class":243}," success",[226,675,676],{"class":247}," }",[226,678,593],{"class":247},[226,680,681],{"class":232}," await",[226,683,653],{"class":243},[226,685,686],{"class":247},".",[226,688,689],{"class":243},"api",[226,691,686],{"class":247},[226,693,694],{"class":239},"hasPermission",[226,696,244],{"class":254},[226,698,248],{"class":247},[226,700,701,704,706,709,711,714],{"class":228,"line":287},[226,702,703],{"class":254},"    headers",[226,705,258],{"class":247},[226,707,708],{"class":243}," event",[226,710,686],{"class":247},[226,712,713],{"class":243},"headers",[226,715,716],{"class":247},",\n",[226,718,719,722,724,726,729,731,733,736,738,741,744,747,749,752,754],{"class":228,"line":293},[226,720,721],{"class":254},"    body",[226,723,258],{"class":247},[226,725,272],{"class":247},[226,727,728],{"class":254}," permissions",[226,730,258],{"class":247},[226,732,272],{"class":247},[226,734,735],{"class":254}," project",[226,737,258],{"class":247},[226,739,740],{"class":254}," [",[226,742,743],{"class":247},"'",[226,745,746],{"class":563},"create",[226,748,743],{"class":247},[226,750,751],{"class":254},"] ",[226,753,296],{"class":247},[226,755,284],{"class":247},[226,757,759,762],{"class":228,"line":758},6,[226,760,761],{"class":247},"  }",[226,763,299],{"class":254},[226,765,767,770,772,775,778,781,784,787,789,792,795,797,801,803],{"class":228,"line":766},7,[226,768,769],{"class":232},"  if",[226,771,633],{"class":254},[226,773,774],{"class":247},"!",[226,776,777],{"class":243},"success",[226,779,780],{"class":254},") ",[226,782,783],{"class":232},"throw",[226,785,786],{"class":239}," createError",[226,788,244],{"class":254},[226,790,791],{"class":247},"{",[226,793,794],{"class":254}," statusCode",[226,796,258],{"class":247},[226,798,800],{"class":799},"sbssI"," 403",[226,802,676],{"class":247},[226,804,299],{"class":254},[226,806,808],{"class":228,"line":807},8,[226,809,810],{"class":513},"  \u002F\u002F The member's role in the active organization, if you need it:\n",[226,812,814,816,818,821,823,825,827,829,831,833,835,838,840,842,845,847,849,851,853,855],{"class":228,"line":813},9,[226,815,650],{"class":550},[226,817,272],{"class":247},[226,819,820],{"class":243}," role",[226,822,676],{"class":247},[226,824,593],{"class":247},[226,826,681],{"class":232},[226,828,653],{"class":243},[226,830,686],{"class":247},[226,832,689],{"class":243},[226,834,686],{"class":247},[226,836,837],{"class":239},"getActiveMemberRole",[226,839,244],{"class":254},[226,841,791],{"class":247},[226,843,844],{"class":254}," headers",[226,846,258],{"class":247},[226,848,708],{"class":243},[226,850,686],{"class":247},[226,852,713],{"class":243},[226,854,676],{"class":247},[226,856,299],{"class":254},[226,858,860,862],{"class":228,"line":859},10,[226,861,296],{"class":247},[226,863,299],{"class":243},[201,865,867],{"id":866},"in-the-admin","In the admin",[869,870,871,875,878],"ul",{},[872,873,874],"li",{},"An \"Organizations\" page lists every organization, with a search by name and member counts.",[872,876,877],{},"Each organization's page shows its members (linking to their user pages), pending invitations, teams and own roles.",[872,879,880],{},"A user's page lists their organizations.",[189,882,883,884,887],{},"Staff who can update users (",[223,885,886],{},"user: update",") change organizations through the calls Better Auth allows from the server,\nwithout a member's session. Its hooks and limits apply, and each change is recorded in the audit log:",[361,889,890,900],{},[364,891,892],{},[367,893,894,897],{},[370,895,896],{},"Staff can",[370,898,899],{},"Through Better Auth's",[380,901,902,916,929],{},[367,903,904,911],{},[385,905,906,910],{},[907,908,909],"strong",{},"Create an organization"," for a user, who becomes its owner",[385,912,913],{},[223,914,915],{},"createOrganization",[367,917,918,924],{},[385,919,920,923],{},[907,921,922],{},"Add a member",", with roles and a team",[385,925,926],{},[223,927,928],{},"addMember",[367,930,931,936],{},[385,932,933],{},[907,934,935],{},"Create and remove teams",[385,937,938,309,941],{},[223,939,940],{},"createTeam",[223,942,943],{},"removeTeam",[189,945,946,947,951,952,955],{},"Better Auth needs one of the organization's members for everything else: renaming or deleting it, changing members'\nroles or removing them, invitations, and its own roles. With\n",[193,948,950],{"href":949},"\u002Fadmin\u002Fusers#signing-in-as-a-user","impersonation"," on, the organization's admin page offers ",[907,953,954],{},"Sign in as"," its owner,\nwhich opens the organization's own page as them. The impersonation is recorded in the audit log, and the banner leads\nback.",[201,957,959],{"id":958},"options","Options",[961,962,963,969,980,990,997,1004,1011,1019,1026,1032,1038,1044,1050,1061,1071,1080,1089,1113],"field-group",{},[964,965],"field",{"name":966,"type":967,"default":968},"enabled","boolean","false",[964,970,974],{"name":971,"type":972,"default":973},"page","string","'\u002Forganization'",[189,975,976,977,686],{},"The organization's own page: ",[223,978,979],{},"\u003Cpage>\u002F\u003Corganization id>",[964,981,984],{"name":982,"type":972,"default":983},"invitationPage","'\u002Faccept-invitation'",[189,985,986,987,686],{},"The invitation page: ",[223,988,989],{},"\u003Cpage>\u002F\u003Cinvitation id>",[964,991,994],{"name":992,"type":967,"default":993},"allowUserToCreateOrganization","true",[189,995,996],{},"Whether users can create organizations.",[964,998,1001],{"name":999,"type":1000},"organizationLimit","number",[189,1002,1003],{},"Organizations a user can create. Unlimited by default.",[964,1005,1008],{"name":1006,"type":1000,"default":1007},"membershipLimit","100",[189,1009,1010],{},"Members an organization can have.",[964,1012,1016],{"name":1013,"type":1014,"default":1015},"creatorRole","'owner' | 'admin'","'owner'",[189,1017,1018],{},"The role of whoever creates an organization.",[964,1020,1023],{"name":1021,"type":1000,"default":1022},"invitationExpiresIn","172800",[189,1024,1025],{},"Seconds an invitation lasts (48 hours).",[964,1027,1029],{"name":1028,"type":1000,"default":1007},"invitationLimit",[189,1030,1031],{},"Pending invitations a user can send.",[964,1033,1035],{"name":1034,"type":967,"default":968},"requireEmailVerificationOnInvitation",[189,1036,1037],{},"Invitations need a verified email to see, accept or decline.",[964,1039,1041],{"name":1040,"type":967,"default":968},"cancelPendingInvitationsOnReInvite",[189,1042,1043],{},"Inviting someone again cancels their pending invitation.",[964,1045,1047],{"name":1046,"type":967,"default":968},"disableOrganizationDeletion",[189,1048,1049],{},"Nobody can delete an organization.",[964,1051,1054],{"name":1052,"type":1053,"default":968},"teams","boolean | object",[189,1055,1056,1057,1060],{},"Teams within organizations. ",[223,1058,1059],{},"{ maximumTeams, maximumMembersPerTeam, allowRemovingAllTeams }"," to set limits.",[964,1062,1065],{"name":1063,"type":1064},"statements","Record\u003Cstring, string[]>",[189,1066,1067,1068,686],{},"Your own resources and actions. See ",[193,1069,1070],{"href":87},"Roles and permissions",[964,1072,1075],{"name":1073,"type":1074},"roles","Record\u003Cstring, Record\u003Cstring, string[]>>",[189,1076,1077,1078,686],{},"Organization roles and their permissions. See ",[193,1079,1070],{"href":87},[964,1081,1083],{"name":1082,"type":1053,"default":968},"dynamicRoles",[189,1084,1085,1086,686],{},"Organizations create their own roles. See ",[193,1087,1070],{"href":1088},"\u002Forganizations\u002Froles#roles-each-organization-makes",[964,1090,1093],{"name":1091,"type":1092},"schema","object",[189,1094,1095,1096,1099,1100,716,1102,309,1104,309,1106,313,1109,1112],{},"Better Auth's schema options: table and field names, and your own fields (",[223,1097,1098],{},"additionalFields",") on ",[223,1101,187],{},[223,1103,312],{},[223,1105,316],{},[223,1107,1108],{},"team",[223,1110,1111],{},"organizationRole",". The organization's page shows and edits them.",[964,1114,1116],{"name":1115,"type":972},"serverOptions",[189,1117,1118],{},"A file with more of the plugin's options, for those that are functions. See below.",[210,1120,1122],{"id":1121},"options-that-are-functions","Options that are functions",[189,1124,1125,1126,1129,1130,1132,1133,1135,1136,1138],{},"Some of Better Auth's options are functions, like ",[223,1127,1128],{},"organizationHooks",", or ",[223,1131,999],{}," worked out per user.\nThey can't go in ",[223,1134,219],{},", so put them in a file and point ",[223,1137,1115],{}," at it:",[488,1140,1141,1216],{},[215,1142,1144],{"className":217,"code":1143,"filename":219,"language":220,"meta":221,"style":221},"export default defineNuxtConfig({\n  betterAuthUi: {\n    organization: {\n      enabled: true,\n      serverOptions: '.\u002Fserver\u002Fauth\u002Forganization.ts'\n    }\n  }\n})\n",[223,1145,1146,1158,1166,1174,1185,1201,1206,1210],{"__ignoreMap":221},[226,1147,1148,1150,1152,1154,1156],{"class":228,"line":229},[226,1149,233],{"class":232},[226,1151,236],{"class":232},[226,1153,240],{"class":239},[226,1155,244],{"class":243},[226,1157,248],{"class":247},[226,1159,1160,1162,1164],{"class":228,"line":251},[226,1161,255],{"class":254},[226,1163,258],{"class":247},[226,1165,261],{"class":247},[226,1167,1168,1170,1172],{"class":228,"line":264},[226,1169,267],{"class":254},[226,1171,258],{"class":247},[226,1173,261],{"class":247},[226,1175,1176,1179,1181,1183],{"class":228,"line":287},[226,1177,1178],{"class":254},"      enabled",[226,1180,258],{"class":247},[226,1182,281],{"class":280},[226,1184,716],{"class":247},[226,1186,1187,1190,1192,1195,1198],{"class":228,"line":293},[226,1188,1189],{"class":254},"      serverOptions",[226,1191,258],{"class":247},[226,1193,1194],{"class":247}," '",[226,1196,1197],{"class":563},".\u002Fserver\u002Fauth\u002Forganization.ts",[226,1199,1200],{"class":247},"'\n",[226,1202,1203],{"class":228,"line":758},[226,1204,1205],{"class":247},"    }\n",[226,1207,1208],{"class":228,"line":766},[226,1209,290],{"class":247},[226,1211,1212,1214],{"class":228,"line":807},[226,1213,296],{"class":247},[226,1215,299],{"class":243},[215,1217,1220],{"className":217,"code":1218,"filename":1219,"language":220,"meta":221,"style":221},"export default {\n  organizationHooks: {\n    afterCreateOrganization: async ({ organization }) => {\n      console.info(`Organization created: ${organization.name}`)\n    }\n  }\n}\n","server\u002Fauth\u002Forganization.ts",[223,1221,1222,1230,1239,1261,1294,1298,1302],{"__ignoreMap":221},[226,1223,1224,1226,1228],{"class":228,"line":229},[226,1225,233],{"class":232},[226,1227,236],{"class":232},[226,1229,261],{"class":247},[226,1231,1232,1235,1237],{"class":228,"line":251},[226,1233,1234],{"class":254},"  organizationHooks",[226,1236,258],{"class":247},[226,1238,261],{"class":247},[226,1240,1241,1244,1246,1249,1252,1254,1257,1259],{"class":228,"line":264},[226,1242,1243],{"class":239},"    afterCreateOrganization",[226,1245,258],{"class":247},[226,1247,1248],{"class":550}," async",[226,1250,1251],{"class":247}," ({",[226,1253,582],{"class":636},[226,1255,1256],{"class":247}," })",[226,1258,643],{"class":550},[226,1260,261],{"class":247},[226,1262,1263,1266,1268,1271,1273,1276,1279,1282,1284,1286,1289,1292],{"class":228,"line":287},[226,1264,1265],{"class":243},"      console",[226,1267,686],{"class":247},[226,1269,1270],{"class":239},"info",[226,1272,244],{"class":254},[226,1274,1275],{"class":247},"`",[226,1277,1278],{"class":563},"Organization created: ",[226,1280,1281],{"class":247},"${",[226,1283,187],{"class":243},[226,1285,686],{"class":247},[226,1287,1288],{"class":243},"name",[226,1290,1291],{"class":247},"}`",[226,1293,299],{"class":254},[226,1295,1296],{"class":228,"line":293},[226,1297,1205],{"class":247},[226,1299,1300],{"class":228,"line":758},[226,1301,290],{"class":247},[226,1303,1304],{"class":228,"line":766},[226,1305,1306],{"class":247},"}\n",[189,1308,1309],{},"Its options are added last, so they win over the module's. It's loaded with your auth config, also at build time, so\nkeep Nitro-only imports out of its top level.",[1311,1312,1313],"note",{},[189,1314,1315,1316,686],{},"The pages use Better Auth's words (organization, owner, admin, member). Call organizations \"teams\" or anything else\nwith ",[193,1317,1319],{"href":1318},"\u002Fcustomization\u002Flanguages#your-own-words",[223,1320,1321],{},"messages",[1323,1324,1325],"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 .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 .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 .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}",{"title":221,"searchDepth":229,"depth":251,"links":1327},[1328,1329,1334,1335,1336],{"id":203,"depth":251,"text":204},{"id":341,"depth":251,"text":342,"children":1330},[1331,1332,1333],{"id":345,"depth":264,"text":346},{"id":352,"depth":264,"text":353},{"id":471,"depth":264,"text":472},{"id":482,"depth":251,"text":483},{"id":866,"depth":251,"text":867},{"id":958,"depth":251,"text":959,"children":1337},[1338],{"id":1121,"depth":264,"text":1122},"Teams, workspaces or companies, with members, invitations and teams.","md",null,{},{"icon":84},{"title":79,"description":1339},"THkwxmXkPEwkTMdEsmWCsNvg3o8wc1Sw2VdXQYS3rjs",[1347,1349],{"title":74,"path":75,"stem":76,"description":1348,"icon":77,"children":-1},"Captcha, breached-password checks, and emails about sensitive changes.",{"title":86,"path":87,"stem":88,"description":1350,"icon":89,"children":-1},"Your own resources, roles in nuxt.config, and roles each organization makes.",1793019842936]