[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-better-auth-organization-best-practices":3,"mdc-ycjft6-key":33,"related-org-better-auth-organization-best-practices":6914,"related-repo-better-auth-organization-best-practices":6992},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":23,"repoUrl":24,"updatedAt":25,"license":26,"forks":27,"topics":28,"repo":29,"sourceUrl":31,"mdContent":32},"organization-best-practices","set up multi-tenant orgs in Better Auth","Configure multi-tenant organizations, manage members and invitations, define custom roles and permissions, set up teams, and implement RBAC using Better Auth's organization plugin. Use when users need org setup, team management, member roles, access control, or the Better Auth organization plugin.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"better-auth","Better Auth","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fbetter-auth.png",[12,14,17,20],{"name":9,"slug":8,"type":13},"tag",{"name":15,"slug":16,"type":13},"Auth","auth",{"name":18,"slug":19,"type":13},"Multi-Tenant","multi-tenant",{"name":21,"slug":22,"type":13},"RBAC","rbac",201,"https:\u002F\u002Fgithub.com\u002Fbetter-auth\u002Fskills","2026-04-06T18:05:00.636075",null,28,[],{"repoUrl":24,"stars":23,"forks":27,"topics":30,"description":26},[],"https:\u002F\u002Fgithub.com\u002Fbetter-auth\u002Fskills\u002Ftree\u002FHEAD\u002Fbetter-auth\u002Forganization","---\nname: organization-best-practices\ndescription: Configure multi-tenant organizations, manage members and invitations, define custom roles and permissions, set up teams, and implement RBAC using Better Auth's organization plugin. Use when users need org setup, team management, member roles, access control, or the Better Auth organization plugin.\n---\n\n## Setup\n\n1. Add `organization()` plugin to server config\n2. Add `organizationClient()` plugin to client config\n3. Run `npx @better-auth\u002Fcli@latest migrate` (built-in adapter) or generate + push for Drizzle\u002FPrisma\n4. Verify: check that organization, member, invitation tables exist in your database\n\n```ts\nimport { betterAuth } from \"better-auth\";\nimport { organization } from \"better-auth\u002Fplugins\";\n\nexport const auth = betterAuth({\n  plugins: [\n    organization({\n      allowUserToCreateOrganization: true,\n      organizationLimit: 5, \u002F\u002F Max orgs per user\n      membershipLimit: 100, \u002F\u002F Max members per org\n    }),\n  ],\n});\n```\n\n### Client-Side Setup\n\n```ts\nimport { createAuthClient } from \"better-auth\u002Fclient\";\nimport { organizationClient } from \"better-auth\u002Fclient\u002Fplugins\";\n\nexport const authClient = createAuthClient({\n  plugins: [organizationClient()],\n});\n```\n\n## Creating Organizations\n\nThe creator is automatically assigned the `owner` role.\n\n```ts\nconst createOrg = async () => {\n  const { data, error } = await authClient.organization.create({\n    name: \"My Company\",\n    slug: \"my-company\",\n    logo: \"https:\u002F\u002Fexample.com\u002Flogo.png\",\n    metadata: { plan: \"pro\" },\n  });\n};\n```\n\n### Controlling Organization Creation\n\nRestrict who can create organizations based on user attributes:\n\n```ts\norganization({\n  allowUserToCreateOrganization: async (user) => {\n    return user.emailVerified === true;\n  },\n  organizationLimit: async (user) => {\n    \u002F\u002F Premium users get more organizations\n    return user.plan === \"premium\" ? 20 : 3;\n  },\n});\n```\n\n### Creating Organizations on Behalf of Users\n\nAdministrators can create organizations for other users (server-side only):\n\n```ts\nawait auth.api.createOrganization({\n  body: {\n    name: \"Client Organization\",\n    slug: \"client-org\",\n    userId: \"user-id-who-will-be-owner\", \u002F\u002F `userId` is required\n  },\n});\n```\n\n**Note**: The `userId` parameter cannot be used alongside session headers.\n\n\n## Active Organizations\n\nStored in the session and scopes subsequent API calls. Set after user selects one.\n\n```ts\nconst setActive = async (organizationId: string) => {\n  const { data, error } = await authClient.organization.setActive({\n    organizationId,\n  });\n};\n```\n\nMany endpoints use the active organization when `organizationId` is not provided (`listMembers`, `listInvitations`, `inviteMember`, etc.).\n\nUse `getFullOrganization()` to retrieve the active org with all members, invitations, and teams.\n\n## Members\n\n### Adding Members (Server-Side)\n\n```ts\nawait auth.api.addMember({\n  body: {\n    userId: \"user-id\",\n    role: \"member\",\n    organizationId: \"org-id\",\n  },\n});\n```\n\nFor client-side member additions, use the invitation system instead.\n\n### Assigning Multiple Roles\n\n```ts\nawait auth.api.addMember({\n  body: {\n    userId: \"user-id\",\n    role: [\"admin\", \"moderator\"],\n    organizationId: \"org-id\",\n  },\n});\n```\n\n### Removing Members\n\nUse `removeMember({ memberIdOrEmail })`. The last owner cannot be removed — assign ownership to another member first.\n\n### Updating Member Roles\n\nUse `updateMemberRole({ memberId, role })`.\n\n### Membership Limits\n\n```ts\norganization({\n  membershipLimit: async (user, organization) => {\n    if (organization.metadata?.plan === \"enterprise\") {\n      return 1000;\n    }\n    return 50;\n  },\n});\n```\n\n## Invitations\n\n### Setting Up Invitation Emails\n\n```ts\nimport { betterAuth } from \"better-auth\";\nimport { organization } from \"better-auth\u002Fplugins\";\nimport { sendEmail } from \".\u002Femail\";\n\nexport const auth = betterAuth({\n  plugins: [\n    organization({\n      sendInvitationEmail: async (data) => {\n        const { email, organization, inviter, invitation } = data;\n\n        await sendEmail({\n          to: email,\n          subject: `Join ${organization.name}`,\n          html: `\n            \u003Cp>${inviter.user.name} invited you to join ${organization.name}\u003C\u002Fp>\n            \u003Ca href=\"https:\u002F\u002Fyourapp.com\u002Faccept-invite?id=${invitation.id}\">\n              Accept Invitation\n            \u003C\u002Fa>\n          `,\n        });\n      },\n    }),\n  ],\n});\n```\n\n### Sending Invitations\n\n```ts\nawait authClient.organization.inviteMember({\n  email: \"newuser@example.com\",\n  role: \"member\",\n});\n```\n\n### Shareable Invitation URLs\n\n```ts\nconst { data } = await authClient.organization.getInvitationURL({\n  email: \"newuser@example.com\",\n  role: \"member\",\n  callbackURL: \"https:\u002F\u002Fyourapp.com\u002Fdashboard\",\n});\n\n\u002F\u002F Share data.url via any channel\n```\n\nThis endpoint does not call `sendInvitationEmail` — handle delivery yourself.\n\n### Invitation Configuration\n\n```ts\norganization({\n  invitationExpiresIn: 60 * 60 * 24 * 7, \u002F\u002F 7 days (default: 48 hours)\n  invitationLimit: 100, \u002F\u002F Max pending invitations per org\n  cancelPendingInvitationsOnReInvite: true, \u002F\u002F Cancel old invites when re-inviting\n});\n```\n\n## Roles & Permissions\n\nDefault roles: `owner` (full access), `admin` (manage members\u002Finvitations\u002Fsettings), `member` (basic access).\n\n### Checking Permissions\n\n```ts\nconst { data } = await authClient.organization.hasPermission({\n  permission: \"member:write\",\n});\n\nif (data?.hasPermission) {\n  \u002F\u002F User can manage members\n}\n```\n\nUse `checkRolePermission({ role, permissions })` for client-side UI rendering (static only). For dynamic access control, use the `hasPermission` endpoint.\n\n## Teams\n\n### Enabling Teams\n\n```ts\nimport { organization } from \"better-auth\u002Fplugins\";\n\nexport const auth = betterAuth({\n  plugins: [\n    organization({\n        teams: {\n            enabled: true\n        }\n    }),\n  ],\n});\n```\n\n### Creating Teams\n\n```ts\nconst { data } = await authClient.organization.createTeam({\n  name: \"Engineering\",\n});\n```\n\n### Managing Team Members\n\nUse `addTeamMember({ teamId, userId })` (member must be in org first) and `removeTeamMember({ teamId, userId })` (stays in org).\n\nSet active team with `setActiveTeam({ teamId })`.\n\n### Team Limits\n\n```ts\norganization({\n  teams: {\n      maximumTeams: 20, \u002F\u002F Max teams per org\n      maximumMembersPerTeam: 50, \u002F\u002F Max members per team\n      allowRemovingAllTeams: false, \u002F\u002F Prevent removing last team\n  }\n});\n```\n\n## Dynamic Access Control\n\n### Enabling Dynamic Access Control\n\n```ts\nimport { organization } from \"better-auth\u002Fplugins\";\nimport { dynamicAccessControl } from \"@better-auth\u002Forganization\u002Faddons\";\n\nexport const auth = betterAuth({\n  plugins: [\n    organization({\n        dynamicAccessControl: {\n            enabled: true\n        }\n    }),\n  ],\n});\n```\n\n### Creating Custom Roles\n\n```ts\nawait authClient.organization.createRole({\n  role: \"moderator\",\n  permission: {\n    member: [\"read\"],\n    invitation: [\"read\"],\n  },\n});\n```\n\nUse `updateRole({ roleId, permission })` and `deleteRole({ roleId })`. Pre-defined roles (owner, admin, member) cannot be deleted. Roles assigned to members cannot be deleted until reassigned.\n\n## Lifecycle Hooks\n\nExecute custom logic at various points in the organization lifecycle:\n\n```ts\norganization({\n  hooks: {\n    organization: {\n      beforeCreate: async ({ data, user }) => {\n        \u002F\u002F Validate or modify data before creation\n        return {\n          data: {\n            ...data,\n            metadata: { ...data.metadata, createdBy: user.id },\n          },\n        };\n      },\n      afterCreate: async ({ organization, member }) => {\n        \u002F\u002F Post-creation logic (e.g., send welcome email, create default resources)\n        await createDefaultResources(organization.id);\n      },\n      beforeDelete: async ({ organization }) => {\n        \u002F\u002F Cleanup before deletion\n        await archiveOrganizationData(organization.id);\n      },\n    },\n    member: {\n      afterCreate: async ({ member, organization }) => {\n        await notifyAdmins(organization.id, `New member joined`);\n      },\n    },\n    invitation: {\n      afterCreate: async ({ invitation, organization, inviter }) => {\n        await logInvitation(invitation);\n      },\n    },\n  },\n});\n```\n\n## Schema Customization\n\nCustomize table names, field names, and add additional fields:\n\n```ts\norganization({\n  schema: {\n    organization: {\n      modelName: \"workspace\", \u002F\u002F Rename table\n      fields: {\n        name: \"workspaceName\", \u002F\u002F Rename fields\n      },\n      additionalFields: {\n        billingId: {\n          type: \"string\",\n          required: false,\n        },\n      },\n    },\n    member: {\n      additionalFields: {\n        department: {\n          type: \"string\",\n          required: false,\n        },\n        title: {\n          type: \"string\",\n          required: false,\n        },\n      },\n    },\n  },\n});\n```\n\n## Security Considerations\n\n### Owner Protection\n\n- The last owner cannot be removed from an organization\n- The last owner cannot leave the organization\n- The owner role cannot be removed from the last owner\n\nAlways ensure ownership transfer before removing the current owner:\n\n```ts\n\u002F\u002F Transfer ownership first\nawait authClient.organization.updateMemberRole({\n  memberId: \"new-owner-member-id\",\n  role: \"owner\",\n});\n\n\u002F\u002F Then the previous owner can be demoted or removed\n```\n\n### Organization Deletion\n\nDeleting an organization removes all associated data (members, invitations, teams). Prevent accidental deletion:\n\n```ts\norganization({\n  disableOrganizationDeletion: true, \u002F\u002F Disable via config\n});\n```\n\nOr implement soft delete via hooks:\n\n```ts\norganization({\n  hooks: {\n    organization: {\n      beforeDelete: async ({ organization }) => {\n        \u002F\u002F Archive instead of delete\n        await archiveOrganization(organization.id);\n        throw new Error(\"Organization archived, not deleted\");\n      },\n    },\n  },\n});\n```\n\n### Invitation Security\n\n- Invitations expire after 48 hours by default\n- Only the invited email address can accept an invitation\n- Pending invitations can be cancelled by organization admins\n\n## Complete Configuration Example\n\n```ts\nimport { betterAuth } from \"better-auth\";\nimport { organization } from \"better-auth\u002Fplugins\";\nimport { sendEmail } from \".\u002Femail\";\n\nexport const auth = betterAuth({\n  plugins: [\n    organization({\n      \u002F\u002F Organization limits\n      allowUserToCreateOrganization: true,\n      organizationLimit: 10,\n      membershipLimit: 100,\n      creatorRole: \"owner\",\n\n      \u002F\u002F Slugs\n      defaultOrganizationIdField: \"slug\",\n\n      \u002F\u002F Invitations\n      invitationExpiresIn: 60 * 60 * 24 * 7, \u002F\u002F 7 days\n      invitationLimit: 50,\n      sendInvitationEmail: async (data) => {\n        await sendEmail({\n          to: data.email,\n          subject: `Join ${data.organization.name}`,\n          html: `\u003Ca href=\"https:\u002F\u002Fapp.com\u002Finvite\u002F${data.invitation.id}\">Accept\u003C\u002Fa>`,\n        });\n      },\n\n      \u002F\u002F Hooks\n      hooks: {\n        organization: {\n          afterCreate: async ({ organization }) => {\n            console.log(`Organization ${organization.name} created`);\n          },\n        },\n      },\n    }),\n  ],\n});\n```\n",{"data":34,"body":35},{"name":4,"description":6},{"type":36,"children":37},"root",[38,47,96,419,426,599,605,619,889,895,900,1131,1137,1142,1316,1335,1341,1346,1502,1537,1550,1556,1562,1727,1732,1738,1925,1931,1943,1949,1960,1966,2155,2161,2167,2777,2783,2897,2903,3080,3093,3099,3239,3245,3271,3277,3433,3452,3458,3464,3660,3666,3773,3779,3799,3811,3817,3954,3960,3966,4200,4206,4386,4406,4412,4417,5108,5114,5119,5570,5576,5582,5601,5606,5743,5749,5754,5816,5821,6031,6037,6055,6061,6908],{"type":39,"tag":40,"props":41,"children":43},"element","h2",{"id":42},"setup",[44],{"type":45,"value":46},"text","Setup",{"type":39,"tag":48,"props":49,"children":50},"ol",{},[51,66,78,91],{"type":39,"tag":52,"props":53,"children":54},"li",{},[55,57,64],{"type":45,"value":56},"Add ",{"type":39,"tag":58,"props":59,"children":61},"code",{"className":60},[],[62],{"type":45,"value":63},"organization()",{"type":45,"value":65}," plugin to server config",{"type":39,"tag":52,"props":67,"children":68},{},[69,70,76],{"type":45,"value":56},{"type":39,"tag":58,"props":71,"children":73},{"className":72},[],[74],{"type":45,"value":75},"organizationClient()",{"type":45,"value":77}," plugin to client config",{"type":39,"tag":52,"props":79,"children":80},{},[81,83,89],{"type":45,"value":82},"Run ",{"type":39,"tag":58,"props":84,"children":86},{"className":85},[],[87],{"type":45,"value":88},"npx @better-auth\u002Fcli@latest migrate",{"type":45,"value":90}," (built-in adapter) or generate + push for Drizzle\u002FPrisma",{"type":39,"tag":52,"props":92,"children":93},{},[94],{"type":45,"value":95},"Verify: check that organization, member, invitation tables exist in your database",{"type":39,"tag":97,"props":98,"children":103},"pre",{"className":99,"code":100,"language":101,"meta":102,"style":102},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { betterAuth } from \"better-auth\";\nimport { organization } from \"better-auth\u002Fplugins\";\n\nexport const auth = betterAuth({\n  plugins: [\n    organization({\n      allowUserToCreateOrganization: true,\n      organizationLimit: 5, \u002F\u002F Max orgs per user\n      membershipLimit: 100, \u002F\u002F Max members per org\n    }),\n  ],\n});\n","ts","",[104],{"type":39,"tag":58,"props":105,"children":106},{"__ignoreMap":102},[107,161,203,213,253,273,290,314,344,371,389,402],{"type":39,"tag":108,"props":109,"children":112},"span",{"class":110,"line":111},"line",1,[113,119,125,131,136,141,146,151,156],{"type":39,"tag":108,"props":114,"children":116},{"style":115},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[117],{"type":45,"value":118},"import",{"type":39,"tag":108,"props":120,"children":122},{"style":121},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[123],{"type":45,"value":124}," {",{"type":39,"tag":108,"props":126,"children":128},{"style":127},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[129],{"type":45,"value":130}," betterAuth",{"type":39,"tag":108,"props":132,"children":133},{"style":121},[134],{"type":45,"value":135}," }",{"type":39,"tag":108,"props":137,"children":138},{"style":115},[139],{"type":45,"value":140}," from",{"type":39,"tag":108,"props":142,"children":143},{"style":121},[144],{"type":45,"value":145}," \"",{"type":39,"tag":108,"props":147,"children":149},{"style":148},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[150],{"type":45,"value":8},{"type":39,"tag":108,"props":152,"children":153},{"style":121},[154],{"type":45,"value":155},"\"",{"type":39,"tag":108,"props":157,"children":158},{"style":121},[159],{"type":45,"value":160},";\n",{"type":39,"tag":108,"props":162,"children":164},{"class":110,"line":163},2,[165,169,173,178,182,186,190,195,199],{"type":39,"tag":108,"props":166,"children":167},{"style":115},[168],{"type":45,"value":118},{"type":39,"tag":108,"props":170,"children":171},{"style":121},[172],{"type":45,"value":124},{"type":39,"tag":108,"props":174,"children":175},{"style":127},[176],{"type":45,"value":177}," organization",{"type":39,"tag":108,"props":179,"children":180},{"style":121},[181],{"type":45,"value":135},{"type":39,"tag":108,"props":183,"children":184},{"style":115},[185],{"type":45,"value":140},{"type":39,"tag":108,"props":187,"children":188},{"style":121},[189],{"type":45,"value":145},{"type":39,"tag":108,"props":191,"children":192},{"style":148},[193],{"type":45,"value":194},"better-auth\u002Fplugins",{"type":39,"tag":108,"props":196,"children":197},{"style":121},[198],{"type":45,"value":155},{"type":39,"tag":108,"props":200,"children":201},{"style":121},[202],{"type":45,"value":160},{"type":39,"tag":108,"props":204,"children":206},{"class":110,"line":205},3,[207],{"type":39,"tag":108,"props":208,"children":210},{"emptyLinePlaceholder":209},true,[211],{"type":45,"value":212},"\n",{"type":39,"tag":108,"props":214,"children":216},{"class":110,"line":215},4,[217,222,228,233,238,243,248],{"type":39,"tag":108,"props":218,"children":219},{"style":115},[220],{"type":45,"value":221},"export",{"type":39,"tag":108,"props":223,"children":225},{"style":224},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[226],{"type":45,"value":227}," const",{"type":39,"tag":108,"props":229,"children":230},{"style":127},[231],{"type":45,"value":232}," auth ",{"type":39,"tag":108,"props":234,"children":235},{"style":121},[236],{"type":45,"value":237},"=",{"type":39,"tag":108,"props":239,"children":241},{"style":240},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[242],{"type":45,"value":130},{"type":39,"tag":108,"props":244,"children":245},{"style":127},[246],{"type":45,"value":247},"(",{"type":39,"tag":108,"props":249,"children":250},{"style":121},[251],{"type":45,"value":252},"{\n",{"type":39,"tag":108,"props":254,"children":256},{"class":110,"line":255},5,[257,263,268],{"type":39,"tag":108,"props":258,"children":260},{"style":259},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[261],{"type":45,"value":262},"  plugins",{"type":39,"tag":108,"props":264,"children":265},{"style":121},[266],{"type":45,"value":267},":",{"type":39,"tag":108,"props":269,"children":270},{"style":127},[271],{"type":45,"value":272}," [\n",{"type":39,"tag":108,"props":274,"children":276},{"class":110,"line":275},6,[277,282,286],{"type":39,"tag":108,"props":278,"children":279},{"style":240},[280],{"type":45,"value":281},"    organization",{"type":39,"tag":108,"props":283,"children":284},{"style":127},[285],{"type":45,"value":247},{"type":39,"tag":108,"props":287,"children":288},{"style":121},[289],{"type":45,"value":252},{"type":39,"tag":108,"props":291,"children":293},{"class":110,"line":292},7,[294,299,303,309],{"type":39,"tag":108,"props":295,"children":296},{"style":259},[297],{"type":45,"value":298},"      allowUserToCreateOrganization",{"type":39,"tag":108,"props":300,"children":301},{"style":121},[302],{"type":45,"value":267},{"type":39,"tag":108,"props":304,"children":306},{"style":305},"--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC",[307],{"type":45,"value":308}," true",{"type":39,"tag":108,"props":310,"children":311},{"style":121},[312],{"type":45,"value":313},",\n",{"type":39,"tag":108,"props":315,"children":317},{"class":110,"line":316},8,[318,323,327,333,338],{"type":39,"tag":108,"props":319,"children":320},{"style":259},[321],{"type":45,"value":322},"      organizationLimit",{"type":39,"tag":108,"props":324,"children":325},{"style":121},[326],{"type":45,"value":267},{"type":39,"tag":108,"props":328,"children":330},{"style":329},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[331],{"type":45,"value":332}," 5",{"type":39,"tag":108,"props":334,"children":335},{"style":121},[336],{"type":45,"value":337},",",{"type":39,"tag":108,"props":339,"children":341},{"style":340},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[342],{"type":45,"value":343}," \u002F\u002F Max orgs per user\n",{"type":39,"tag":108,"props":345,"children":347},{"class":110,"line":346},9,[348,353,357,362,366],{"type":39,"tag":108,"props":349,"children":350},{"style":259},[351],{"type":45,"value":352},"      membershipLimit",{"type":39,"tag":108,"props":354,"children":355},{"style":121},[356],{"type":45,"value":267},{"type":39,"tag":108,"props":358,"children":359},{"style":329},[360],{"type":45,"value":361}," 100",{"type":39,"tag":108,"props":363,"children":364},{"style":121},[365],{"type":45,"value":337},{"type":39,"tag":108,"props":367,"children":368},{"style":340},[369],{"type":45,"value":370}," \u002F\u002F Max members per org\n",{"type":39,"tag":108,"props":372,"children":374},{"class":110,"line":373},10,[375,380,385],{"type":39,"tag":108,"props":376,"children":377},{"style":121},[378],{"type":45,"value":379},"    }",{"type":39,"tag":108,"props":381,"children":382},{"style":127},[383],{"type":45,"value":384},")",{"type":39,"tag":108,"props":386,"children":387},{"style":121},[388],{"type":45,"value":313},{"type":39,"tag":108,"props":390,"children":392},{"class":110,"line":391},11,[393,398],{"type":39,"tag":108,"props":394,"children":395},{"style":127},[396],{"type":45,"value":397},"  ]",{"type":39,"tag":108,"props":399,"children":400},{"style":121},[401],{"type":45,"value":313},{"type":39,"tag":108,"props":403,"children":405},{"class":110,"line":404},12,[406,411,415],{"type":39,"tag":108,"props":407,"children":408},{"style":121},[409],{"type":45,"value":410},"}",{"type":39,"tag":108,"props":412,"children":413},{"style":127},[414],{"type":45,"value":384},{"type":39,"tag":108,"props":416,"children":417},{"style":121},[418],{"type":45,"value":160},{"type":39,"tag":420,"props":421,"children":423},"h3",{"id":422},"client-side-setup",[424],{"type":45,"value":425},"Client-Side Setup",{"type":39,"tag":97,"props":427,"children":429},{"className":99,"code":428,"language":101,"meta":102,"style":102},"import { createAuthClient } from \"better-auth\u002Fclient\";\nimport { organizationClient } from \"better-auth\u002Fclient\u002Fplugins\";\n\nexport const authClient = createAuthClient({\n  plugins: [organizationClient()],\n});\n",[430],{"type":39,"tag":58,"props":431,"children":432},{"__ignoreMap":102},[433,474,515,522,554,584],{"type":39,"tag":108,"props":434,"children":435},{"class":110,"line":111},[436,440,444,449,453,457,461,466,470],{"type":39,"tag":108,"props":437,"children":438},{"style":115},[439],{"type":45,"value":118},{"type":39,"tag":108,"props":441,"children":442},{"style":121},[443],{"type":45,"value":124},{"type":39,"tag":108,"props":445,"children":446},{"style":127},[447],{"type":45,"value":448}," createAuthClient",{"type":39,"tag":108,"props":450,"children":451},{"style":121},[452],{"type":45,"value":135},{"type":39,"tag":108,"props":454,"children":455},{"style":115},[456],{"type":45,"value":140},{"type":39,"tag":108,"props":458,"children":459},{"style":121},[460],{"type":45,"value":145},{"type":39,"tag":108,"props":462,"children":463},{"style":148},[464],{"type":45,"value":465},"better-auth\u002Fclient",{"type":39,"tag":108,"props":467,"children":468},{"style":121},[469],{"type":45,"value":155},{"type":39,"tag":108,"props":471,"children":472},{"style":121},[473],{"type":45,"value":160},{"type":39,"tag":108,"props":475,"children":476},{"class":110,"line":163},[477,481,485,490,494,498,502,507,511],{"type":39,"tag":108,"props":478,"children":479},{"style":115},[480],{"type":45,"value":118},{"type":39,"tag":108,"props":482,"children":483},{"style":121},[484],{"type":45,"value":124},{"type":39,"tag":108,"props":486,"children":487},{"style":127},[488],{"type":45,"value":489}," organizationClient",{"type":39,"tag":108,"props":491,"children":492},{"style":121},[493],{"type":45,"value":135},{"type":39,"tag":108,"props":495,"children":496},{"style":115},[497],{"type":45,"value":140},{"type":39,"tag":108,"props":499,"children":500},{"style":121},[501],{"type":45,"value":145},{"type":39,"tag":108,"props":503,"children":504},{"style":148},[505],{"type":45,"value":506},"better-auth\u002Fclient\u002Fplugins",{"type":39,"tag":108,"props":508,"children":509},{"style":121},[510],{"type":45,"value":155},{"type":39,"tag":108,"props":512,"children":513},{"style":121},[514],{"type":45,"value":160},{"type":39,"tag":108,"props":516,"children":517},{"class":110,"line":205},[518],{"type":39,"tag":108,"props":519,"children":520},{"emptyLinePlaceholder":209},[521],{"type":45,"value":212},{"type":39,"tag":108,"props":523,"children":524},{"class":110,"line":215},[525,529,533,538,542,546,550],{"type":39,"tag":108,"props":526,"children":527},{"style":115},[528],{"type":45,"value":221},{"type":39,"tag":108,"props":530,"children":531},{"style":224},[532],{"type":45,"value":227},{"type":39,"tag":108,"props":534,"children":535},{"style":127},[536],{"type":45,"value":537}," authClient ",{"type":39,"tag":108,"props":539,"children":540},{"style":121},[541],{"type":45,"value":237},{"type":39,"tag":108,"props":543,"children":544},{"style":240},[545],{"type":45,"value":448},{"type":39,"tag":108,"props":547,"children":548},{"style":127},[549],{"type":45,"value":247},{"type":39,"tag":108,"props":551,"children":552},{"style":121},[553],{"type":45,"value":252},{"type":39,"tag":108,"props":555,"children":556},{"class":110,"line":255},[557,561,565,570,575,580],{"type":39,"tag":108,"props":558,"children":559},{"style":259},[560],{"type":45,"value":262},{"type":39,"tag":108,"props":562,"children":563},{"style":121},[564],{"type":45,"value":267},{"type":39,"tag":108,"props":566,"children":567},{"style":127},[568],{"type":45,"value":569}," [",{"type":39,"tag":108,"props":571,"children":572},{"style":240},[573],{"type":45,"value":574},"organizationClient",{"type":39,"tag":108,"props":576,"children":577},{"style":127},[578],{"type":45,"value":579},"()]",{"type":39,"tag":108,"props":581,"children":582},{"style":121},[583],{"type":45,"value":313},{"type":39,"tag":108,"props":585,"children":586},{"class":110,"line":275},[587,591,595],{"type":39,"tag":108,"props":588,"children":589},{"style":121},[590],{"type":45,"value":410},{"type":39,"tag":108,"props":592,"children":593},{"style":127},[594],{"type":45,"value":384},{"type":39,"tag":108,"props":596,"children":597},{"style":121},[598],{"type":45,"value":160},{"type":39,"tag":40,"props":600,"children":602},{"id":601},"creating-organizations",[603],{"type":45,"value":604},"Creating Organizations",{"type":39,"tag":606,"props":607,"children":608},"p",{},[609,611,617],{"type":45,"value":610},"The creator is automatically assigned the ",{"type":39,"tag":58,"props":612,"children":614},{"className":613},[],[615],{"type":45,"value":616},"owner",{"type":45,"value":618}," role.",{"type":39,"tag":97,"props":620,"children":622},{"className":99,"code":621,"language":101,"meta":102,"style":102},"const createOrg = async () => {\n  const { data, error } = await authClient.organization.create({\n    name: \"My Company\",\n    slug: \"my-company\",\n    logo: \"https:\u002F\u002Fexample.com\u002Flogo.png\",\n    metadata: { plan: \"pro\" },\n  });\n};\n",[623],{"type":39,"tag":58,"props":624,"children":625},{"__ignoreMap":102},[626,663,735,764,793,822,865,881],{"type":39,"tag":108,"props":627,"children":628},{"class":110,"line":111},[629,634,639,643,648,653,658],{"type":39,"tag":108,"props":630,"children":631},{"style":224},[632],{"type":45,"value":633},"const",{"type":39,"tag":108,"props":635,"children":636},{"style":127},[637],{"type":45,"value":638}," createOrg ",{"type":39,"tag":108,"props":640,"children":641},{"style":121},[642],{"type":45,"value":237},{"type":39,"tag":108,"props":644,"children":645},{"style":224},[646],{"type":45,"value":647}," async",{"type":39,"tag":108,"props":649,"children":650},{"style":121},[651],{"type":45,"value":652}," ()",{"type":39,"tag":108,"props":654,"children":655},{"style":224},[656],{"type":45,"value":657}," =>",{"type":39,"tag":108,"props":659,"children":660},{"style":121},[661],{"type":45,"value":662}," {\n",{"type":39,"tag":108,"props":664,"children":665},{"class":110,"line":163},[666,671,675,680,684,689,693,698,703,708,713,718,722,727,731],{"type":39,"tag":108,"props":667,"children":668},{"style":224},[669],{"type":45,"value":670},"  const",{"type":39,"tag":108,"props":672,"children":673},{"style":121},[674],{"type":45,"value":124},{"type":39,"tag":108,"props":676,"children":677},{"style":127},[678],{"type":45,"value":679}," data",{"type":39,"tag":108,"props":681,"children":682},{"style":121},[683],{"type":45,"value":337},{"type":39,"tag":108,"props":685,"children":686},{"style":127},[687],{"type":45,"value":688}," error",{"type":39,"tag":108,"props":690,"children":691},{"style":121},[692],{"type":45,"value":135},{"type":39,"tag":108,"props":694,"children":695},{"style":121},[696],{"type":45,"value":697}," =",{"type":39,"tag":108,"props":699,"children":700},{"style":115},[701],{"type":45,"value":702}," await",{"type":39,"tag":108,"props":704,"children":705},{"style":127},[706],{"type":45,"value":707}," authClient",{"type":39,"tag":108,"props":709,"children":710},{"style":121},[711],{"type":45,"value":712},".",{"type":39,"tag":108,"props":714,"children":715},{"style":127},[716],{"type":45,"value":717},"organization",{"type":39,"tag":108,"props":719,"children":720},{"style":121},[721],{"type":45,"value":712},{"type":39,"tag":108,"props":723,"children":724},{"style":240},[725],{"type":45,"value":726},"create",{"type":39,"tag":108,"props":728,"children":729},{"style":259},[730],{"type":45,"value":247},{"type":39,"tag":108,"props":732,"children":733},{"style":121},[734],{"type":45,"value":252},{"type":39,"tag":108,"props":736,"children":737},{"class":110,"line":205},[738,743,747,751,756,760],{"type":39,"tag":108,"props":739,"children":740},{"style":259},[741],{"type":45,"value":742},"    name",{"type":39,"tag":108,"props":744,"children":745},{"style":121},[746],{"type":45,"value":267},{"type":39,"tag":108,"props":748,"children":749},{"style":121},[750],{"type":45,"value":145},{"type":39,"tag":108,"props":752,"children":753},{"style":148},[754],{"type":45,"value":755},"My Company",{"type":39,"tag":108,"props":757,"children":758},{"style":121},[759],{"type":45,"value":155},{"type":39,"tag":108,"props":761,"children":762},{"style":121},[763],{"type":45,"value":313},{"type":39,"tag":108,"props":765,"children":766},{"class":110,"line":215},[767,772,776,780,785,789],{"type":39,"tag":108,"props":768,"children":769},{"style":259},[770],{"type":45,"value":771},"    slug",{"type":39,"tag":108,"props":773,"children":774},{"style":121},[775],{"type":45,"value":267},{"type":39,"tag":108,"props":777,"children":778},{"style":121},[779],{"type":45,"value":145},{"type":39,"tag":108,"props":781,"children":782},{"style":148},[783],{"type":45,"value":784},"my-company",{"type":39,"tag":108,"props":786,"children":787},{"style":121},[788],{"type":45,"value":155},{"type":39,"tag":108,"props":790,"children":791},{"style":121},[792],{"type":45,"value":313},{"type":39,"tag":108,"props":794,"children":795},{"class":110,"line":255},[796,801,805,809,814,818],{"type":39,"tag":108,"props":797,"children":798},{"style":259},[799],{"type":45,"value":800},"    logo",{"type":39,"tag":108,"props":802,"children":803},{"style":121},[804],{"type":45,"value":267},{"type":39,"tag":108,"props":806,"children":807},{"style":121},[808],{"type":45,"value":145},{"type":39,"tag":108,"props":810,"children":811},{"style":148},[812],{"type":45,"value":813},"https:\u002F\u002Fexample.com\u002Flogo.png",{"type":39,"tag":108,"props":815,"children":816},{"style":121},[817],{"type":45,"value":155},{"type":39,"tag":108,"props":819,"children":820},{"style":121},[821],{"type":45,"value":313},{"type":39,"tag":108,"props":823,"children":824},{"class":110,"line":275},[825,830,834,838,843,847,851,856,860],{"type":39,"tag":108,"props":826,"children":827},{"style":259},[828],{"type":45,"value":829},"    metadata",{"type":39,"tag":108,"props":831,"children":832},{"style":121},[833],{"type":45,"value":267},{"type":39,"tag":108,"props":835,"children":836},{"style":121},[837],{"type":45,"value":124},{"type":39,"tag":108,"props":839,"children":840},{"style":259},[841],{"type":45,"value":842}," plan",{"type":39,"tag":108,"props":844,"children":845},{"style":121},[846],{"type":45,"value":267},{"type":39,"tag":108,"props":848,"children":849},{"style":121},[850],{"type":45,"value":145},{"type":39,"tag":108,"props":852,"children":853},{"style":148},[854],{"type":45,"value":855},"pro",{"type":39,"tag":108,"props":857,"children":858},{"style":121},[859],{"type":45,"value":155},{"type":39,"tag":108,"props":861,"children":862},{"style":121},[863],{"type":45,"value":864}," },\n",{"type":39,"tag":108,"props":866,"children":867},{"class":110,"line":292},[868,873,877],{"type":39,"tag":108,"props":869,"children":870},{"style":121},[871],{"type":45,"value":872},"  }",{"type":39,"tag":108,"props":874,"children":875},{"style":259},[876],{"type":45,"value":384},{"type":39,"tag":108,"props":878,"children":879},{"style":121},[880],{"type":45,"value":160},{"type":39,"tag":108,"props":882,"children":883},{"class":110,"line":316},[884],{"type":39,"tag":108,"props":885,"children":886},{"style":121},[887],{"type":45,"value":888},"};\n",{"type":39,"tag":420,"props":890,"children":892},{"id":891},"controlling-organization-creation",[893],{"type":45,"value":894},"Controlling Organization Creation",{"type":39,"tag":606,"props":896,"children":897},{},[898],{"type":45,"value":899},"Restrict who can create organizations based on user attributes:",{"type":39,"tag":97,"props":901,"children":903},{"className":99,"code":902,"language":101,"meta":102,"style":102},"organization({\n  allowUserToCreateOrganization: async (user) => {\n    return user.emailVerified === true;\n  },\n  organizationLimit: async (user) => {\n    \u002F\u002F Premium users get more organizations\n    return user.plan === \"premium\" ? 20 : 3;\n  },\n});\n",[904],{"type":39,"tag":58,"props":905,"children":906},{"__ignoreMap":102},[907,922,961,996,1004,1040,1048,1109,1116],{"type":39,"tag":108,"props":908,"children":909},{"class":110,"line":111},[910,914,918],{"type":39,"tag":108,"props":911,"children":912},{"style":240},[913],{"type":45,"value":717},{"type":39,"tag":108,"props":915,"children":916},{"style":127},[917],{"type":45,"value":247},{"type":39,"tag":108,"props":919,"children":920},{"style":121},[921],{"type":45,"value":252},{"type":39,"tag":108,"props":923,"children":924},{"class":110,"line":163},[925,930,934,938,943,949,953,957],{"type":39,"tag":108,"props":926,"children":927},{"style":240},[928],{"type":45,"value":929},"  allowUserToCreateOrganization",{"type":39,"tag":108,"props":931,"children":932},{"style":121},[933],{"type":45,"value":267},{"type":39,"tag":108,"props":935,"children":936},{"style":224},[937],{"type":45,"value":647},{"type":39,"tag":108,"props":939,"children":940},{"style":121},[941],{"type":45,"value":942}," (",{"type":39,"tag":108,"props":944,"children":946},{"style":945},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic",[947],{"type":45,"value":948},"user",{"type":39,"tag":108,"props":950,"children":951},{"style":121},[952],{"type":45,"value":384},{"type":39,"tag":108,"props":954,"children":955},{"style":224},[956],{"type":45,"value":657},{"type":39,"tag":108,"props":958,"children":959},{"style":121},[960],{"type":45,"value":662},{"type":39,"tag":108,"props":962,"children":963},{"class":110,"line":205},[964,969,974,978,983,988,992],{"type":39,"tag":108,"props":965,"children":966},{"style":115},[967],{"type":45,"value":968},"    return",{"type":39,"tag":108,"props":970,"children":971},{"style":127},[972],{"type":45,"value":973}," user",{"type":39,"tag":108,"props":975,"children":976},{"style":121},[977],{"type":45,"value":712},{"type":39,"tag":108,"props":979,"children":980},{"style":127},[981],{"type":45,"value":982},"emailVerified",{"type":39,"tag":108,"props":984,"children":985},{"style":121},[986],{"type":45,"value":987}," ===",{"type":39,"tag":108,"props":989,"children":990},{"style":305},[991],{"type":45,"value":308},{"type":39,"tag":108,"props":993,"children":994},{"style":121},[995],{"type":45,"value":160},{"type":39,"tag":108,"props":997,"children":998},{"class":110,"line":215},[999],{"type":39,"tag":108,"props":1000,"children":1001},{"style":121},[1002],{"type":45,"value":1003},"  },\n",{"type":39,"tag":108,"props":1005,"children":1006},{"class":110,"line":255},[1007,1012,1016,1020,1024,1028,1032,1036],{"type":39,"tag":108,"props":1008,"children":1009},{"style":240},[1010],{"type":45,"value":1011},"  organizationLimit",{"type":39,"tag":108,"props":1013,"children":1014},{"style":121},[1015],{"type":45,"value":267},{"type":39,"tag":108,"props":1017,"children":1018},{"style":224},[1019],{"type":45,"value":647},{"type":39,"tag":108,"props":1021,"children":1022},{"style":121},[1023],{"type":45,"value":942},{"type":39,"tag":108,"props":1025,"children":1026},{"style":945},[1027],{"type":45,"value":948},{"type":39,"tag":108,"props":1029,"children":1030},{"style":121},[1031],{"type":45,"value":384},{"type":39,"tag":108,"props":1033,"children":1034},{"style":224},[1035],{"type":45,"value":657},{"type":39,"tag":108,"props":1037,"children":1038},{"style":121},[1039],{"type":45,"value":662},{"type":39,"tag":108,"props":1041,"children":1042},{"class":110,"line":275},[1043],{"type":39,"tag":108,"props":1044,"children":1045},{"style":340},[1046],{"type":45,"value":1047},"    \u002F\u002F Premium users get more organizations\n",{"type":39,"tag":108,"props":1049,"children":1050},{"class":110,"line":292},[1051,1055,1059,1063,1068,1072,1076,1081,1085,1090,1095,1100,1105],{"type":39,"tag":108,"props":1052,"children":1053},{"style":115},[1054],{"type":45,"value":968},{"type":39,"tag":108,"props":1056,"children":1057},{"style":127},[1058],{"type":45,"value":973},{"type":39,"tag":108,"props":1060,"children":1061},{"style":121},[1062],{"type":45,"value":712},{"type":39,"tag":108,"props":1064,"children":1065},{"style":127},[1066],{"type":45,"value":1067},"plan",{"type":39,"tag":108,"props":1069,"children":1070},{"style":121},[1071],{"type":45,"value":987},{"type":39,"tag":108,"props":1073,"children":1074},{"style":121},[1075],{"type":45,"value":145},{"type":39,"tag":108,"props":1077,"children":1078},{"style":148},[1079],{"type":45,"value":1080},"premium",{"type":39,"tag":108,"props":1082,"children":1083},{"style":121},[1084],{"type":45,"value":155},{"type":39,"tag":108,"props":1086,"children":1087},{"style":121},[1088],{"type":45,"value":1089}," ?",{"type":39,"tag":108,"props":1091,"children":1092},{"style":329},[1093],{"type":45,"value":1094}," 20",{"type":39,"tag":108,"props":1096,"children":1097},{"style":121},[1098],{"type":45,"value":1099}," :",{"type":39,"tag":108,"props":1101,"children":1102},{"style":329},[1103],{"type":45,"value":1104}," 3",{"type":39,"tag":108,"props":1106,"children":1107},{"style":121},[1108],{"type":45,"value":160},{"type":39,"tag":108,"props":1110,"children":1111},{"class":110,"line":316},[1112],{"type":39,"tag":108,"props":1113,"children":1114},{"style":121},[1115],{"type":45,"value":1003},{"type":39,"tag":108,"props":1117,"children":1118},{"class":110,"line":346},[1119,1123,1127],{"type":39,"tag":108,"props":1120,"children":1121},{"style":121},[1122],{"type":45,"value":410},{"type":39,"tag":108,"props":1124,"children":1125},{"style":127},[1126],{"type":45,"value":384},{"type":39,"tag":108,"props":1128,"children":1129},{"style":121},[1130],{"type":45,"value":160},{"type":39,"tag":420,"props":1132,"children":1134},{"id":1133},"creating-organizations-on-behalf-of-users",[1135],{"type":45,"value":1136},"Creating Organizations on Behalf of Users",{"type":39,"tag":606,"props":1138,"children":1139},{},[1140],{"type":45,"value":1141},"Administrators can create organizations for other users (server-side only):",{"type":39,"tag":97,"props":1143,"children":1145},{"className":99,"code":1144,"language":101,"meta":102,"style":102},"await auth.api.createOrganization({\n  body: {\n    name: \"Client Organization\",\n    slug: \"client-org\",\n    userId: \"user-id-who-will-be-owner\", \u002F\u002F `userId` is required\n  },\n});\n",[1146],{"type":39,"tag":58,"props":1147,"children":1148},{"__ignoreMap":102},[1149,1188,1204,1232,1260,1294,1301],{"type":39,"tag":108,"props":1150,"children":1151},{"class":110,"line":111},[1152,1157,1162,1166,1171,1175,1180,1184],{"type":39,"tag":108,"props":1153,"children":1154},{"style":115},[1155],{"type":45,"value":1156},"await",{"type":39,"tag":108,"props":1158,"children":1159},{"style":127},[1160],{"type":45,"value":1161}," auth",{"type":39,"tag":108,"props":1163,"children":1164},{"style":121},[1165],{"type":45,"value":712},{"type":39,"tag":108,"props":1167,"children":1168},{"style":127},[1169],{"type":45,"value":1170},"api",{"type":39,"tag":108,"props":1172,"children":1173},{"style":121},[1174],{"type":45,"value":712},{"type":39,"tag":108,"props":1176,"children":1177},{"style":240},[1178],{"type":45,"value":1179},"createOrganization",{"type":39,"tag":108,"props":1181,"children":1182},{"style":127},[1183],{"type":45,"value":247},{"type":39,"tag":108,"props":1185,"children":1186},{"style":121},[1187],{"type":45,"value":252},{"type":39,"tag":108,"props":1189,"children":1190},{"class":110,"line":163},[1191,1196,1200],{"type":39,"tag":108,"props":1192,"children":1193},{"style":259},[1194],{"type":45,"value":1195},"  body",{"type":39,"tag":108,"props":1197,"children":1198},{"style":121},[1199],{"type":45,"value":267},{"type":39,"tag":108,"props":1201,"children":1202},{"style":121},[1203],{"type":45,"value":662},{"type":39,"tag":108,"props":1205,"children":1206},{"class":110,"line":205},[1207,1211,1215,1219,1224,1228],{"type":39,"tag":108,"props":1208,"children":1209},{"style":259},[1210],{"type":45,"value":742},{"type":39,"tag":108,"props":1212,"children":1213},{"style":121},[1214],{"type":45,"value":267},{"type":39,"tag":108,"props":1216,"children":1217},{"style":121},[1218],{"type":45,"value":145},{"type":39,"tag":108,"props":1220,"children":1221},{"style":148},[1222],{"type":45,"value":1223},"Client Organization",{"type":39,"tag":108,"props":1225,"children":1226},{"style":121},[1227],{"type":45,"value":155},{"type":39,"tag":108,"props":1229,"children":1230},{"style":121},[1231],{"type":45,"value":313},{"type":39,"tag":108,"props":1233,"children":1234},{"class":110,"line":215},[1235,1239,1243,1247,1252,1256],{"type":39,"tag":108,"props":1236,"children":1237},{"style":259},[1238],{"type":45,"value":771},{"type":39,"tag":108,"props":1240,"children":1241},{"style":121},[1242],{"type":45,"value":267},{"type":39,"tag":108,"props":1244,"children":1245},{"style":121},[1246],{"type":45,"value":145},{"type":39,"tag":108,"props":1248,"children":1249},{"style":148},[1250],{"type":45,"value":1251},"client-org",{"type":39,"tag":108,"props":1253,"children":1254},{"style":121},[1255],{"type":45,"value":155},{"type":39,"tag":108,"props":1257,"children":1258},{"style":121},[1259],{"type":45,"value":313},{"type":39,"tag":108,"props":1261,"children":1262},{"class":110,"line":255},[1263,1268,1272,1276,1281,1285,1289],{"type":39,"tag":108,"props":1264,"children":1265},{"style":259},[1266],{"type":45,"value":1267},"    userId",{"type":39,"tag":108,"props":1269,"children":1270},{"style":121},[1271],{"type":45,"value":267},{"type":39,"tag":108,"props":1273,"children":1274},{"style":121},[1275],{"type":45,"value":145},{"type":39,"tag":108,"props":1277,"children":1278},{"style":148},[1279],{"type":45,"value":1280},"user-id-who-will-be-owner",{"type":39,"tag":108,"props":1282,"children":1283},{"style":121},[1284],{"type":45,"value":155},{"type":39,"tag":108,"props":1286,"children":1287},{"style":121},[1288],{"type":45,"value":337},{"type":39,"tag":108,"props":1290,"children":1291},{"style":340},[1292],{"type":45,"value":1293}," \u002F\u002F `userId` is required\n",{"type":39,"tag":108,"props":1295,"children":1296},{"class":110,"line":275},[1297],{"type":39,"tag":108,"props":1298,"children":1299},{"style":121},[1300],{"type":45,"value":1003},{"type":39,"tag":108,"props":1302,"children":1303},{"class":110,"line":292},[1304,1308,1312],{"type":39,"tag":108,"props":1305,"children":1306},{"style":121},[1307],{"type":45,"value":410},{"type":39,"tag":108,"props":1309,"children":1310},{"style":127},[1311],{"type":45,"value":384},{"type":39,"tag":108,"props":1313,"children":1314},{"style":121},[1315],{"type":45,"value":160},{"type":39,"tag":606,"props":1317,"children":1318},{},[1319,1325,1327,1333],{"type":39,"tag":1320,"props":1321,"children":1322},"strong",{},[1323],{"type":45,"value":1324},"Note",{"type":45,"value":1326},": The ",{"type":39,"tag":58,"props":1328,"children":1330},{"className":1329},[],[1331],{"type":45,"value":1332},"userId",{"type":45,"value":1334}," parameter cannot be used alongside session headers.",{"type":39,"tag":40,"props":1336,"children":1338},{"id":1337},"active-organizations",[1339],{"type":45,"value":1340},"Active Organizations",{"type":39,"tag":606,"props":1342,"children":1343},{},[1344],{"type":45,"value":1345},"Stored in the session and scopes subsequent API calls. Set after user selects one.",{"type":39,"tag":97,"props":1347,"children":1349},{"className":99,"code":1348,"language":101,"meta":102,"style":102},"const setActive = async (organizationId: string) => {\n  const { data, error } = await authClient.organization.setActive({\n    organizationId,\n  });\n};\n",[1350],{"type":39,"tag":58,"props":1351,"children":1352},{"__ignoreMap":102},[1353,1404,1468,1480,1495],{"type":39,"tag":108,"props":1354,"children":1355},{"class":110,"line":111},[1356,1360,1365,1369,1373,1377,1382,1386,1392,1396,1400],{"type":39,"tag":108,"props":1357,"children":1358},{"style":224},[1359],{"type":45,"value":633},{"type":39,"tag":108,"props":1361,"children":1362},{"style":127},[1363],{"type":45,"value":1364}," setActive ",{"type":39,"tag":108,"props":1366,"children":1367},{"style":121},[1368],{"type":45,"value":237},{"type":39,"tag":108,"props":1370,"children":1371},{"style":224},[1372],{"type":45,"value":647},{"type":39,"tag":108,"props":1374,"children":1375},{"style":121},[1376],{"type":45,"value":942},{"type":39,"tag":108,"props":1378,"children":1379},{"style":945},[1380],{"type":45,"value":1381},"organizationId",{"type":39,"tag":108,"props":1383,"children":1384},{"style":121},[1385],{"type":45,"value":267},{"type":39,"tag":108,"props":1387,"children":1389},{"style":1388},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[1390],{"type":45,"value":1391}," string",{"type":39,"tag":108,"props":1393,"children":1394},{"style":121},[1395],{"type":45,"value":384},{"type":39,"tag":108,"props":1397,"children":1398},{"style":224},[1399],{"type":45,"value":657},{"type":39,"tag":108,"props":1401,"children":1402},{"style":121},[1403],{"type":45,"value":662},{"type":39,"tag":108,"props":1405,"children":1406},{"class":110,"line":163},[1407,1411,1415,1419,1423,1427,1431,1435,1439,1443,1447,1451,1455,1460,1464],{"type":39,"tag":108,"props":1408,"children":1409},{"style":224},[1410],{"type":45,"value":670},{"type":39,"tag":108,"props":1412,"children":1413},{"style":121},[1414],{"type":45,"value":124},{"type":39,"tag":108,"props":1416,"children":1417},{"style":127},[1418],{"type":45,"value":679},{"type":39,"tag":108,"props":1420,"children":1421},{"style":121},[1422],{"type":45,"value":337},{"type":39,"tag":108,"props":1424,"children":1425},{"style":127},[1426],{"type":45,"value":688},{"type":39,"tag":108,"props":1428,"children":1429},{"style":121},[1430],{"type":45,"value":135},{"type":39,"tag":108,"props":1432,"children":1433},{"style":121},[1434],{"type":45,"value":697},{"type":39,"tag":108,"props":1436,"children":1437},{"style":115},[1438],{"type":45,"value":702},{"type":39,"tag":108,"props":1440,"children":1441},{"style":127},[1442],{"type":45,"value":707},{"type":39,"tag":108,"props":1444,"children":1445},{"style":121},[1446],{"type":45,"value":712},{"type":39,"tag":108,"props":1448,"children":1449},{"style":127},[1450],{"type":45,"value":717},{"type":39,"tag":108,"props":1452,"children":1453},{"style":121},[1454],{"type":45,"value":712},{"type":39,"tag":108,"props":1456,"children":1457},{"style":240},[1458],{"type":45,"value":1459},"setActive",{"type":39,"tag":108,"props":1461,"children":1462},{"style":259},[1463],{"type":45,"value":247},{"type":39,"tag":108,"props":1465,"children":1466},{"style":121},[1467],{"type":45,"value":252},{"type":39,"tag":108,"props":1469,"children":1470},{"class":110,"line":205},[1471,1476],{"type":39,"tag":108,"props":1472,"children":1473},{"style":127},[1474],{"type":45,"value":1475},"    organizationId",{"type":39,"tag":108,"props":1477,"children":1478},{"style":121},[1479],{"type":45,"value":313},{"type":39,"tag":108,"props":1481,"children":1482},{"class":110,"line":215},[1483,1487,1491],{"type":39,"tag":108,"props":1484,"children":1485},{"style":121},[1486],{"type":45,"value":872},{"type":39,"tag":108,"props":1488,"children":1489},{"style":259},[1490],{"type":45,"value":384},{"type":39,"tag":108,"props":1492,"children":1493},{"style":121},[1494],{"type":45,"value":160},{"type":39,"tag":108,"props":1496,"children":1497},{"class":110,"line":255},[1498],{"type":39,"tag":108,"props":1499,"children":1500},{"style":121},[1501],{"type":45,"value":888},{"type":39,"tag":606,"props":1503,"children":1504},{},[1505,1507,1512,1514,1520,1522,1528,1529,1535],{"type":45,"value":1506},"Many endpoints use the active organization when ",{"type":39,"tag":58,"props":1508,"children":1510},{"className":1509},[],[1511],{"type":45,"value":1381},{"type":45,"value":1513}," is not provided (",{"type":39,"tag":58,"props":1515,"children":1517},{"className":1516},[],[1518],{"type":45,"value":1519},"listMembers",{"type":45,"value":1521},", ",{"type":39,"tag":58,"props":1523,"children":1525},{"className":1524},[],[1526],{"type":45,"value":1527},"listInvitations",{"type":45,"value":1521},{"type":39,"tag":58,"props":1530,"children":1532},{"className":1531},[],[1533],{"type":45,"value":1534},"inviteMember",{"type":45,"value":1536},", etc.).",{"type":39,"tag":606,"props":1538,"children":1539},{},[1540,1542,1548],{"type":45,"value":1541},"Use ",{"type":39,"tag":58,"props":1543,"children":1545},{"className":1544},[],[1546],{"type":45,"value":1547},"getFullOrganization()",{"type":45,"value":1549}," to retrieve the active org with all members, invitations, and teams.",{"type":39,"tag":40,"props":1551,"children":1553},{"id":1552},"members",[1554],{"type":45,"value":1555},"Members",{"type":39,"tag":420,"props":1557,"children":1559},{"id":1558},"adding-members-server-side",[1560],{"type":45,"value":1561},"Adding Members (Server-Side)",{"type":39,"tag":97,"props":1563,"children":1565},{"className":99,"code":1564,"language":101,"meta":102,"style":102},"await auth.api.addMember({\n  body: {\n    userId: \"user-id\",\n    role: \"member\",\n    organizationId: \"org-id\",\n  },\n});\n",[1566],{"type":39,"tag":58,"props":1567,"children":1568},{"__ignoreMap":102},[1569,1605,1620,1648,1677,1705,1712],{"type":39,"tag":108,"props":1570,"children":1571},{"class":110,"line":111},[1572,1576,1580,1584,1588,1592,1597,1601],{"type":39,"tag":108,"props":1573,"children":1574},{"style":115},[1575],{"type":45,"value":1156},{"type":39,"tag":108,"props":1577,"children":1578},{"style":127},[1579],{"type":45,"value":1161},{"type":39,"tag":108,"props":1581,"children":1582},{"style":121},[1583],{"type":45,"value":712},{"type":39,"tag":108,"props":1585,"children":1586},{"style":127},[1587],{"type":45,"value":1170},{"type":39,"tag":108,"props":1589,"children":1590},{"style":121},[1591],{"type":45,"value":712},{"type":39,"tag":108,"props":1593,"children":1594},{"style":240},[1595],{"type":45,"value":1596},"addMember",{"type":39,"tag":108,"props":1598,"children":1599},{"style":127},[1600],{"type":45,"value":247},{"type":39,"tag":108,"props":1602,"children":1603},{"style":121},[1604],{"type":45,"value":252},{"type":39,"tag":108,"props":1606,"children":1607},{"class":110,"line":163},[1608,1612,1616],{"type":39,"tag":108,"props":1609,"children":1610},{"style":259},[1611],{"type":45,"value":1195},{"type":39,"tag":108,"props":1613,"children":1614},{"style":121},[1615],{"type":45,"value":267},{"type":39,"tag":108,"props":1617,"children":1618},{"style":121},[1619],{"type":45,"value":662},{"type":39,"tag":108,"props":1621,"children":1622},{"class":110,"line":205},[1623,1627,1631,1635,1640,1644],{"type":39,"tag":108,"props":1624,"children":1625},{"style":259},[1626],{"type":45,"value":1267},{"type":39,"tag":108,"props":1628,"children":1629},{"style":121},[1630],{"type":45,"value":267},{"type":39,"tag":108,"props":1632,"children":1633},{"style":121},[1634],{"type":45,"value":145},{"type":39,"tag":108,"props":1636,"children":1637},{"style":148},[1638],{"type":45,"value":1639},"user-id",{"type":39,"tag":108,"props":1641,"children":1642},{"style":121},[1643],{"type":45,"value":155},{"type":39,"tag":108,"props":1645,"children":1646},{"style":121},[1647],{"type":45,"value":313},{"type":39,"tag":108,"props":1649,"children":1650},{"class":110,"line":215},[1651,1656,1660,1664,1669,1673],{"type":39,"tag":108,"props":1652,"children":1653},{"style":259},[1654],{"type":45,"value":1655},"    role",{"type":39,"tag":108,"props":1657,"children":1658},{"style":121},[1659],{"type":45,"value":267},{"type":39,"tag":108,"props":1661,"children":1662},{"style":121},[1663],{"type":45,"value":145},{"type":39,"tag":108,"props":1665,"children":1666},{"style":148},[1667],{"type":45,"value":1668},"member",{"type":39,"tag":108,"props":1670,"children":1671},{"style":121},[1672],{"type":45,"value":155},{"type":39,"tag":108,"props":1674,"children":1675},{"style":121},[1676],{"type":45,"value":313},{"type":39,"tag":108,"props":1678,"children":1679},{"class":110,"line":255},[1680,1684,1688,1692,1697,1701],{"type":39,"tag":108,"props":1681,"children":1682},{"style":259},[1683],{"type":45,"value":1475},{"type":39,"tag":108,"props":1685,"children":1686},{"style":121},[1687],{"type":45,"value":267},{"type":39,"tag":108,"props":1689,"children":1690},{"style":121},[1691],{"type":45,"value":145},{"type":39,"tag":108,"props":1693,"children":1694},{"style":148},[1695],{"type":45,"value":1696},"org-id",{"type":39,"tag":108,"props":1698,"children":1699},{"style":121},[1700],{"type":45,"value":155},{"type":39,"tag":108,"props":1702,"children":1703},{"style":121},[1704],{"type":45,"value":313},{"type":39,"tag":108,"props":1706,"children":1707},{"class":110,"line":275},[1708],{"type":39,"tag":108,"props":1709,"children":1710},{"style":121},[1711],{"type":45,"value":1003},{"type":39,"tag":108,"props":1713,"children":1714},{"class":110,"line":292},[1715,1719,1723],{"type":39,"tag":108,"props":1716,"children":1717},{"style":121},[1718],{"type":45,"value":410},{"type":39,"tag":108,"props":1720,"children":1721},{"style":127},[1722],{"type":45,"value":384},{"type":39,"tag":108,"props":1724,"children":1725},{"style":121},[1726],{"type":45,"value":160},{"type":39,"tag":606,"props":1728,"children":1729},{},[1730],{"type":45,"value":1731},"For client-side member additions, use the invitation system instead.",{"type":39,"tag":420,"props":1733,"children":1735},{"id":1734},"assigning-multiple-roles",[1736],{"type":45,"value":1737},"Assigning Multiple Roles",{"type":39,"tag":97,"props":1739,"children":1741},{"className":99,"code":1740,"language":101,"meta":102,"style":102},"await auth.api.addMember({\n  body: {\n    userId: \"user-id\",\n    role: [\"admin\", \"moderator\"],\n    organizationId: \"org-id\",\n  },\n});\n",[1742],{"type":39,"tag":58,"props":1743,"children":1744},{"__ignoreMap":102},[1745,1780,1795,1822,1876,1903,1910],{"type":39,"tag":108,"props":1746,"children":1747},{"class":110,"line":111},[1748,1752,1756,1760,1764,1768,1772,1776],{"type":39,"tag":108,"props":1749,"children":1750},{"style":115},[1751],{"type":45,"value":1156},{"type":39,"tag":108,"props":1753,"children":1754},{"style":127},[1755],{"type":45,"value":1161},{"type":39,"tag":108,"props":1757,"children":1758},{"style":121},[1759],{"type":45,"value":712},{"type":39,"tag":108,"props":1761,"children":1762},{"style":127},[1763],{"type":45,"value":1170},{"type":39,"tag":108,"props":1765,"children":1766},{"style":121},[1767],{"type":45,"value":712},{"type":39,"tag":108,"props":1769,"children":1770},{"style":240},[1771],{"type":45,"value":1596},{"type":39,"tag":108,"props":1773,"children":1774},{"style":127},[1775],{"type":45,"value":247},{"type":39,"tag":108,"props":1777,"children":1778},{"style":121},[1779],{"type":45,"value":252},{"type":39,"tag":108,"props":1781,"children":1782},{"class":110,"line":163},[1783,1787,1791],{"type":39,"tag":108,"props":1784,"children":1785},{"style":259},[1786],{"type":45,"value":1195},{"type":39,"tag":108,"props":1788,"children":1789},{"style":121},[1790],{"type":45,"value":267},{"type":39,"tag":108,"props":1792,"children":1793},{"style":121},[1794],{"type":45,"value":662},{"type":39,"tag":108,"props":1796,"children":1797},{"class":110,"line":205},[1798,1802,1806,1810,1814,1818],{"type":39,"tag":108,"props":1799,"children":1800},{"style":259},[1801],{"type":45,"value":1267},{"type":39,"tag":108,"props":1803,"children":1804},{"style":121},[1805],{"type":45,"value":267},{"type":39,"tag":108,"props":1807,"children":1808},{"style":121},[1809],{"type":45,"value":145},{"type":39,"tag":108,"props":1811,"children":1812},{"style":148},[1813],{"type":45,"value":1639},{"type":39,"tag":108,"props":1815,"children":1816},{"style":121},[1817],{"type":45,"value":155},{"type":39,"tag":108,"props":1819,"children":1820},{"style":121},[1821],{"type":45,"value":313},{"type":39,"tag":108,"props":1823,"children":1824},{"class":110,"line":215},[1825,1829,1833,1837,1841,1846,1850,1854,1858,1863,1867,1872],{"type":39,"tag":108,"props":1826,"children":1827},{"style":259},[1828],{"type":45,"value":1655},{"type":39,"tag":108,"props":1830,"children":1831},{"style":121},[1832],{"type":45,"value":267},{"type":39,"tag":108,"props":1834,"children":1835},{"style":127},[1836],{"type":45,"value":569},{"type":39,"tag":108,"props":1838,"children":1839},{"style":121},[1840],{"type":45,"value":155},{"type":39,"tag":108,"props":1842,"children":1843},{"style":148},[1844],{"type":45,"value":1845},"admin",{"type":39,"tag":108,"props":1847,"children":1848},{"style":121},[1849],{"type":45,"value":155},{"type":39,"tag":108,"props":1851,"children":1852},{"style":121},[1853],{"type":45,"value":337},{"type":39,"tag":108,"props":1855,"children":1856},{"style":121},[1857],{"type":45,"value":145},{"type":39,"tag":108,"props":1859,"children":1860},{"style":148},[1861],{"type":45,"value":1862},"moderator",{"type":39,"tag":108,"props":1864,"children":1865},{"style":121},[1866],{"type":45,"value":155},{"type":39,"tag":108,"props":1868,"children":1869},{"style":127},[1870],{"type":45,"value":1871},"]",{"type":39,"tag":108,"props":1873,"children":1874},{"style":121},[1875],{"type":45,"value":313},{"type":39,"tag":108,"props":1877,"children":1878},{"class":110,"line":255},[1879,1883,1887,1891,1895,1899],{"type":39,"tag":108,"props":1880,"children":1881},{"style":259},[1882],{"type":45,"value":1475},{"type":39,"tag":108,"props":1884,"children":1885},{"style":121},[1886],{"type":45,"value":267},{"type":39,"tag":108,"props":1888,"children":1889},{"style":121},[1890],{"type":45,"value":145},{"type":39,"tag":108,"props":1892,"children":1893},{"style":148},[1894],{"type":45,"value":1696},{"type":39,"tag":108,"props":1896,"children":1897},{"style":121},[1898],{"type":45,"value":155},{"type":39,"tag":108,"props":1900,"children":1901},{"style":121},[1902],{"type":45,"value":313},{"type":39,"tag":108,"props":1904,"children":1905},{"class":110,"line":275},[1906],{"type":39,"tag":108,"props":1907,"children":1908},{"style":121},[1909],{"type":45,"value":1003},{"type":39,"tag":108,"props":1911,"children":1912},{"class":110,"line":292},[1913,1917,1921],{"type":39,"tag":108,"props":1914,"children":1915},{"style":121},[1916],{"type":45,"value":410},{"type":39,"tag":108,"props":1918,"children":1919},{"style":127},[1920],{"type":45,"value":384},{"type":39,"tag":108,"props":1922,"children":1923},{"style":121},[1924],{"type":45,"value":160},{"type":39,"tag":420,"props":1926,"children":1928},{"id":1927},"removing-members",[1929],{"type":45,"value":1930},"Removing Members",{"type":39,"tag":606,"props":1932,"children":1933},{},[1934,1935,1941],{"type":45,"value":1541},{"type":39,"tag":58,"props":1936,"children":1938},{"className":1937},[],[1939],{"type":45,"value":1940},"removeMember({ memberIdOrEmail })",{"type":45,"value":1942},". The last owner cannot be removed — assign ownership to another member first.",{"type":39,"tag":420,"props":1944,"children":1946},{"id":1945},"updating-member-roles",[1947],{"type":45,"value":1948},"Updating Member Roles",{"type":39,"tag":606,"props":1950,"children":1951},{},[1952,1953,1959],{"type":45,"value":1541},{"type":39,"tag":58,"props":1954,"children":1956},{"className":1955},[],[1957],{"type":45,"value":1958},"updateMemberRole({ memberId, role })",{"type":45,"value":712},{"type":39,"tag":420,"props":1961,"children":1963},{"id":1962},"membership-limits",[1964],{"type":45,"value":1965},"Membership Limits",{"type":39,"tag":97,"props":1967,"children":1969},{"className":99,"code":1968,"language":101,"meta":102,"style":102},"organization({\n  membershipLimit: async (user, organization) => {\n    if (organization.metadata?.plan === \"enterprise\") {\n      return 1000;\n    }\n    return 50;\n  },\n});\n",[1970],{"type":39,"tag":58,"props":1971,"children":1972},{"__ignoreMap":102},[1973,1988,2032,2092,2109,2117,2133,2140],{"type":39,"tag":108,"props":1974,"children":1975},{"class":110,"line":111},[1976,1980,1984],{"type":39,"tag":108,"props":1977,"children":1978},{"style":240},[1979],{"type":45,"value":717},{"type":39,"tag":108,"props":1981,"children":1982},{"style":127},[1983],{"type":45,"value":247},{"type":39,"tag":108,"props":1985,"children":1986},{"style":121},[1987],{"type":45,"value":252},{"type":39,"tag":108,"props":1989,"children":1990},{"class":110,"line":163},[1991,1996,2000,2004,2008,2012,2016,2020,2024,2028],{"type":39,"tag":108,"props":1992,"children":1993},{"style":240},[1994],{"type":45,"value":1995},"  membershipLimit",{"type":39,"tag":108,"props":1997,"children":1998},{"style":121},[1999],{"type":45,"value":267},{"type":39,"tag":108,"props":2001,"children":2002},{"style":224},[2003],{"type":45,"value":647},{"type":39,"tag":108,"props":2005,"children":2006},{"style":121},[2007],{"type":45,"value":942},{"type":39,"tag":108,"props":2009,"children":2010},{"style":945},[2011],{"type":45,"value":948},{"type":39,"tag":108,"props":2013,"children":2014},{"style":121},[2015],{"type":45,"value":337},{"type":39,"tag":108,"props":2017,"children":2018},{"style":945},[2019],{"type":45,"value":177},{"type":39,"tag":108,"props":2021,"children":2022},{"style":121},[2023],{"type":45,"value":384},{"type":39,"tag":108,"props":2025,"children":2026},{"style":224},[2027],{"type":45,"value":657},{"type":39,"tag":108,"props":2029,"children":2030},{"style":121},[2031],{"type":45,"value":662},{"type":39,"tag":108,"props":2033,"children":2034},{"class":110,"line":205},[2035,2040,2044,2048,2052,2057,2062,2066,2070,2074,2079,2083,2088],{"type":39,"tag":108,"props":2036,"children":2037},{"style":115},[2038],{"type":45,"value":2039},"    if",{"type":39,"tag":108,"props":2041,"children":2042},{"style":259},[2043],{"type":45,"value":942},{"type":39,"tag":108,"props":2045,"children":2046},{"style":127},[2047],{"type":45,"value":717},{"type":39,"tag":108,"props":2049,"children":2050},{"style":121},[2051],{"type":45,"value":712},{"type":39,"tag":108,"props":2053,"children":2054},{"style":127},[2055],{"type":45,"value":2056},"metadata",{"type":39,"tag":108,"props":2058,"children":2059},{"style":121},[2060],{"type":45,"value":2061},"?.",{"type":39,"tag":108,"props":2063,"children":2064},{"style":127},[2065],{"type":45,"value":1067},{"type":39,"tag":108,"props":2067,"children":2068},{"style":121},[2069],{"type":45,"value":987},{"type":39,"tag":108,"props":2071,"children":2072},{"style":121},[2073],{"type":45,"value":145},{"type":39,"tag":108,"props":2075,"children":2076},{"style":148},[2077],{"type":45,"value":2078},"enterprise",{"type":39,"tag":108,"props":2080,"children":2081},{"style":121},[2082],{"type":45,"value":155},{"type":39,"tag":108,"props":2084,"children":2085},{"style":259},[2086],{"type":45,"value":2087},") ",{"type":39,"tag":108,"props":2089,"children":2090},{"style":121},[2091],{"type":45,"value":252},{"type":39,"tag":108,"props":2093,"children":2094},{"class":110,"line":215},[2095,2100,2105],{"type":39,"tag":108,"props":2096,"children":2097},{"style":115},[2098],{"type":45,"value":2099},"      return",{"type":39,"tag":108,"props":2101,"children":2102},{"style":329},[2103],{"type":45,"value":2104}," 1000",{"type":39,"tag":108,"props":2106,"children":2107},{"style":121},[2108],{"type":45,"value":160},{"type":39,"tag":108,"props":2110,"children":2111},{"class":110,"line":255},[2112],{"type":39,"tag":108,"props":2113,"children":2114},{"style":121},[2115],{"type":45,"value":2116},"    }\n",{"type":39,"tag":108,"props":2118,"children":2119},{"class":110,"line":275},[2120,2124,2129],{"type":39,"tag":108,"props":2121,"children":2122},{"style":115},[2123],{"type":45,"value":968},{"type":39,"tag":108,"props":2125,"children":2126},{"style":329},[2127],{"type":45,"value":2128}," 50",{"type":39,"tag":108,"props":2130,"children":2131},{"style":121},[2132],{"type":45,"value":160},{"type":39,"tag":108,"props":2134,"children":2135},{"class":110,"line":292},[2136],{"type":39,"tag":108,"props":2137,"children":2138},{"style":121},[2139],{"type":45,"value":1003},{"type":39,"tag":108,"props":2141,"children":2142},{"class":110,"line":316},[2143,2147,2151],{"type":39,"tag":108,"props":2144,"children":2145},{"style":121},[2146],{"type":45,"value":410},{"type":39,"tag":108,"props":2148,"children":2149},{"style":127},[2150],{"type":45,"value":384},{"type":39,"tag":108,"props":2152,"children":2153},{"style":121},[2154],{"type":45,"value":160},{"type":39,"tag":40,"props":2156,"children":2158},{"id":2157},"invitations",[2159],{"type":45,"value":2160},"Invitations",{"type":39,"tag":420,"props":2162,"children":2164},{"id":2163},"setting-up-invitation-emails",[2165],{"type":45,"value":2166},"Setting Up Invitation Emails",{"type":39,"tag":97,"props":2168,"children":2170},{"className":99,"code":2169,"language":101,"meta":102,"style":102},"import { betterAuth } from \"better-auth\";\nimport { organization } from \"better-auth\u002Fplugins\";\nimport { sendEmail } from \".\u002Femail\";\n\nexport const auth = betterAuth({\n  plugins: [\n    organization({\n      sendInvitationEmail: async (data) => {\n        const { email, organization, inviter, invitation } = data;\n\n        await sendEmail({\n          to: email,\n          subject: `Join ${organization.name}`,\n          html: `\n            \u003Cp>${inviter.user.name} invited you to join ${organization.name}\u003C\u002Fp>\n            \u003Ca href=\"https:\u002F\u002Fyourapp.com\u002Faccept-invite?id=${invitation.id}\">\n              Accept Invitation\n            \u003C\u002Fa>\n          `,\n        });\n      },\n    }),\n  ],\n});\n",[2171],{"type":39,"tag":58,"props":2172,"children":2173},{"__ignoreMap":102},[2174,2213,2252,2293,2300,2331,2346,2361,2398,2457,2464,2484,2504,2554,2572,2640,2676,2685,2694,2707,2724,2733,2749,2761],{"type":39,"tag":108,"props":2175,"children":2176},{"class":110,"line":111},[2177,2181,2185,2189,2193,2197,2201,2205,2209],{"type":39,"tag":108,"props":2178,"children":2179},{"style":115},[2180],{"type":45,"value":118},{"type":39,"tag":108,"props":2182,"children":2183},{"style":121},[2184],{"type":45,"value":124},{"type":39,"tag":108,"props":2186,"children":2187},{"style":127},[2188],{"type":45,"value":130},{"type":39,"tag":108,"props":2190,"children":2191},{"style":121},[2192],{"type":45,"value":135},{"type":39,"tag":108,"props":2194,"children":2195},{"style":115},[2196],{"type":45,"value":140},{"type":39,"tag":108,"props":2198,"children":2199},{"style":121},[2200],{"type":45,"value":145},{"type":39,"tag":108,"props":2202,"children":2203},{"style":148},[2204],{"type":45,"value":8},{"type":39,"tag":108,"props":2206,"children":2207},{"style":121},[2208],{"type":45,"value":155},{"type":39,"tag":108,"props":2210,"children":2211},{"style":121},[2212],{"type":45,"value":160},{"type":39,"tag":108,"props":2214,"children":2215},{"class":110,"line":163},[2216,2220,2224,2228,2232,2236,2240,2244,2248],{"type":39,"tag":108,"props":2217,"children":2218},{"style":115},[2219],{"type":45,"value":118},{"type":39,"tag":108,"props":2221,"children":2222},{"style":121},[2223],{"type":45,"value":124},{"type":39,"tag":108,"props":2225,"children":2226},{"style":127},[2227],{"type":45,"value":177},{"type":39,"tag":108,"props":2229,"children":2230},{"style":121},[2231],{"type":45,"value":135},{"type":39,"tag":108,"props":2233,"children":2234},{"style":115},[2235],{"type":45,"value":140},{"type":39,"tag":108,"props":2237,"children":2238},{"style":121},[2239],{"type":45,"value":145},{"type":39,"tag":108,"props":2241,"children":2242},{"style":148},[2243],{"type":45,"value":194},{"type":39,"tag":108,"props":2245,"children":2246},{"style":121},[2247],{"type":45,"value":155},{"type":39,"tag":108,"props":2249,"children":2250},{"style":121},[2251],{"type":45,"value":160},{"type":39,"tag":108,"props":2253,"children":2254},{"class":110,"line":205},[2255,2259,2263,2268,2272,2276,2280,2285,2289],{"type":39,"tag":108,"props":2256,"children":2257},{"style":115},[2258],{"type":45,"value":118},{"type":39,"tag":108,"props":2260,"children":2261},{"style":121},[2262],{"type":45,"value":124},{"type":39,"tag":108,"props":2264,"children":2265},{"style":127},[2266],{"type":45,"value":2267}," sendEmail",{"type":39,"tag":108,"props":2269,"children":2270},{"style":121},[2271],{"type":45,"value":135},{"type":39,"tag":108,"props":2273,"children":2274},{"style":115},[2275],{"type":45,"value":140},{"type":39,"tag":108,"props":2277,"children":2278},{"style":121},[2279],{"type":45,"value":145},{"type":39,"tag":108,"props":2281,"children":2282},{"style":148},[2283],{"type":45,"value":2284},".\u002Femail",{"type":39,"tag":108,"props":2286,"children":2287},{"style":121},[2288],{"type":45,"value":155},{"type":39,"tag":108,"props":2290,"children":2291},{"style":121},[2292],{"type":45,"value":160},{"type":39,"tag":108,"props":2294,"children":2295},{"class":110,"line":215},[2296],{"type":39,"tag":108,"props":2297,"children":2298},{"emptyLinePlaceholder":209},[2299],{"type":45,"value":212},{"type":39,"tag":108,"props":2301,"children":2302},{"class":110,"line":255},[2303,2307,2311,2315,2319,2323,2327],{"type":39,"tag":108,"props":2304,"children":2305},{"style":115},[2306],{"type":45,"value":221},{"type":39,"tag":108,"props":2308,"children":2309},{"style":224},[2310],{"type":45,"value":227},{"type":39,"tag":108,"props":2312,"children":2313},{"style":127},[2314],{"type":45,"value":232},{"type":39,"tag":108,"props":2316,"children":2317},{"style":121},[2318],{"type":45,"value":237},{"type":39,"tag":108,"props":2320,"children":2321},{"style":240},[2322],{"type":45,"value":130},{"type":39,"tag":108,"props":2324,"children":2325},{"style":127},[2326],{"type":45,"value":247},{"type":39,"tag":108,"props":2328,"children":2329},{"style":121},[2330],{"type":45,"value":252},{"type":39,"tag":108,"props":2332,"children":2333},{"class":110,"line":275},[2334,2338,2342],{"type":39,"tag":108,"props":2335,"children":2336},{"style":259},[2337],{"type":45,"value":262},{"type":39,"tag":108,"props":2339,"children":2340},{"style":121},[2341],{"type":45,"value":267},{"type":39,"tag":108,"props":2343,"children":2344},{"style":127},[2345],{"type":45,"value":272},{"type":39,"tag":108,"props":2347,"children":2348},{"class":110,"line":292},[2349,2353,2357],{"type":39,"tag":108,"props":2350,"children":2351},{"style":240},[2352],{"type":45,"value":281},{"type":39,"tag":108,"props":2354,"children":2355},{"style":127},[2356],{"type":45,"value":247},{"type":39,"tag":108,"props":2358,"children":2359},{"style":121},[2360],{"type":45,"value":252},{"type":39,"tag":108,"props":2362,"children":2363},{"class":110,"line":316},[2364,2369,2373,2377,2381,2386,2390,2394],{"type":39,"tag":108,"props":2365,"children":2366},{"style":240},[2367],{"type":45,"value":2368},"      sendInvitationEmail",{"type":39,"tag":108,"props":2370,"children":2371},{"style":121},[2372],{"type":45,"value":267},{"type":39,"tag":108,"props":2374,"children":2375},{"style":224},[2376],{"type":45,"value":647},{"type":39,"tag":108,"props":2378,"children":2379},{"style":121},[2380],{"type":45,"value":942},{"type":39,"tag":108,"props":2382,"children":2383},{"style":945},[2384],{"type":45,"value":2385},"data",{"type":39,"tag":108,"props":2387,"children":2388},{"style":121},[2389],{"type":45,"value":384},{"type":39,"tag":108,"props":2391,"children":2392},{"style":224},[2393],{"type":45,"value":657},{"type":39,"tag":108,"props":2395,"children":2396},{"style":121},[2397],{"type":45,"value":662},{"type":39,"tag":108,"props":2399,"children":2400},{"class":110,"line":346},[2401,2406,2410,2415,2419,2423,2427,2432,2436,2441,2445,2449,2453],{"type":39,"tag":108,"props":2402,"children":2403},{"style":224},[2404],{"type":45,"value":2405},"        const",{"type":39,"tag":108,"props":2407,"children":2408},{"style":121},[2409],{"type":45,"value":124},{"type":39,"tag":108,"props":2411,"children":2412},{"style":127},[2413],{"type":45,"value":2414}," email",{"type":39,"tag":108,"props":2416,"children":2417},{"style":121},[2418],{"type":45,"value":337},{"type":39,"tag":108,"props":2420,"children":2421},{"style":127},[2422],{"type":45,"value":177},{"type":39,"tag":108,"props":2424,"children":2425},{"style":121},[2426],{"type":45,"value":337},{"type":39,"tag":108,"props":2428,"children":2429},{"style":127},[2430],{"type":45,"value":2431}," inviter",{"type":39,"tag":108,"props":2433,"children":2434},{"style":121},[2435],{"type":45,"value":337},{"type":39,"tag":108,"props":2437,"children":2438},{"style":127},[2439],{"type":45,"value":2440}," invitation",{"type":39,"tag":108,"props":2442,"children":2443},{"style":121},[2444],{"type":45,"value":135},{"type":39,"tag":108,"props":2446,"children":2447},{"style":121},[2448],{"type":45,"value":697},{"type":39,"tag":108,"props":2450,"children":2451},{"style":127},[2452],{"type":45,"value":679},{"type":39,"tag":108,"props":2454,"children":2455},{"style":121},[2456],{"type":45,"value":160},{"type":39,"tag":108,"props":2458,"children":2459},{"class":110,"line":373},[2460],{"type":39,"tag":108,"props":2461,"children":2462},{"emptyLinePlaceholder":209},[2463],{"type":45,"value":212},{"type":39,"tag":108,"props":2465,"children":2466},{"class":110,"line":391},[2467,2472,2476,2480],{"type":39,"tag":108,"props":2468,"children":2469},{"style":115},[2470],{"type":45,"value":2471},"        await",{"type":39,"tag":108,"props":2473,"children":2474},{"style":240},[2475],{"type":45,"value":2267},{"type":39,"tag":108,"props":2477,"children":2478},{"style":259},[2479],{"type":45,"value":247},{"type":39,"tag":108,"props":2481,"children":2482},{"style":121},[2483],{"type":45,"value":252},{"type":39,"tag":108,"props":2485,"children":2486},{"class":110,"line":404},[2487,2492,2496,2500],{"type":39,"tag":108,"props":2488,"children":2489},{"style":259},[2490],{"type":45,"value":2491},"          to",{"type":39,"tag":108,"props":2493,"children":2494},{"style":121},[2495],{"type":45,"value":267},{"type":39,"tag":108,"props":2497,"children":2498},{"style":127},[2499],{"type":45,"value":2414},{"type":39,"tag":108,"props":2501,"children":2502},{"style":121},[2503],{"type":45,"value":313},{"type":39,"tag":108,"props":2505,"children":2507},{"class":110,"line":2506},13,[2508,2513,2517,2522,2527,2532,2536,2540,2545,2550],{"type":39,"tag":108,"props":2509,"children":2510},{"style":259},[2511],{"type":45,"value":2512},"          subject",{"type":39,"tag":108,"props":2514,"children":2515},{"style":121},[2516],{"type":45,"value":267},{"type":39,"tag":108,"props":2518,"children":2519},{"style":121},[2520],{"type":45,"value":2521}," `",{"type":39,"tag":108,"props":2523,"children":2524},{"style":148},[2525],{"type":45,"value":2526},"Join ",{"type":39,"tag":108,"props":2528,"children":2529},{"style":121},[2530],{"type":45,"value":2531},"${",{"type":39,"tag":108,"props":2533,"children":2534},{"style":127},[2535],{"type":45,"value":717},{"type":39,"tag":108,"props":2537,"children":2538},{"style":121},[2539],{"type":45,"value":712},{"type":39,"tag":108,"props":2541,"children":2542},{"style":127},[2543],{"type":45,"value":2544},"name",{"type":39,"tag":108,"props":2546,"children":2547},{"style":121},[2548],{"type":45,"value":2549},"}`",{"type":39,"tag":108,"props":2551,"children":2552},{"style":121},[2553],{"type":45,"value":313},{"type":39,"tag":108,"props":2555,"children":2557},{"class":110,"line":2556},14,[2558,2563,2567],{"type":39,"tag":108,"props":2559,"children":2560},{"style":259},[2561],{"type":45,"value":2562},"          html",{"type":39,"tag":108,"props":2564,"children":2565},{"style":121},[2566],{"type":45,"value":267},{"type":39,"tag":108,"props":2568,"children":2569},{"style":121},[2570],{"type":45,"value":2571}," `\n",{"type":39,"tag":108,"props":2573,"children":2575},{"class":110,"line":2574},15,[2576,2581,2585,2590,2594,2598,2602,2606,2610,2615,2619,2623,2627,2631,2635],{"type":39,"tag":108,"props":2577,"children":2578},{"style":148},[2579],{"type":45,"value":2580},"            \u003Cp>",{"type":39,"tag":108,"props":2582,"children":2583},{"style":121},[2584],{"type":45,"value":2531},{"type":39,"tag":108,"props":2586,"children":2587},{"style":127},[2588],{"type":45,"value":2589},"inviter",{"type":39,"tag":108,"props":2591,"children":2592},{"style":121},[2593],{"type":45,"value":712},{"type":39,"tag":108,"props":2595,"children":2596},{"style":127},[2597],{"type":45,"value":948},{"type":39,"tag":108,"props":2599,"children":2600},{"style":121},[2601],{"type":45,"value":712},{"type":39,"tag":108,"props":2603,"children":2604},{"style":127},[2605],{"type":45,"value":2544},{"type":39,"tag":108,"props":2607,"children":2608},{"style":121},[2609],{"type":45,"value":410},{"type":39,"tag":108,"props":2611,"children":2612},{"style":148},[2613],{"type":45,"value":2614}," invited you to join ",{"type":39,"tag":108,"props":2616,"children":2617},{"style":121},[2618],{"type":45,"value":2531},{"type":39,"tag":108,"props":2620,"children":2621},{"style":127},[2622],{"type":45,"value":717},{"type":39,"tag":108,"props":2624,"children":2625},{"style":121},[2626],{"type":45,"value":712},{"type":39,"tag":108,"props":2628,"children":2629},{"style":127},[2630],{"type":45,"value":2544},{"type":39,"tag":108,"props":2632,"children":2633},{"style":121},[2634],{"type":45,"value":410},{"type":39,"tag":108,"props":2636,"children":2637},{"style":148},[2638],{"type":45,"value":2639},"\u003C\u002Fp>\n",{"type":39,"tag":108,"props":2641,"children":2643},{"class":110,"line":2642},16,[2644,2649,2653,2658,2662,2667,2671],{"type":39,"tag":108,"props":2645,"children":2646},{"style":148},[2647],{"type":45,"value":2648},"            \u003Ca href=\"https:\u002F\u002Fyourapp.com\u002Faccept-invite?id=",{"type":39,"tag":108,"props":2650,"children":2651},{"style":121},[2652],{"type":45,"value":2531},{"type":39,"tag":108,"props":2654,"children":2655},{"style":127},[2656],{"type":45,"value":2657},"invitation",{"type":39,"tag":108,"props":2659,"children":2660},{"style":121},[2661],{"type":45,"value":712},{"type":39,"tag":108,"props":2663,"children":2664},{"style":127},[2665],{"type":45,"value":2666},"id",{"type":39,"tag":108,"props":2668,"children":2669},{"style":121},[2670],{"type":45,"value":410},{"type":39,"tag":108,"props":2672,"children":2673},{"style":148},[2674],{"type":45,"value":2675},"\">\n",{"type":39,"tag":108,"props":2677,"children":2679},{"class":110,"line":2678},17,[2680],{"type":39,"tag":108,"props":2681,"children":2682},{"style":148},[2683],{"type":45,"value":2684},"              Accept Invitation\n",{"type":39,"tag":108,"props":2686,"children":2688},{"class":110,"line":2687},18,[2689],{"type":39,"tag":108,"props":2690,"children":2691},{"style":148},[2692],{"type":45,"value":2693},"            \u003C\u002Fa>\n",{"type":39,"tag":108,"props":2695,"children":2697},{"class":110,"line":2696},19,[2698,2703],{"type":39,"tag":108,"props":2699,"children":2700},{"style":121},[2701],{"type":45,"value":2702},"          `",{"type":39,"tag":108,"props":2704,"children":2705},{"style":121},[2706],{"type":45,"value":313},{"type":39,"tag":108,"props":2708,"children":2710},{"class":110,"line":2709},20,[2711,2716,2720],{"type":39,"tag":108,"props":2712,"children":2713},{"style":121},[2714],{"type":45,"value":2715},"        }",{"type":39,"tag":108,"props":2717,"children":2718},{"style":259},[2719],{"type":45,"value":384},{"type":39,"tag":108,"props":2721,"children":2722},{"style":121},[2723],{"type":45,"value":160},{"type":39,"tag":108,"props":2725,"children":2727},{"class":110,"line":2726},21,[2728],{"type":39,"tag":108,"props":2729,"children":2730},{"style":121},[2731],{"type":45,"value":2732},"      },\n",{"type":39,"tag":108,"props":2734,"children":2736},{"class":110,"line":2735},22,[2737,2741,2745],{"type":39,"tag":108,"props":2738,"children":2739},{"style":121},[2740],{"type":45,"value":379},{"type":39,"tag":108,"props":2742,"children":2743},{"style":127},[2744],{"type":45,"value":384},{"type":39,"tag":108,"props":2746,"children":2747},{"style":121},[2748],{"type":45,"value":313},{"type":39,"tag":108,"props":2750,"children":2752},{"class":110,"line":2751},23,[2753,2757],{"type":39,"tag":108,"props":2754,"children":2755},{"style":127},[2756],{"type":45,"value":397},{"type":39,"tag":108,"props":2758,"children":2759},{"style":121},[2760],{"type":45,"value":313},{"type":39,"tag":108,"props":2762,"children":2764},{"class":110,"line":2763},24,[2765,2769,2773],{"type":39,"tag":108,"props":2766,"children":2767},{"style":121},[2768],{"type":45,"value":410},{"type":39,"tag":108,"props":2770,"children":2771},{"style":127},[2772],{"type":45,"value":384},{"type":39,"tag":108,"props":2774,"children":2775},{"style":121},[2776],{"type":45,"value":160},{"type":39,"tag":420,"props":2778,"children":2780},{"id":2779},"sending-invitations",[2781],{"type":45,"value":2782},"Sending Invitations",{"type":39,"tag":97,"props":2784,"children":2786},{"className":99,"code":2785,"language":101,"meta":102,"style":102},"await authClient.organization.inviteMember({\n  email: \"newuser@example.com\",\n  role: \"member\",\n});\n",[2787],{"type":39,"tag":58,"props":2788,"children":2789},{"__ignoreMap":102},[2790,2825,2854,2882],{"type":39,"tag":108,"props":2791,"children":2792},{"class":110,"line":111},[2793,2797,2801,2805,2809,2813,2817,2821],{"type":39,"tag":108,"props":2794,"children":2795},{"style":115},[2796],{"type":45,"value":1156},{"type":39,"tag":108,"props":2798,"children":2799},{"style":127},[2800],{"type":45,"value":707},{"type":39,"tag":108,"props":2802,"children":2803},{"style":121},[2804],{"type":45,"value":712},{"type":39,"tag":108,"props":2806,"children":2807},{"style":127},[2808],{"type":45,"value":717},{"type":39,"tag":108,"props":2810,"children":2811},{"style":121},[2812],{"type":45,"value":712},{"type":39,"tag":108,"props":2814,"children":2815},{"style":240},[2816],{"type":45,"value":1534},{"type":39,"tag":108,"props":2818,"children":2819},{"style":127},[2820],{"type":45,"value":247},{"type":39,"tag":108,"props":2822,"children":2823},{"style":121},[2824],{"type":45,"value":252},{"type":39,"tag":108,"props":2826,"children":2827},{"class":110,"line":163},[2828,2833,2837,2841,2846,2850],{"type":39,"tag":108,"props":2829,"children":2830},{"style":259},[2831],{"type":45,"value":2832},"  email",{"type":39,"tag":108,"props":2834,"children":2835},{"style":121},[2836],{"type":45,"value":267},{"type":39,"tag":108,"props":2838,"children":2839},{"style":121},[2840],{"type":45,"value":145},{"type":39,"tag":108,"props":2842,"children":2843},{"style":148},[2844],{"type":45,"value":2845},"newuser@example.com",{"type":39,"tag":108,"props":2847,"children":2848},{"style":121},[2849],{"type":45,"value":155},{"type":39,"tag":108,"props":2851,"children":2852},{"style":121},[2853],{"type":45,"value":313},{"type":39,"tag":108,"props":2855,"children":2856},{"class":110,"line":205},[2857,2862,2866,2870,2874,2878],{"type":39,"tag":108,"props":2858,"children":2859},{"style":259},[2860],{"type":45,"value":2861},"  role",{"type":39,"tag":108,"props":2863,"children":2864},{"style":121},[2865],{"type":45,"value":267},{"type":39,"tag":108,"props":2867,"children":2868},{"style":121},[2869],{"type":45,"value":145},{"type":39,"tag":108,"props":2871,"children":2872},{"style":148},[2873],{"type":45,"value":1668},{"type":39,"tag":108,"props":2875,"children":2876},{"style":121},[2877],{"type":45,"value":155},{"type":39,"tag":108,"props":2879,"children":2880},{"style":121},[2881],{"type":45,"value":313},{"type":39,"tag":108,"props":2883,"children":2884},{"class":110,"line":215},[2885,2889,2893],{"type":39,"tag":108,"props":2886,"children":2887},{"style":121},[2888],{"type":45,"value":410},{"type":39,"tag":108,"props":2890,"children":2891},{"style":127},[2892],{"type":45,"value":384},{"type":39,"tag":108,"props":2894,"children":2895},{"style":121},[2896],{"type":45,"value":160},{"type":39,"tag":420,"props":2898,"children":2900},{"id":2899},"shareable-invitation-urls",[2901],{"type":45,"value":2902},"Shareable Invitation URLs",{"type":39,"tag":97,"props":2904,"children":2906},{"className":99,"code":2905,"language":101,"meta":102,"style":102},"const { data } = await authClient.organization.getInvitationURL({\n  email: \"newuser@example.com\",\n  role: \"member\",\n  callbackURL: \"https:\u002F\u002Fyourapp.com\u002Fdashboard\",\n});\n\n\u002F\u002F Share data.url via any channel\n",[2907],{"type":39,"tag":58,"props":2908,"children":2909},{"__ignoreMap":102},[2910,2967,2994,3021,3050,3065,3072],{"type":39,"tag":108,"props":2911,"children":2912},{"class":110,"line":111},[2913,2917,2921,2926,2930,2934,2938,2942,2946,2950,2954,2959,2963],{"type":39,"tag":108,"props":2914,"children":2915},{"style":224},[2916],{"type":45,"value":633},{"type":39,"tag":108,"props":2918,"children":2919},{"style":121},[2920],{"type":45,"value":124},{"type":39,"tag":108,"props":2922,"children":2923},{"style":127},[2924],{"type":45,"value":2925}," data ",{"type":39,"tag":108,"props":2927,"children":2928},{"style":121},[2929],{"type":45,"value":410},{"type":39,"tag":108,"props":2931,"children":2932},{"style":121},[2933],{"type":45,"value":697},{"type":39,"tag":108,"props":2935,"children":2936},{"style":115},[2937],{"type":45,"value":702},{"type":39,"tag":108,"props":2939,"children":2940},{"style":127},[2941],{"type":45,"value":707},{"type":39,"tag":108,"props":2943,"children":2944},{"style":121},[2945],{"type":45,"value":712},{"type":39,"tag":108,"props":2947,"children":2948},{"style":127},[2949],{"type":45,"value":717},{"type":39,"tag":108,"props":2951,"children":2952},{"style":121},[2953],{"type":45,"value":712},{"type":39,"tag":108,"props":2955,"children":2956},{"style":240},[2957],{"type":45,"value":2958},"getInvitationURL",{"type":39,"tag":108,"props":2960,"children":2961},{"style":127},[2962],{"type":45,"value":247},{"type":39,"tag":108,"props":2964,"children":2965},{"style":121},[2966],{"type":45,"value":252},{"type":39,"tag":108,"props":2968,"children":2969},{"class":110,"line":163},[2970,2974,2978,2982,2986,2990],{"type":39,"tag":108,"props":2971,"children":2972},{"style":259},[2973],{"type":45,"value":2832},{"type":39,"tag":108,"props":2975,"children":2976},{"style":121},[2977],{"type":45,"value":267},{"type":39,"tag":108,"props":2979,"children":2980},{"style":121},[2981],{"type":45,"value":145},{"type":39,"tag":108,"props":2983,"children":2984},{"style":148},[2985],{"type":45,"value":2845},{"type":39,"tag":108,"props":2987,"children":2988},{"style":121},[2989],{"type":45,"value":155},{"type":39,"tag":108,"props":2991,"children":2992},{"style":121},[2993],{"type":45,"value":313},{"type":39,"tag":108,"props":2995,"children":2996},{"class":110,"line":205},[2997,3001,3005,3009,3013,3017],{"type":39,"tag":108,"props":2998,"children":2999},{"style":259},[3000],{"type":45,"value":2861},{"type":39,"tag":108,"props":3002,"children":3003},{"style":121},[3004],{"type":45,"value":267},{"type":39,"tag":108,"props":3006,"children":3007},{"style":121},[3008],{"type":45,"value":145},{"type":39,"tag":108,"props":3010,"children":3011},{"style":148},[3012],{"type":45,"value":1668},{"type":39,"tag":108,"props":3014,"children":3015},{"style":121},[3016],{"type":45,"value":155},{"type":39,"tag":108,"props":3018,"children":3019},{"style":121},[3020],{"type":45,"value":313},{"type":39,"tag":108,"props":3022,"children":3023},{"class":110,"line":215},[3024,3029,3033,3037,3042,3046],{"type":39,"tag":108,"props":3025,"children":3026},{"style":259},[3027],{"type":45,"value":3028},"  callbackURL",{"type":39,"tag":108,"props":3030,"children":3031},{"style":121},[3032],{"type":45,"value":267},{"type":39,"tag":108,"props":3034,"children":3035},{"style":121},[3036],{"type":45,"value":145},{"type":39,"tag":108,"props":3038,"children":3039},{"style":148},[3040],{"type":45,"value":3041},"https:\u002F\u002Fyourapp.com\u002Fdashboard",{"type":39,"tag":108,"props":3043,"children":3044},{"style":121},[3045],{"type":45,"value":155},{"type":39,"tag":108,"props":3047,"children":3048},{"style":121},[3049],{"type":45,"value":313},{"type":39,"tag":108,"props":3051,"children":3052},{"class":110,"line":255},[3053,3057,3061],{"type":39,"tag":108,"props":3054,"children":3055},{"style":121},[3056],{"type":45,"value":410},{"type":39,"tag":108,"props":3058,"children":3059},{"style":127},[3060],{"type":45,"value":384},{"type":39,"tag":108,"props":3062,"children":3063},{"style":121},[3064],{"type":45,"value":160},{"type":39,"tag":108,"props":3066,"children":3067},{"class":110,"line":275},[3068],{"type":39,"tag":108,"props":3069,"children":3070},{"emptyLinePlaceholder":209},[3071],{"type":45,"value":212},{"type":39,"tag":108,"props":3073,"children":3074},{"class":110,"line":292},[3075],{"type":39,"tag":108,"props":3076,"children":3077},{"style":340},[3078],{"type":45,"value":3079},"\u002F\u002F Share data.url via any channel\n",{"type":39,"tag":606,"props":3081,"children":3082},{},[3083,3085,3091],{"type":45,"value":3084},"This endpoint does not call ",{"type":39,"tag":58,"props":3086,"children":3088},{"className":3087},[],[3089],{"type":45,"value":3090},"sendInvitationEmail",{"type":45,"value":3092}," — handle delivery yourself.",{"type":39,"tag":420,"props":3094,"children":3096},{"id":3095},"invitation-configuration",[3097],{"type":45,"value":3098},"Invitation Configuration",{"type":39,"tag":97,"props":3100,"children":3102},{"className":99,"code":3101,"language":101,"meta":102,"style":102},"organization({\n  invitationExpiresIn: 60 * 60 * 24 * 7, \u002F\u002F 7 days (default: 48 hours)\n  invitationLimit: 100, \u002F\u002F Max pending invitations per org\n  cancelPendingInvitationsOnReInvite: true, \u002F\u002F Cancel old invites when re-inviting\n});\n",[3103],{"type":39,"tag":58,"props":3104,"children":3105},{"__ignoreMap":102},[3106,3121,3174,3199,3224],{"type":39,"tag":108,"props":3107,"children":3108},{"class":110,"line":111},[3109,3113,3117],{"type":39,"tag":108,"props":3110,"children":3111},{"style":240},[3112],{"type":45,"value":717},{"type":39,"tag":108,"props":3114,"children":3115},{"style":127},[3116],{"type":45,"value":247},{"type":39,"tag":108,"props":3118,"children":3119},{"style":121},[3120],{"type":45,"value":252},{"type":39,"tag":108,"props":3122,"children":3123},{"class":110,"line":163},[3124,3129,3133,3138,3143,3147,3151,3156,3160,3165,3169],{"type":39,"tag":108,"props":3125,"children":3126},{"style":259},[3127],{"type":45,"value":3128},"  invitationExpiresIn",{"type":39,"tag":108,"props":3130,"children":3131},{"style":121},[3132],{"type":45,"value":267},{"type":39,"tag":108,"props":3134,"children":3135},{"style":329},[3136],{"type":45,"value":3137}," 60",{"type":39,"tag":108,"props":3139,"children":3140},{"style":121},[3141],{"type":45,"value":3142}," *",{"type":39,"tag":108,"props":3144,"children":3145},{"style":329},[3146],{"type":45,"value":3137},{"type":39,"tag":108,"props":3148,"children":3149},{"style":121},[3150],{"type":45,"value":3142},{"type":39,"tag":108,"props":3152,"children":3153},{"style":329},[3154],{"type":45,"value":3155}," 24",{"type":39,"tag":108,"props":3157,"children":3158},{"style":121},[3159],{"type":45,"value":3142},{"type":39,"tag":108,"props":3161,"children":3162},{"style":329},[3163],{"type":45,"value":3164}," 7",{"type":39,"tag":108,"props":3166,"children":3167},{"style":121},[3168],{"type":45,"value":337},{"type":39,"tag":108,"props":3170,"children":3171},{"style":340},[3172],{"type":45,"value":3173}," \u002F\u002F 7 days (default: 48 hours)\n",{"type":39,"tag":108,"props":3175,"children":3176},{"class":110,"line":205},[3177,3182,3186,3190,3194],{"type":39,"tag":108,"props":3178,"children":3179},{"style":259},[3180],{"type":45,"value":3181},"  invitationLimit",{"type":39,"tag":108,"props":3183,"children":3184},{"style":121},[3185],{"type":45,"value":267},{"type":39,"tag":108,"props":3187,"children":3188},{"style":329},[3189],{"type":45,"value":361},{"type":39,"tag":108,"props":3191,"children":3192},{"style":121},[3193],{"type":45,"value":337},{"type":39,"tag":108,"props":3195,"children":3196},{"style":340},[3197],{"type":45,"value":3198}," \u002F\u002F Max pending invitations per org\n",{"type":39,"tag":108,"props":3200,"children":3201},{"class":110,"line":215},[3202,3207,3211,3215,3219],{"type":39,"tag":108,"props":3203,"children":3204},{"style":259},[3205],{"type":45,"value":3206},"  cancelPendingInvitationsOnReInvite",{"type":39,"tag":108,"props":3208,"children":3209},{"style":121},[3210],{"type":45,"value":267},{"type":39,"tag":108,"props":3212,"children":3213},{"style":305},[3214],{"type":45,"value":308},{"type":39,"tag":108,"props":3216,"children":3217},{"style":121},[3218],{"type":45,"value":337},{"type":39,"tag":108,"props":3220,"children":3221},{"style":340},[3222],{"type":45,"value":3223}," \u002F\u002F Cancel old invites when re-inviting\n",{"type":39,"tag":108,"props":3225,"children":3226},{"class":110,"line":255},[3227,3231,3235],{"type":39,"tag":108,"props":3228,"children":3229},{"style":121},[3230],{"type":45,"value":410},{"type":39,"tag":108,"props":3232,"children":3233},{"style":127},[3234],{"type":45,"value":384},{"type":39,"tag":108,"props":3236,"children":3237},{"style":121},[3238],{"type":45,"value":160},{"type":39,"tag":40,"props":3240,"children":3242},{"id":3241},"roles-permissions",[3243],{"type":45,"value":3244},"Roles & Permissions",{"type":39,"tag":606,"props":3246,"children":3247},{},[3248,3250,3255,3257,3262,3264,3269],{"type":45,"value":3249},"Default roles: ",{"type":39,"tag":58,"props":3251,"children":3253},{"className":3252},[],[3254],{"type":45,"value":616},{"type":45,"value":3256}," (full access), ",{"type":39,"tag":58,"props":3258,"children":3260},{"className":3259},[],[3261],{"type":45,"value":1845},{"type":45,"value":3263}," (manage members\u002Finvitations\u002Fsettings), ",{"type":39,"tag":58,"props":3265,"children":3267},{"className":3266},[],[3268],{"type":45,"value":1668},{"type":45,"value":3270}," (basic access).",{"type":39,"tag":420,"props":3272,"children":3274},{"id":3273},"checking-permissions",[3275],{"type":45,"value":3276},"Checking Permissions",{"type":39,"tag":97,"props":3278,"children":3280},{"className":99,"code":3279,"language":101,"meta":102,"style":102},"const { data } = await authClient.organization.hasPermission({\n  permission: \"member:write\",\n});\n\nif (data?.hasPermission) {\n  \u002F\u002F User can manage members\n}\n",[3281],{"type":39,"tag":58,"props":3282,"children":3283},{"__ignoreMap":102},[3284,3340,3369,3384,3391,3417,3425],{"type":39,"tag":108,"props":3285,"children":3286},{"class":110,"line":111},[3287,3291,3295,3299,3303,3307,3311,3315,3319,3323,3327,3332,3336],{"type":39,"tag":108,"props":3288,"children":3289},{"style":224},[3290],{"type":45,"value":633},{"type":39,"tag":108,"props":3292,"children":3293},{"style":121},[3294],{"type":45,"value":124},{"type":39,"tag":108,"props":3296,"children":3297},{"style":127},[3298],{"type":45,"value":2925},{"type":39,"tag":108,"props":3300,"children":3301},{"style":121},[3302],{"type":45,"value":410},{"type":39,"tag":108,"props":3304,"children":3305},{"style":121},[3306],{"type":45,"value":697},{"type":39,"tag":108,"props":3308,"children":3309},{"style":115},[3310],{"type":45,"value":702},{"type":39,"tag":108,"props":3312,"children":3313},{"style":127},[3314],{"type":45,"value":707},{"type":39,"tag":108,"props":3316,"children":3317},{"style":121},[3318],{"type":45,"value":712},{"type":39,"tag":108,"props":3320,"children":3321},{"style":127},[3322],{"type":45,"value":717},{"type":39,"tag":108,"props":3324,"children":3325},{"style":121},[3326],{"type":45,"value":712},{"type":39,"tag":108,"props":3328,"children":3329},{"style":240},[3330],{"type":45,"value":3331},"hasPermission",{"type":39,"tag":108,"props":3333,"children":3334},{"style":127},[3335],{"type":45,"value":247},{"type":39,"tag":108,"props":3337,"children":3338},{"style":121},[3339],{"type":45,"value":252},{"type":39,"tag":108,"props":3341,"children":3342},{"class":110,"line":163},[3343,3348,3352,3356,3361,3365],{"type":39,"tag":108,"props":3344,"children":3345},{"style":259},[3346],{"type":45,"value":3347},"  permission",{"type":39,"tag":108,"props":3349,"children":3350},{"style":121},[3351],{"type":45,"value":267},{"type":39,"tag":108,"props":3353,"children":3354},{"style":121},[3355],{"type":45,"value":145},{"type":39,"tag":108,"props":3357,"children":3358},{"style":148},[3359],{"type":45,"value":3360},"member:write",{"type":39,"tag":108,"props":3362,"children":3363},{"style":121},[3364],{"type":45,"value":155},{"type":39,"tag":108,"props":3366,"children":3367},{"style":121},[3368],{"type":45,"value":313},{"type":39,"tag":108,"props":3370,"children":3371},{"class":110,"line":205},[3372,3376,3380],{"type":39,"tag":108,"props":3373,"children":3374},{"style":121},[3375],{"type":45,"value":410},{"type":39,"tag":108,"props":3377,"children":3378},{"style":127},[3379],{"type":45,"value":384},{"type":39,"tag":108,"props":3381,"children":3382},{"style":121},[3383],{"type":45,"value":160},{"type":39,"tag":108,"props":3385,"children":3386},{"class":110,"line":215},[3387],{"type":39,"tag":108,"props":3388,"children":3389},{"emptyLinePlaceholder":209},[3390],{"type":45,"value":212},{"type":39,"tag":108,"props":3392,"children":3393},{"class":110,"line":255},[3394,3399,3404,3408,3413],{"type":39,"tag":108,"props":3395,"children":3396},{"style":115},[3397],{"type":45,"value":3398},"if",{"type":39,"tag":108,"props":3400,"children":3401},{"style":127},[3402],{"type":45,"value":3403}," (data",{"type":39,"tag":108,"props":3405,"children":3406},{"style":121},[3407],{"type":45,"value":2061},{"type":39,"tag":108,"props":3409,"children":3410},{"style":127},[3411],{"type":45,"value":3412},"hasPermission) ",{"type":39,"tag":108,"props":3414,"children":3415},{"style":121},[3416],{"type":45,"value":252},{"type":39,"tag":108,"props":3418,"children":3419},{"class":110,"line":275},[3420],{"type":39,"tag":108,"props":3421,"children":3422},{"style":340},[3423],{"type":45,"value":3424},"  \u002F\u002F User can manage members\n",{"type":39,"tag":108,"props":3426,"children":3427},{"class":110,"line":292},[3428],{"type":39,"tag":108,"props":3429,"children":3430},{"style":121},[3431],{"type":45,"value":3432},"}\n",{"type":39,"tag":606,"props":3434,"children":3435},{},[3436,3437,3443,3445,3450],{"type":45,"value":1541},{"type":39,"tag":58,"props":3438,"children":3440},{"className":3439},[],[3441],{"type":45,"value":3442},"checkRolePermission({ role, permissions })",{"type":45,"value":3444}," for client-side UI rendering (static only). For dynamic access control, use the ",{"type":39,"tag":58,"props":3446,"children":3448},{"className":3447},[],[3449],{"type":45,"value":3331},{"type":45,"value":3451}," endpoint.",{"type":39,"tag":40,"props":3453,"children":3455},{"id":3454},"teams",[3456],{"type":45,"value":3457},"Teams",{"type":39,"tag":420,"props":3459,"children":3461},{"id":3460},"enabling-teams",[3462],{"type":45,"value":3463},"Enabling Teams",{"type":39,"tag":97,"props":3465,"children":3467},{"className":99,"code":3466,"language":101,"meta":102,"style":102},"import { organization } from \"better-auth\u002Fplugins\";\n\nexport const auth = betterAuth({\n  plugins: [\n    organization({\n        teams: {\n            enabled: true\n        }\n    }),\n  ],\n});\n",[3468],{"type":39,"tag":58,"props":3469,"children":3470},{"__ignoreMap":102},[3471,3510,3517,3548,3563,3578,3594,3611,3619,3634,3645],{"type":39,"tag":108,"props":3472,"children":3473},{"class":110,"line":111},[3474,3478,3482,3486,3490,3494,3498,3502,3506],{"type":39,"tag":108,"props":3475,"children":3476},{"style":115},[3477],{"type":45,"value":118},{"type":39,"tag":108,"props":3479,"children":3480},{"style":121},[3481],{"type":45,"value":124},{"type":39,"tag":108,"props":3483,"children":3484},{"style":127},[3485],{"type":45,"value":177},{"type":39,"tag":108,"props":3487,"children":3488},{"style":121},[3489],{"type":45,"value":135},{"type":39,"tag":108,"props":3491,"children":3492},{"style":115},[3493],{"type":45,"value":140},{"type":39,"tag":108,"props":3495,"children":3496},{"style":121},[3497],{"type":45,"value":145},{"type":39,"tag":108,"props":3499,"children":3500},{"style":148},[3501],{"type":45,"value":194},{"type":39,"tag":108,"props":3503,"children":3504},{"style":121},[3505],{"type":45,"value":155},{"type":39,"tag":108,"props":3507,"children":3508},{"style":121},[3509],{"type":45,"value":160},{"type":39,"tag":108,"props":3511,"children":3512},{"class":110,"line":163},[3513],{"type":39,"tag":108,"props":3514,"children":3515},{"emptyLinePlaceholder":209},[3516],{"type":45,"value":212},{"type":39,"tag":108,"props":3518,"children":3519},{"class":110,"line":205},[3520,3524,3528,3532,3536,3540,3544],{"type":39,"tag":108,"props":3521,"children":3522},{"style":115},[3523],{"type":45,"value":221},{"type":39,"tag":108,"props":3525,"children":3526},{"style":224},[3527],{"type":45,"value":227},{"type":39,"tag":108,"props":3529,"children":3530},{"style":127},[3531],{"type":45,"value":232},{"type":39,"tag":108,"props":3533,"children":3534},{"style":121},[3535],{"type":45,"value":237},{"type":39,"tag":108,"props":3537,"children":3538},{"style":240},[3539],{"type":45,"value":130},{"type":39,"tag":108,"props":3541,"children":3542},{"style":127},[3543],{"type":45,"value":247},{"type":39,"tag":108,"props":3545,"children":3546},{"style":121},[3547],{"type":45,"value":252},{"type":39,"tag":108,"props":3549,"children":3550},{"class":110,"line":215},[3551,3555,3559],{"type":39,"tag":108,"props":3552,"children":3553},{"style":259},[3554],{"type":45,"value":262},{"type":39,"tag":108,"props":3556,"children":3557},{"style":121},[3558],{"type":45,"value":267},{"type":39,"tag":108,"props":3560,"children":3561},{"style":127},[3562],{"type":45,"value":272},{"type":39,"tag":108,"props":3564,"children":3565},{"class":110,"line":255},[3566,3570,3574],{"type":39,"tag":108,"props":3567,"children":3568},{"style":240},[3569],{"type":45,"value":281},{"type":39,"tag":108,"props":3571,"children":3572},{"style":127},[3573],{"type":45,"value":247},{"type":39,"tag":108,"props":3575,"children":3576},{"style":121},[3577],{"type":45,"value":252},{"type":39,"tag":108,"props":3579,"children":3580},{"class":110,"line":275},[3581,3586,3590],{"type":39,"tag":108,"props":3582,"children":3583},{"style":259},[3584],{"type":45,"value":3585},"        teams",{"type":39,"tag":108,"props":3587,"children":3588},{"style":121},[3589],{"type":45,"value":267},{"type":39,"tag":108,"props":3591,"children":3592},{"style":121},[3593],{"type":45,"value":662},{"type":39,"tag":108,"props":3595,"children":3596},{"class":110,"line":292},[3597,3602,3606],{"type":39,"tag":108,"props":3598,"children":3599},{"style":259},[3600],{"type":45,"value":3601},"            enabled",{"type":39,"tag":108,"props":3603,"children":3604},{"style":121},[3605],{"type":45,"value":267},{"type":39,"tag":108,"props":3607,"children":3608},{"style":305},[3609],{"type":45,"value":3610}," true\n",{"type":39,"tag":108,"props":3612,"children":3613},{"class":110,"line":316},[3614],{"type":39,"tag":108,"props":3615,"children":3616},{"style":121},[3617],{"type":45,"value":3618},"        }\n",{"type":39,"tag":108,"props":3620,"children":3621},{"class":110,"line":346},[3622,3626,3630],{"type":39,"tag":108,"props":3623,"children":3624},{"style":121},[3625],{"type":45,"value":379},{"type":39,"tag":108,"props":3627,"children":3628},{"style":127},[3629],{"type":45,"value":384},{"type":39,"tag":108,"props":3631,"children":3632},{"style":121},[3633],{"type":45,"value":313},{"type":39,"tag":108,"props":3635,"children":3636},{"class":110,"line":373},[3637,3641],{"type":39,"tag":108,"props":3638,"children":3639},{"style":127},[3640],{"type":45,"value":397},{"type":39,"tag":108,"props":3642,"children":3643},{"style":121},[3644],{"type":45,"value":313},{"type":39,"tag":108,"props":3646,"children":3647},{"class":110,"line":391},[3648,3652,3656],{"type":39,"tag":108,"props":3649,"children":3650},{"style":121},[3651],{"type":45,"value":410},{"type":39,"tag":108,"props":3653,"children":3654},{"style":127},[3655],{"type":45,"value":384},{"type":39,"tag":108,"props":3657,"children":3658},{"style":121},[3659],{"type":45,"value":160},{"type":39,"tag":420,"props":3661,"children":3663},{"id":3662},"creating-teams",[3664],{"type":45,"value":3665},"Creating Teams",{"type":39,"tag":97,"props":3667,"children":3669},{"className":99,"code":3668,"language":101,"meta":102,"style":102},"const { data } = await authClient.organization.createTeam({\n  name: \"Engineering\",\n});\n",[3670],{"type":39,"tag":58,"props":3671,"children":3672},{"__ignoreMap":102},[3673,3729,3758],{"type":39,"tag":108,"props":3674,"children":3675},{"class":110,"line":111},[3676,3680,3684,3688,3692,3696,3700,3704,3708,3712,3716,3721,3725],{"type":39,"tag":108,"props":3677,"children":3678},{"style":224},[3679],{"type":45,"value":633},{"type":39,"tag":108,"props":3681,"children":3682},{"style":121},[3683],{"type":45,"value":124},{"type":39,"tag":108,"props":3685,"children":3686},{"style":127},[3687],{"type":45,"value":2925},{"type":39,"tag":108,"props":3689,"children":3690},{"style":121},[3691],{"type":45,"value":410},{"type":39,"tag":108,"props":3693,"children":3694},{"style":121},[3695],{"type":45,"value":697},{"type":39,"tag":108,"props":3697,"children":3698},{"style":115},[3699],{"type":45,"value":702},{"type":39,"tag":108,"props":3701,"children":3702},{"style":127},[3703],{"type":45,"value":707},{"type":39,"tag":108,"props":3705,"children":3706},{"style":121},[3707],{"type":45,"value":712},{"type":39,"tag":108,"props":3709,"children":3710},{"style":127},[3711],{"type":45,"value":717},{"type":39,"tag":108,"props":3713,"children":3714},{"style":121},[3715],{"type":45,"value":712},{"type":39,"tag":108,"props":3717,"children":3718},{"style":240},[3719],{"type":45,"value":3720},"createTeam",{"type":39,"tag":108,"props":3722,"children":3723},{"style":127},[3724],{"type":45,"value":247},{"type":39,"tag":108,"props":3726,"children":3727},{"style":121},[3728],{"type":45,"value":252},{"type":39,"tag":108,"props":3730,"children":3731},{"class":110,"line":163},[3732,3737,3741,3745,3750,3754],{"type":39,"tag":108,"props":3733,"children":3734},{"style":259},[3735],{"type":45,"value":3736},"  name",{"type":39,"tag":108,"props":3738,"children":3739},{"style":121},[3740],{"type":45,"value":267},{"type":39,"tag":108,"props":3742,"children":3743},{"style":121},[3744],{"type":45,"value":145},{"type":39,"tag":108,"props":3746,"children":3747},{"style":148},[3748],{"type":45,"value":3749},"Engineering",{"type":39,"tag":108,"props":3751,"children":3752},{"style":121},[3753],{"type":45,"value":155},{"type":39,"tag":108,"props":3755,"children":3756},{"style":121},[3757],{"type":45,"value":313},{"type":39,"tag":108,"props":3759,"children":3760},{"class":110,"line":205},[3761,3765,3769],{"type":39,"tag":108,"props":3762,"children":3763},{"style":121},[3764],{"type":45,"value":410},{"type":39,"tag":108,"props":3766,"children":3767},{"style":127},[3768],{"type":45,"value":384},{"type":39,"tag":108,"props":3770,"children":3771},{"style":121},[3772],{"type":45,"value":160},{"type":39,"tag":420,"props":3774,"children":3776},{"id":3775},"managing-team-members",[3777],{"type":45,"value":3778},"Managing Team Members",{"type":39,"tag":606,"props":3780,"children":3781},{},[3782,3783,3789,3791,3797],{"type":45,"value":1541},{"type":39,"tag":58,"props":3784,"children":3786},{"className":3785},[],[3787],{"type":45,"value":3788},"addTeamMember({ teamId, userId })",{"type":45,"value":3790}," (member must be in org first) and ",{"type":39,"tag":58,"props":3792,"children":3794},{"className":3793},[],[3795],{"type":45,"value":3796},"removeTeamMember({ teamId, userId })",{"type":45,"value":3798}," (stays in org).",{"type":39,"tag":606,"props":3800,"children":3801},{},[3802,3804,3810],{"type":45,"value":3803},"Set active team with ",{"type":39,"tag":58,"props":3805,"children":3807},{"className":3806},[],[3808],{"type":45,"value":3809},"setActiveTeam({ teamId })",{"type":45,"value":712},{"type":39,"tag":420,"props":3812,"children":3814},{"id":3813},"team-limits",[3815],{"type":45,"value":3816},"Team Limits",{"type":39,"tag":97,"props":3818,"children":3820},{"className":99,"code":3819,"language":101,"meta":102,"style":102},"organization({\n  teams: {\n      maximumTeams: 20, \u002F\u002F Max teams per org\n      maximumMembersPerTeam: 50, \u002F\u002F Max members per team\n      allowRemovingAllTeams: false, \u002F\u002F Prevent removing last team\n  }\n});\n",[3821],{"type":39,"tag":58,"props":3822,"children":3823},{"__ignoreMap":102},[3824,3839,3855,3880,3905,3931,3939],{"type":39,"tag":108,"props":3825,"children":3826},{"class":110,"line":111},[3827,3831,3835],{"type":39,"tag":108,"props":3828,"children":3829},{"style":240},[3830],{"type":45,"value":717},{"type":39,"tag":108,"props":3832,"children":3833},{"style":127},[3834],{"type":45,"value":247},{"type":39,"tag":108,"props":3836,"children":3837},{"style":121},[3838],{"type":45,"value":252},{"type":39,"tag":108,"props":3840,"children":3841},{"class":110,"line":163},[3842,3847,3851],{"type":39,"tag":108,"props":3843,"children":3844},{"style":259},[3845],{"type":45,"value":3846},"  teams",{"type":39,"tag":108,"props":3848,"children":3849},{"style":121},[3850],{"type":45,"value":267},{"type":39,"tag":108,"props":3852,"children":3853},{"style":121},[3854],{"type":45,"value":662},{"type":39,"tag":108,"props":3856,"children":3857},{"class":110,"line":205},[3858,3863,3867,3871,3875],{"type":39,"tag":108,"props":3859,"children":3860},{"style":259},[3861],{"type":45,"value":3862},"      maximumTeams",{"type":39,"tag":108,"props":3864,"children":3865},{"style":121},[3866],{"type":45,"value":267},{"type":39,"tag":108,"props":3868,"children":3869},{"style":329},[3870],{"type":45,"value":1094},{"type":39,"tag":108,"props":3872,"children":3873},{"style":121},[3874],{"type":45,"value":337},{"type":39,"tag":108,"props":3876,"children":3877},{"style":340},[3878],{"type":45,"value":3879}," \u002F\u002F Max teams per org\n",{"type":39,"tag":108,"props":3881,"children":3882},{"class":110,"line":215},[3883,3888,3892,3896,3900],{"type":39,"tag":108,"props":3884,"children":3885},{"style":259},[3886],{"type":45,"value":3887},"      maximumMembersPerTeam",{"type":39,"tag":108,"props":3889,"children":3890},{"style":121},[3891],{"type":45,"value":267},{"type":39,"tag":108,"props":3893,"children":3894},{"style":329},[3895],{"type":45,"value":2128},{"type":39,"tag":108,"props":3897,"children":3898},{"style":121},[3899],{"type":45,"value":337},{"type":39,"tag":108,"props":3901,"children":3902},{"style":340},[3903],{"type":45,"value":3904}," \u002F\u002F Max members per team\n",{"type":39,"tag":108,"props":3906,"children":3907},{"class":110,"line":255},[3908,3913,3917,3922,3926],{"type":39,"tag":108,"props":3909,"children":3910},{"style":259},[3911],{"type":45,"value":3912},"      allowRemovingAllTeams",{"type":39,"tag":108,"props":3914,"children":3915},{"style":121},[3916],{"type":45,"value":267},{"type":39,"tag":108,"props":3918,"children":3919},{"style":305},[3920],{"type":45,"value":3921}," false",{"type":39,"tag":108,"props":3923,"children":3924},{"style":121},[3925],{"type":45,"value":337},{"type":39,"tag":108,"props":3927,"children":3928},{"style":340},[3929],{"type":45,"value":3930}," \u002F\u002F Prevent removing last team\n",{"type":39,"tag":108,"props":3932,"children":3933},{"class":110,"line":275},[3934],{"type":39,"tag":108,"props":3935,"children":3936},{"style":121},[3937],{"type":45,"value":3938},"  }\n",{"type":39,"tag":108,"props":3940,"children":3941},{"class":110,"line":292},[3942,3946,3950],{"type":39,"tag":108,"props":3943,"children":3944},{"style":121},[3945],{"type":45,"value":410},{"type":39,"tag":108,"props":3947,"children":3948},{"style":127},[3949],{"type":45,"value":384},{"type":39,"tag":108,"props":3951,"children":3952},{"style":121},[3953],{"type":45,"value":160},{"type":39,"tag":40,"props":3955,"children":3957},{"id":3956},"dynamic-access-control",[3958],{"type":45,"value":3959},"Dynamic Access Control",{"type":39,"tag":420,"props":3961,"children":3963},{"id":3962},"enabling-dynamic-access-control",[3964],{"type":45,"value":3965},"Enabling Dynamic Access Control",{"type":39,"tag":97,"props":3967,"children":3969},{"className":99,"code":3968,"language":101,"meta":102,"style":102},"import { organization } from \"better-auth\u002Fplugins\";\nimport { dynamicAccessControl } from \"@better-auth\u002Forganization\u002Faddons\";\n\nexport const auth = betterAuth({\n  plugins: [\n    organization({\n        dynamicAccessControl: {\n            enabled: true\n        }\n    }),\n  ],\n});\n",[3970],{"type":39,"tag":58,"props":3971,"children":3972},{"__ignoreMap":102},[3973,4012,4053,4060,4091,4106,4121,4137,4152,4159,4174,4185],{"type":39,"tag":108,"props":3974,"children":3975},{"class":110,"line":111},[3976,3980,3984,3988,3992,3996,4000,4004,4008],{"type":39,"tag":108,"props":3977,"children":3978},{"style":115},[3979],{"type":45,"value":118},{"type":39,"tag":108,"props":3981,"children":3982},{"style":121},[3983],{"type":45,"value":124},{"type":39,"tag":108,"props":3985,"children":3986},{"style":127},[3987],{"type":45,"value":177},{"type":39,"tag":108,"props":3989,"children":3990},{"style":121},[3991],{"type":45,"value":135},{"type":39,"tag":108,"props":3993,"children":3994},{"style":115},[3995],{"type":45,"value":140},{"type":39,"tag":108,"props":3997,"children":3998},{"style":121},[3999],{"type":45,"value":145},{"type":39,"tag":108,"props":4001,"children":4002},{"style":148},[4003],{"type":45,"value":194},{"type":39,"tag":108,"props":4005,"children":4006},{"style":121},[4007],{"type":45,"value":155},{"type":39,"tag":108,"props":4009,"children":4010},{"style":121},[4011],{"type":45,"value":160},{"type":39,"tag":108,"props":4013,"children":4014},{"class":110,"line":163},[4015,4019,4023,4028,4032,4036,4040,4045,4049],{"type":39,"tag":108,"props":4016,"children":4017},{"style":115},[4018],{"type":45,"value":118},{"type":39,"tag":108,"props":4020,"children":4021},{"style":121},[4022],{"type":45,"value":124},{"type":39,"tag":108,"props":4024,"children":4025},{"style":127},[4026],{"type":45,"value":4027}," dynamicAccessControl",{"type":39,"tag":108,"props":4029,"children":4030},{"style":121},[4031],{"type":45,"value":135},{"type":39,"tag":108,"props":4033,"children":4034},{"style":115},[4035],{"type":45,"value":140},{"type":39,"tag":108,"props":4037,"children":4038},{"style":121},[4039],{"type":45,"value":145},{"type":39,"tag":108,"props":4041,"children":4042},{"style":148},[4043],{"type":45,"value":4044},"@better-auth\u002Forganization\u002Faddons",{"type":39,"tag":108,"props":4046,"children":4047},{"style":121},[4048],{"type":45,"value":155},{"type":39,"tag":108,"props":4050,"children":4051},{"style":121},[4052],{"type":45,"value":160},{"type":39,"tag":108,"props":4054,"children":4055},{"class":110,"line":205},[4056],{"type":39,"tag":108,"props":4057,"children":4058},{"emptyLinePlaceholder":209},[4059],{"type":45,"value":212},{"type":39,"tag":108,"props":4061,"children":4062},{"class":110,"line":215},[4063,4067,4071,4075,4079,4083,4087],{"type":39,"tag":108,"props":4064,"children":4065},{"style":115},[4066],{"type":45,"value":221},{"type":39,"tag":108,"props":4068,"children":4069},{"style":224},[4070],{"type":45,"value":227},{"type":39,"tag":108,"props":4072,"children":4073},{"style":127},[4074],{"type":45,"value":232},{"type":39,"tag":108,"props":4076,"children":4077},{"style":121},[4078],{"type":45,"value":237},{"type":39,"tag":108,"props":4080,"children":4081},{"style":240},[4082],{"type":45,"value":130},{"type":39,"tag":108,"props":4084,"children":4085},{"style":127},[4086],{"type":45,"value":247},{"type":39,"tag":108,"props":4088,"children":4089},{"style":121},[4090],{"type":45,"value":252},{"type":39,"tag":108,"props":4092,"children":4093},{"class":110,"line":255},[4094,4098,4102],{"type":39,"tag":108,"props":4095,"children":4096},{"style":259},[4097],{"type":45,"value":262},{"type":39,"tag":108,"props":4099,"children":4100},{"style":121},[4101],{"type":45,"value":267},{"type":39,"tag":108,"props":4103,"children":4104},{"style":127},[4105],{"type":45,"value":272},{"type":39,"tag":108,"props":4107,"children":4108},{"class":110,"line":275},[4109,4113,4117],{"type":39,"tag":108,"props":4110,"children":4111},{"style":240},[4112],{"type":45,"value":281},{"type":39,"tag":108,"props":4114,"children":4115},{"style":127},[4116],{"type":45,"value":247},{"type":39,"tag":108,"props":4118,"children":4119},{"style":121},[4120],{"type":45,"value":252},{"type":39,"tag":108,"props":4122,"children":4123},{"class":110,"line":292},[4124,4129,4133],{"type":39,"tag":108,"props":4125,"children":4126},{"style":259},[4127],{"type":45,"value":4128},"        dynamicAccessControl",{"type":39,"tag":108,"props":4130,"children":4131},{"style":121},[4132],{"type":45,"value":267},{"type":39,"tag":108,"props":4134,"children":4135},{"style":121},[4136],{"type":45,"value":662},{"type":39,"tag":108,"props":4138,"children":4139},{"class":110,"line":316},[4140,4144,4148],{"type":39,"tag":108,"props":4141,"children":4142},{"style":259},[4143],{"type":45,"value":3601},{"type":39,"tag":108,"props":4145,"children":4146},{"style":121},[4147],{"type":45,"value":267},{"type":39,"tag":108,"props":4149,"children":4150},{"style":305},[4151],{"type":45,"value":3610},{"type":39,"tag":108,"props":4153,"children":4154},{"class":110,"line":346},[4155],{"type":39,"tag":108,"props":4156,"children":4157},{"style":121},[4158],{"type":45,"value":3618},{"type":39,"tag":108,"props":4160,"children":4161},{"class":110,"line":373},[4162,4166,4170],{"type":39,"tag":108,"props":4163,"children":4164},{"style":121},[4165],{"type":45,"value":379},{"type":39,"tag":108,"props":4167,"children":4168},{"style":127},[4169],{"type":45,"value":384},{"type":39,"tag":108,"props":4171,"children":4172},{"style":121},[4173],{"type":45,"value":313},{"type":39,"tag":108,"props":4175,"children":4176},{"class":110,"line":391},[4177,4181],{"type":39,"tag":108,"props":4178,"children":4179},{"style":127},[4180],{"type":45,"value":397},{"type":39,"tag":108,"props":4182,"children":4183},{"style":121},[4184],{"type":45,"value":313},{"type":39,"tag":108,"props":4186,"children":4187},{"class":110,"line":404},[4188,4192,4196],{"type":39,"tag":108,"props":4189,"children":4190},{"style":121},[4191],{"type":45,"value":410},{"type":39,"tag":108,"props":4193,"children":4194},{"style":127},[4195],{"type":45,"value":384},{"type":39,"tag":108,"props":4197,"children":4198},{"style":121},[4199],{"type":45,"value":160},{"type":39,"tag":420,"props":4201,"children":4203},{"id":4202},"creating-custom-roles",[4204],{"type":45,"value":4205},"Creating Custom Roles",{"type":39,"tag":97,"props":4207,"children":4209},{"className":99,"code":4208,"language":101,"meta":102,"style":102},"await authClient.organization.createRole({\n  role: \"moderator\",\n  permission: {\n    member: [\"read\"],\n    invitation: [\"read\"],\n  },\n});\n",[4210],{"type":39,"tag":58,"props":4211,"children":4212},{"__ignoreMap":102},[4213,4249,4276,4291,4328,4364,4371],{"type":39,"tag":108,"props":4214,"children":4215},{"class":110,"line":111},[4216,4220,4224,4228,4232,4236,4241,4245],{"type":39,"tag":108,"props":4217,"children":4218},{"style":115},[4219],{"type":45,"value":1156},{"type":39,"tag":108,"props":4221,"children":4222},{"style":127},[4223],{"type":45,"value":707},{"type":39,"tag":108,"props":4225,"children":4226},{"style":121},[4227],{"type":45,"value":712},{"type":39,"tag":108,"props":4229,"children":4230},{"style":127},[4231],{"type":45,"value":717},{"type":39,"tag":108,"props":4233,"children":4234},{"style":121},[4235],{"type":45,"value":712},{"type":39,"tag":108,"props":4237,"children":4238},{"style":240},[4239],{"type":45,"value":4240},"createRole",{"type":39,"tag":108,"props":4242,"children":4243},{"style":127},[4244],{"type":45,"value":247},{"type":39,"tag":108,"props":4246,"children":4247},{"style":121},[4248],{"type":45,"value":252},{"type":39,"tag":108,"props":4250,"children":4251},{"class":110,"line":163},[4252,4256,4260,4264,4268,4272],{"type":39,"tag":108,"props":4253,"children":4254},{"style":259},[4255],{"type":45,"value":2861},{"type":39,"tag":108,"props":4257,"children":4258},{"style":121},[4259],{"type":45,"value":267},{"type":39,"tag":108,"props":4261,"children":4262},{"style":121},[4263],{"type":45,"value":145},{"type":39,"tag":108,"props":4265,"children":4266},{"style":148},[4267],{"type":45,"value":1862},{"type":39,"tag":108,"props":4269,"children":4270},{"style":121},[4271],{"type":45,"value":155},{"type":39,"tag":108,"props":4273,"children":4274},{"style":121},[4275],{"type":45,"value":313},{"type":39,"tag":108,"props":4277,"children":4278},{"class":110,"line":205},[4279,4283,4287],{"type":39,"tag":108,"props":4280,"children":4281},{"style":259},[4282],{"type":45,"value":3347},{"type":39,"tag":108,"props":4284,"children":4285},{"style":121},[4286],{"type":45,"value":267},{"type":39,"tag":108,"props":4288,"children":4289},{"style":121},[4290],{"type":45,"value":662},{"type":39,"tag":108,"props":4292,"children":4293},{"class":110,"line":215},[4294,4299,4303,4307,4311,4316,4320,4324],{"type":39,"tag":108,"props":4295,"children":4296},{"style":259},[4297],{"type":45,"value":4298},"    member",{"type":39,"tag":108,"props":4300,"children":4301},{"style":121},[4302],{"type":45,"value":267},{"type":39,"tag":108,"props":4304,"children":4305},{"style":127},[4306],{"type":45,"value":569},{"type":39,"tag":108,"props":4308,"children":4309},{"style":121},[4310],{"type":45,"value":155},{"type":39,"tag":108,"props":4312,"children":4313},{"style":148},[4314],{"type":45,"value":4315},"read",{"type":39,"tag":108,"props":4317,"children":4318},{"style":121},[4319],{"type":45,"value":155},{"type":39,"tag":108,"props":4321,"children":4322},{"style":127},[4323],{"type":45,"value":1871},{"type":39,"tag":108,"props":4325,"children":4326},{"style":121},[4327],{"type":45,"value":313},{"type":39,"tag":108,"props":4329,"children":4330},{"class":110,"line":255},[4331,4336,4340,4344,4348,4352,4356,4360],{"type":39,"tag":108,"props":4332,"children":4333},{"style":259},[4334],{"type":45,"value":4335},"    invitation",{"type":39,"tag":108,"props":4337,"children":4338},{"style":121},[4339],{"type":45,"value":267},{"type":39,"tag":108,"props":4341,"children":4342},{"style":127},[4343],{"type":45,"value":569},{"type":39,"tag":108,"props":4345,"children":4346},{"style":121},[4347],{"type":45,"value":155},{"type":39,"tag":108,"props":4349,"children":4350},{"style":148},[4351],{"type":45,"value":4315},{"type":39,"tag":108,"props":4353,"children":4354},{"style":121},[4355],{"type":45,"value":155},{"type":39,"tag":108,"props":4357,"children":4358},{"style":127},[4359],{"type":45,"value":1871},{"type":39,"tag":108,"props":4361,"children":4362},{"style":121},[4363],{"type":45,"value":313},{"type":39,"tag":108,"props":4365,"children":4366},{"class":110,"line":275},[4367],{"type":39,"tag":108,"props":4368,"children":4369},{"style":121},[4370],{"type":45,"value":1003},{"type":39,"tag":108,"props":4372,"children":4373},{"class":110,"line":292},[4374,4378,4382],{"type":39,"tag":108,"props":4375,"children":4376},{"style":121},[4377],{"type":45,"value":410},{"type":39,"tag":108,"props":4379,"children":4380},{"style":127},[4381],{"type":45,"value":384},{"type":39,"tag":108,"props":4383,"children":4384},{"style":121},[4385],{"type":45,"value":160},{"type":39,"tag":606,"props":4387,"children":4388},{},[4389,4390,4396,4398,4404],{"type":45,"value":1541},{"type":39,"tag":58,"props":4391,"children":4393},{"className":4392},[],[4394],{"type":45,"value":4395},"updateRole({ roleId, permission })",{"type":45,"value":4397}," and ",{"type":39,"tag":58,"props":4399,"children":4401},{"className":4400},[],[4402],{"type":45,"value":4403},"deleteRole({ roleId })",{"type":45,"value":4405},". Pre-defined roles (owner, admin, member) cannot be deleted. Roles assigned to members cannot be deleted until reassigned.",{"type":39,"tag":40,"props":4407,"children":4409},{"id":4408},"lifecycle-hooks",[4410],{"type":45,"value":4411},"Lifecycle Hooks",{"type":39,"tag":606,"props":4413,"children":4414},{},[4415],{"type":45,"value":4416},"Execute custom logic at various points in the organization lifecycle:",{"type":39,"tag":97,"props":4418,"children":4420},{"className":99,"code":4419,"language":101,"meta":102,"style":102},"organization({\n  hooks: {\n    organization: {\n      beforeCreate: async ({ data, user }) => {\n        \u002F\u002F Validate or modify data before creation\n        return {\n          data: {\n            ...data,\n            metadata: { ...data.metadata, createdBy: user.id },\n          },\n        };\n      },\n      afterCreate: async ({ organization, member }) => {\n        \u002F\u002F Post-creation logic (e.g., send welcome email, create default resources)\n        await createDefaultResources(organization.id);\n      },\n      beforeDelete: async ({ organization }) => {\n        \u002F\u002F Cleanup before deletion\n        await archiveOrganizationData(organization.id);\n      },\n    },\n    member: {\n      afterCreate: async ({ member, organization }) => {\n        await notifyAdmins(organization.id, `New member joined`);\n      },\n    },\n    invitation: {\n      afterCreate: async ({ invitation, organization, inviter }) => {\n        await logInvitation(invitation);\n      },\n    },\n  },\n});\n",[4421],{"type":39,"tag":58,"props":4422,"children":4423},{"__ignoreMap":102},[4424,4439,4455,4470,4516,4524,4536,4552,4568,4630,4638,4646,4653,4698,4706,4742,4749,4785,4793,4829,4836,4844,4859,4902,4956,4964,4972,4988,5039,5068,5076,5084,5092],{"type":39,"tag":108,"props":4425,"children":4426},{"class":110,"line":111},[4427,4431,4435],{"type":39,"tag":108,"props":4428,"children":4429},{"style":240},[4430],{"type":45,"value":717},{"type":39,"tag":108,"props":4432,"children":4433},{"style":127},[4434],{"type":45,"value":247},{"type":39,"tag":108,"props":4436,"children":4437},{"style":121},[4438],{"type":45,"value":252},{"type":39,"tag":108,"props":4440,"children":4441},{"class":110,"line":163},[4442,4447,4451],{"type":39,"tag":108,"props":4443,"children":4444},{"style":259},[4445],{"type":45,"value":4446},"  hooks",{"type":39,"tag":108,"props":4448,"children":4449},{"style":121},[4450],{"type":45,"value":267},{"type":39,"tag":108,"props":4452,"children":4453},{"style":121},[4454],{"type":45,"value":662},{"type":39,"tag":108,"props":4456,"children":4457},{"class":110,"line":205},[4458,4462,4466],{"type":39,"tag":108,"props":4459,"children":4460},{"style":259},[4461],{"type":45,"value":281},{"type":39,"tag":108,"props":4463,"children":4464},{"style":121},[4465],{"type":45,"value":267},{"type":39,"tag":108,"props":4467,"children":4468},{"style":121},[4469],{"type":45,"value":662},{"type":39,"tag":108,"props":4471,"children":4472},{"class":110,"line":215},[4473,4478,4482,4486,4491,4495,4499,4503,4508,4512],{"type":39,"tag":108,"props":4474,"children":4475},{"style":240},[4476],{"type":45,"value":4477},"      beforeCreate",{"type":39,"tag":108,"props":4479,"children":4480},{"style":121},[4481],{"type":45,"value":267},{"type":39,"tag":108,"props":4483,"children":4484},{"style":224},[4485],{"type":45,"value":647},{"type":39,"tag":108,"props":4487,"children":4488},{"style":121},[4489],{"type":45,"value":4490}," ({",{"type":39,"tag":108,"props":4492,"children":4493},{"style":945},[4494],{"type":45,"value":679},{"type":39,"tag":108,"props":4496,"children":4497},{"style":121},[4498],{"type":45,"value":337},{"type":39,"tag":108,"props":4500,"children":4501},{"style":945},[4502],{"type":45,"value":973},{"type":39,"tag":108,"props":4504,"children":4505},{"style":121},[4506],{"type":45,"value":4507}," })",{"type":39,"tag":108,"props":4509,"children":4510},{"style":224},[4511],{"type":45,"value":657},{"type":39,"tag":108,"props":4513,"children":4514},{"style":121},[4515],{"type":45,"value":662},{"type":39,"tag":108,"props":4517,"children":4518},{"class":110,"line":255},[4519],{"type":39,"tag":108,"props":4520,"children":4521},{"style":340},[4522],{"type":45,"value":4523},"        \u002F\u002F Validate or modify data before creation\n",{"type":39,"tag":108,"props":4525,"children":4526},{"class":110,"line":275},[4527,4532],{"type":39,"tag":108,"props":4528,"children":4529},{"style":115},[4530],{"type":45,"value":4531},"        return",{"type":39,"tag":108,"props":4533,"children":4534},{"style":121},[4535],{"type":45,"value":662},{"type":39,"tag":108,"props":4537,"children":4538},{"class":110,"line":292},[4539,4544,4548],{"type":39,"tag":108,"props":4540,"children":4541},{"style":259},[4542],{"type":45,"value":4543},"          data",{"type":39,"tag":108,"props":4545,"children":4546},{"style":121},[4547],{"type":45,"value":267},{"type":39,"tag":108,"props":4549,"children":4550},{"style":121},[4551],{"type":45,"value":662},{"type":39,"tag":108,"props":4553,"children":4554},{"class":110,"line":316},[4555,4560,4564],{"type":39,"tag":108,"props":4556,"children":4557},{"style":121},[4558],{"type":45,"value":4559},"            ...",{"type":39,"tag":108,"props":4561,"children":4562},{"style":127},[4563],{"type":45,"value":2385},{"type":39,"tag":108,"props":4565,"children":4566},{"style":121},[4567],{"type":45,"value":313},{"type":39,"tag":108,"props":4569,"children":4570},{"class":110,"line":346},[4571,4576,4580,4584,4589,4593,4597,4601,4605,4610,4614,4618,4622,4626],{"type":39,"tag":108,"props":4572,"children":4573},{"style":259},[4574],{"type":45,"value":4575},"            metadata",{"type":39,"tag":108,"props":4577,"children":4578},{"style":121},[4579],{"type":45,"value":267},{"type":39,"tag":108,"props":4581,"children":4582},{"style":121},[4583],{"type":45,"value":124},{"type":39,"tag":108,"props":4585,"children":4586},{"style":121},[4587],{"type":45,"value":4588}," ...",{"type":39,"tag":108,"props":4590,"children":4591},{"style":127},[4592],{"type":45,"value":2385},{"type":39,"tag":108,"props":4594,"children":4595},{"style":121},[4596],{"type":45,"value":712},{"type":39,"tag":108,"props":4598,"children":4599},{"style":127},[4600],{"type":45,"value":2056},{"type":39,"tag":108,"props":4602,"children":4603},{"style":121},[4604],{"type":45,"value":337},{"type":39,"tag":108,"props":4606,"children":4607},{"style":259},[4608],{"type":45,"value":4609}," createdBy",{"type":39,"tag":108,"props":4611,"children":4612},{"style":121},[4613],{"type":45,"value":267},{"type":39,"tag":108,"props":4615,"children":4616},{"style":127},[4617],{"type":45,"value":973},{"type":39,"tag":108,"props":4619,"children":4620},{"style":121},[4621],{"type":45,"value":712},{"type":39,"tag":108,"props":4623,"children":4624},{"style":127},[4625],{"type":45,"value":2666},{"type":39,"tag":108,"props":4627,"children":4628},{"style":121},[4629],{"type":45,"value":864},{"type":39,"tag":108,"props":4631,"children":4632},{"class":110,"line":373},[4633],{"type":39,"tag":108,"props":4634,"children":4635},{"style":121},[4636],{"type":45,"value":4637},"          },\n",{"type":39,"tag":108,"props":4639,"children":4640},{"class":110,"line":391},[4641],{"type":39,"tag":108,"props":4642,"children":4643},{"style":121},[4644],{"type":45,"value":4645},"        };\n",{"type":39,"tag":108,"props":4647,"children":4648},{"class":110,"line":404},[4649],{"type":39,"tag":108,"props":4650,"children":4651},{"style":121},[4652],{"type":45,"value":2732},{"type":39,"tag":108,"props":4654,"children":4655},{"class":110,"line":2506},[4656,4661,4665,4669,4673,4677,4681,4686,4690,4694],{"type":39,"tag":108,"props":4657,"children":4658},{"style":240},[4659],{"type":45,"value":4660},"      afterCreate",{"type":39,"tag":108,"props":4662,"children":4663},{"style":121},[4664],{"type":45,"value":267},{"type":39,"tag":108,"props":4666,"children":4667},{"style":224},[4668],{"type":45,"value":647},{"type":39,"tag":108,"props":4670,"children":4671},{"style":121},[4672],{"type":45,"value":4490},{"type":39,"tag":108,"props":4674,"children":4675},{"style":945},[4676],{"type":45,"value":177},{"type":39,"tag":108,"props":4678,"children":4679},{"style":121},[4680],{"type":45,"value":337},{"type":39,"tag":108,"props":4682,"children":4683},{"style":945},[4684],{"type":45,"value":4685}," member",{"type":39,"tag":108,"props":4687,"children":4688},{"style":121},[4689],{"type":45,"value":4507},{"type":39,"tag":108,"props":4691,"children":4692},{"style":224},[4693],{"type":45,"value":657},{"type":39,"tag":108,"props":4695,"children":4696},{"style":121},[4697],{"type":45,"value":662},{"type":39,"tag":108,"props":4699,"children":4700},{"class":110,"line":2556},[4701],{"type":39,"tag":108,"props":4702,"children":4703},{"style":340},[4704],{"type":45,"value":4705},"        \u002F\u002F Post-creation logic (e.g., send welcome email, create default resources)\n",{"type":39,"tag":108,"props":4707,"children":4708},{"class":110,"line":2574},[4709,4713,4718,4722,4726,4730,4734,4738],{"type":39,"tag":108,"props":4710,"children":4711},{"style":115},[4712],{"type":45,"value":2471},{"type":39,"tag":108,"props":4714,"children":4715},{"style":240},[4716],{"type":45,"value":4717}," createDefaultResources",{"type":39,"tag":108,"props":4719,"children":4720},{"style":259},[4721],{"type":45,"value":247},{"type":39,"tag":108,"props":4723,"children":4724},{"style":127},[4725],{"type":45,"value":717},{"type":39,"tag":108,"props":4727,"children":4728},{"style":121},[4729],{"type":45,"value":712},{"type":39,"tag":108,"props":4731,"children":4732},{"style":127},[4733],{"type":45,"value":2666},{"type":39,"tag":108,"props":4735,"children":4736},{"style":259},[4737],{"type":45,"value":384},{"type":39,"tag":108,"props":4739,"children":4740},{"style":121},[4741],{"type":45,"value":160},{"type":39,"tag":108,"props":4743,"children":4744},{"class":110,"line":2642},[4745],{"type":39,"tag":108,"props":4746,"children":4747},{"style":121},[4748],{"type":45,"value":2732},{"type":39,"tag":108,"props":4750,"children":4751},{"class":110,"line":2678},[4752,4757,4761,4765,4769,4773,4777,4781],{"type":39,"tag":108,"props":4753,"children":4754},{"style":240},[4755],{"type":45,"value":4756},"      beforeDelete",{"type":39,"tag":108,"props":4758,"children":4759},{"style":121},[4760],{"type":45,"value":267},{"type":39,"tag":108,"props":4762,"children":4763},{"style":224},[4764],{"type":45,"value":647},{"type":39,"tag":108,"props":4766,"children":4767},{"style":121},[4768],{"type":45,"value":4490},{"type":39,"tag":108,"props":4770,"children":4771},{"style":945},[4772],{"type":45,"value":177},{"type":39,"tag":108,"props":4774,"children":4775},{"style":121},[4776],{"type":45,"value":4507},{"type":39,"tag":108,"props":4778,"children":4779},{"style":224},[4780],{"type":45,"value":657},{"type":39,"tag":108,"props":4782,"children":4783},{"style":121},[4784],{"type":45,"value":662},{"type":39,"tag":108,"props":4786,"children":4787},{"class":110,"line":2687},[4788],{"type":39,"tag":108,"props":4789,"children":4790},{"style":340},[4791],{"type":45,"value":4792},"        \u002F\u002F Cleanup before deletion\n",{"type":39,"tag":108,"props":4794,"children":4795},{"class":110,"line":2696},[4796,4800,4805,4809,4813,4817,4821,4825],{"type":39,"tag":108,"props":4797,"children":4798},{"style":115},[4799],{"type":45,"value":2471},{"type":39,"tag":108,"props":4801,"children":4802},{"style":240},[4803],{"type":45,"value":4804}," archiveOrganizationData",{"type":39,"tag":108,"props":4806,"children":4807},{"style":259},[4808],{"type":45,"value":247},{"type":39,"tag":108,"props":4810,"children":4811},{"style":127},[4812],{"type":45,"value":717},{"type":39,"tag":108,"props":4814,"children":4815},{"style":121},[4816],{"type":45,"value":712},{"type":39,"tag":108,"props":4818,"children":4819},{"style":127},[4820],{"type":45,"value":2666},{"type":39,"tag":108,"props":4822,"children":4823},{"style":259},[4824],{"type":45,"value":384},{"type":39,"tag":108,"props":4826,"children":4827},{"style":121},[4828],{"type":45,"value":160},{"type":39,"tag":108,"props":4830,"children":4831},{"class":110,"line":2709},[4832],{"type":39,"tag":108,"props":4833,"children":4834},{"style":121},[4835],{"type":45,"value":2732},{"type":39,"tag":108,"props":4837,"children":4838},{"class":110,"line":2726},[4839],{"type":39,"tag":108,"props":4840,"children":4841},{"style":121},[4842],{"type":45,"value":4843},"    },\n",{"type":39,"tag":108,"props":4845,"children":4846},{"class":110,"line":2735},[4847,4851,4855],{"type":39,"tag":108,"props":4848,"children":4849},{"style":259},[4850],{"type":45,"value":4298},{"type":39,"tag":108,"props":4852,"children":4853},{"style":121},[4854],{"type":45,"value":267},{"type":39,"tag":108,"props":4856,"children":4857},{"style":121},[4858],{"type":45,"value":662},{"type":39,"tag":108,"props":4860,"children":4861},{"class":110,"line":2751},[4862,4866,4870,4874,4878,4882,4886,4890,4894,4898],{"type":39,"tag":108,"props":4863,"children":4864},{"style":240},[4865],{"type":45,"value":4660},{"type":39,"tag":108,"props":4867,"children":4868},{"style":121},[4869],{"type":45,"value":267},{"type":39,"tag":108,"props":4871,"children":4872},{"style":224},[4873],{"type":45,"value":647},{"type":39,"tag":108,"props":4875,"children":4876},{"style":121},[4877],{"type":45,"value":4490},{"type":39,"tag":108,"props":4879,"children":4880},{"style":945},[4881],{"type":45,"value":4685},{"type":39,"tag":108,"props":4883,"children":4884},{"style":121},[4885],{"type":45,"value":337},{"type":39,"tag":108,"props":4887,"children":4888},{"style":945},[4889],{"type":45,"value":177},{"type":39,"tag":108,"props":4891,"children":4892},{"style":121},[4893],{"type":45,"value":4507},{"type":39,"tag":108,"props":4895,"children":4896},{"style":224},[4897],{"type":45,"value":657},{"type":39,"tag":108,"props":4899,"children":4900},{"style":121},[4901],{"type":45,"value":662},{"type":39,"tag":108,"props":4903,"children":4904},{"class":110,"line":2763},[4905,4909,4914,4918,4922,4926,4930,4934,4938,4943,4948,4952],{"type":39,"tag":108,"props":4906,"children":4907},{"style":115},[4908],{"type":45,"value":2471},{"type":39,"tag":108,"props":4910,"children":4911},{"style":240},[4912],{"type":45,"value":4913}," notifyAdmins",{"type":39,"tag":108,"props":4915,"children":4916},{"style":259},[4917],{"type":45,"value":247},{"type":39,"tag":108,"props":4919,"children":4920},{"style":127},[4921],{"type":45,"value":717},{"type":39,"tag":108,"props":4923,"children":4924},{"style":121},[4925],{"type":45,"value":712},{"type":39,"tag":108,"props":4927,"children":4928},{"style":127},[4929],{"type":45,"value":2666},{"type":39,"tag":108,"props":4931,"children":4932},{"style":121},[4933],{"type":45,"value":337},{"type":39,"tag":108,"props":4935,"children":4936},{"style":121},[4937],{"type":45,"value":2521},{"type":39,"tag":108,"props":4939,"children":4940},{"style":148},[4941],{"type":45,"value":4942},"New member joined",{"type":39,"tag":108,"props":4944,"children":4945},{"style":121},[4946],{"type":45,"value":4947},"`",{"type":39,"tag":108,"props":4949,"children":4950},{"style":259},[4951],{"type":45,"value":384},{"type":39,"tag":108,"props":4953,"children":4954},{"style":121},[4955],{"type":45,"value":160},{"type":39,"tag":108,"props":4957,"children":4959},{"class":110,"line":4958},25,[4960],{"type":39,"tag":108,"props":4961,"children":4962},{"style":121},[4963],{"type":45,"value":2732},{"type":39,"tag":108,"props":4965,"children":4967},{"class":110,"line":4966},26,[4968],{"type":39,"tag":108,"props":4969,"children":4970},{"style":121},[4971],{"type":45,"value":4843},{"type":39,"tag":108,"props":4973,"children":4975},{"class":110,"line":4974},27,[4976,4980,4984],{"type":39,"tag":108,"props":4977,"children":4978},{"style":259},[4979],{"type":45,"value":4335},{"type":39,"tag":108,"props":4981,"children":4982},{"style":121},[4983],{"type":45,"value":267},{"type":39,"tag":108,"props":4985,"children":4986},{"style":121},[4987],{"type":45,"value":662},{"type":39,"tag":108,"props":4989,"children":4990},{"class":110,"line":27},[4991,4995,4999,5003,5007,5011,5015,5019,5023,5027,5031,5035],{"type":39,"tag":108,"props":4992,"children":4993},{"style":240},[4994],{"type":45,"value":4660},{"type":39,"tag":108,"props":4996,"children":4997},{"style":121},[4998],{"type":45,"value":267},{"type":39,"tag":108,"props":5000,"children":5001},{"style":224},[5002],{"type":45,"value":647},{"type":39,"tag":108,"props":5004,"children":5005},{"style":121},[5006],{"type":45,"value":4490},{"type":39,"tag":108,"props":5008,"children":5009},{"style":945},[5010],{"type":45,"value":2440},{"type":39,"tag":108,"props":5012,"children":5013},{"style":121},[5014],{"type":45,"value":337},{"type":39,"tag":108,"props":5016,"children":5017},{"style":945},[5018],{"type":45,"value":177},{"type":39,"tag":108,"props":5020,"children":5021},{"style":121},[5022],{"type":45,"value":337},{"type":39,"tag":108,"props":5024,"children":5025},{"style":945},[5026],{"type":45,"value":2431},{"type":39,"tag":108,"props":5028,"children":5029},{"style":121},[5030],{"type":45,"value":4507},{"type":39,"tag":108,"props":5032,"children":5033},{"style":224},[5034],{"type":45,"value":657},{"type":39,"tag":108,"props":5036,"children":5037},{"style":121},[5038],{"type":45,"value":662},{"type":39,"tag":108,"props":5040,"children":5042},{"class":110,"line":5041},29,[5043,5047,5052,5056,5060,5064],{"type":39,"tag":108,"props":5044,"children":5045},{"style":115},[5046],{"type":45,"value":2471},{"type":39,"tag":108,"props":5048,"children":5049},{"style":240},[5050],{"type":45,"value":5051}," logInvitation",{"type":39,"tag":108,"props":5053,"children":5054},{"style":259},[5055],{"type":45,"value":247},{"type":39,"tag":108,"props":5057,"children":5058},{"style":127},[5059],{"type":45,"value":2657},{"type":39,"tag":108,"props":5061,"children":5062},{"style":259},[5063],{"type":45,"value":384},{"type":39,"tag":108,"props":5065,"children":5066},{"style":121},[5067],{"type":45,"value":160},{"type":39,"tag":108,"props":5069,"children":5071},{"class":110,"line":5070},30,[5072],{"type":39,"tag":108,"props":5073,"children":5074},{"style":121},[5075],{"type":45,"value":2732},{"type":39,"tag":108,"props":5077,"children":5079},{"class":110,"line":5078},31,[5080],{"type":39,"tag":108,"props":5081,"children":5082},{"style":121},[5083],{"type":45,"value":4843},{"type":39,"tag":108,"props":5085,"children":5087},{"class":110,"line":5086},32,[5088],{"type":39,"tag":108,"props":5089,"children":5090},{"style":121},[5091],{"type":45,"value":1003},{"type":39,"tag":108,"props":5093,"children":5095},{"class":110,"line":5094},33,[5096,5100,5104],{"type":39,"tag":108,"props":5097,"children":5098},{"style":121},[5099],{"type":45,"value":410},{"type":39,"tag":108,"props":5101,"children":5102},{"style":127},[5103],{"type":45,"value":384},{"type":39,"tag":108,"props":5105,"children":5106},{"style":121},[5107],{"type":45,"value":160},{"type":39,"tag":40,"props":5109,"children":5111},{"id":5110},"schema-customization",[5112],{"type":45,"value":5113},"Schema Customization",{"type":39,"tag":606,"props":5115,"children":5116},{},[5117],{"type":45,"value":5118},"Customize table names, field names, and add additional fields:",{"type":39,"tag":97,"props":5120,"children":5122},{"className":99,"code":5121,"language":101,"meta":102,"style":102},"organization({\n  schema: {\n    organization: {\n      modelName: \"workspace\", \u002F\u002F Rename table\n      fields: {\n        name: \"workspaceName\", \u002F\u002F Rename fields\n      },\n      additionalFields: {\n        billingId: {\n          type: \"string\",\n          required: false,\n        },\n      },\n    },\n    member: {\n      additionalFields: {\n        department: {\n          type: \"string\",\n          required: false,\n        },\n        title: {\n          type: \"string\",\n          required: false,\n        },\n      },\n    },\n  },\n});\n",[5123],{"type":39,"tag":58,"props":5124,"children":5125},{"__ignoreMap":102},[5126,5141,5157,5172,5206,5222,5256,5263,5279,5295,5324,5344,5352,5359,5366,5381,5396,5412,5439,5458,5465,5481,5508,5527,5534,5541,5548,5555],{"type":39,"tag":108,"props":5127,"children":5128},{"class":110,"line":111},[5129,5133,5137],{"type":39,"tag":108,"props":5130,"children":5131},{"style":240},[5132],{"type":45,"value":717},{"type":39,"tag":108,"props":5134,"children":5135},{"style":127},[5136],{"type":45,"value":247},{"type":39,"tag":108,"props":5138,"children":5139},{"style":121},[5140],{"type":45,"value":252},{"type":39,"tag":108,"props":5142,"children":5143},{"class":110,"line":163},[5144,5149,5153],{"type":39,"tag":108,"props":5145,"children":5146},{"style":259},[5147],{"type":45,"value":5148},"  schema",{"type":39,"tag":108,"props":5150,"children":5151},{"style":121},[5152],{"type":45,"value":267},{"type":39,"tag":108,"props":5154,"children":5155},{"style":121},[5156],{"type":45,"value":662},{"type":39,"tag":108,"props":5158,"children":5159},{"class":110,"line":205},[5160,5164,5168],{"type":39,"tag":108,"props":5161,"children":5162},{"style":259},[5163],{"type":45,"value":281},{"type":39,"tag":108,"props":5165,"children":5166},{"style":121},[5167],{"type":45,"value":267},{"type":39,"tag":108,"props":5169,"children":5170},{"style":121},[5171],{"type":45,"value":662},{"type":39,"tag":108,"props":5173,"children":5174},{"class":110,"line":215},[5175,5180,5184,5188,5193,5197,5201],{"type":39,"tag":108,"props":5176,"children":5177},{"style":259},[5178],{"type":45,"value":5179},"      modelName",{"type":39,"tag":108,"props":5181,"children":5182},{"style":121},[5183],{"type":45,"value":267},{"type":39,"tag":108,"props":5185,"children":5186},{"style":121},[5187],{"type":45,"value":145},{"type":39,"tag":108,"props":5189,"children":5190},{"style":148},[5191],{"type":45,"value":5192},"workspace",{"type":39,"tag":108,"props":5194,"children":5195},{"style":121},[5196],{"type":45,"value":155},{"type":39,"tag":108,"props":5198,"children":5199},{"style":121},[5200],{"type":45,"value":337},{"type":39,"tag":108,"props":5202,"children":5203},{"style":340},[5204],{"type":45,"value":5205}," \u002F\u002F Rename table\n",{"type":39,"tag":108,"props":5207,"children":5208},{"class":110,"line":255},[5209,5214,5218],{"type":39,"tag":108,"props":5210,"children":5211},{"style":259},[5212],{"type":45,"value":5213},"      fields",{"type":39,"tag":108,"props":5215,"children":5216},{"style":121},[5217],{"type":45,"value":267},{"type":39,"tag":108,"props":5219,"children":5220},{"style":121},[5221],{"type":45,"value":662},{"type":39,"tag":108,"props":5223,"children":5224},{"class":110,"line":275},[5225,5230,5234,5238,5243,5247,5251],{"type":39,"tag":108,"props":5226,"children":5227},{"style":259},[5228],{"type":45,"value":5229},"        name",{"type":39,"tag":108,"props":5231,"children":5232},{"style":121},[5233],{"type":45,"value":267},{"type":39,"tag":108,"props":5235,"children":5236},{"style":121},[5237],{"type":45,"value":145},{"type":39,"tag":108,"props":5239,"children":5240},{"style":148},[5241],{"type":45,"value":5242},"workspaceName",{"type":39,"tag":108,"props":5244,"children":5245},{"style":121},[5246],{"type":45,"value":155},{"type":39,"tag":108,"props":5248,"children":5249},{"style":121},[5250],{"type":45,"value":337},{"type":39,"tag":108,"props":5252,"children":5253},{"style":340},[5254],{"type":45,"value":5255}," \u002F\u002F Rename fields\n",{"type":39,"tag":108,"props":5257,"children":5258},{"class":110,"line":292},[5259],{"type":39,"tag":108,"props":5260,"children":5261},{"style":121},[5262],{"type":45,"value":2732},{"type":39,"tag":108,"props":5264,"children":5265},{"class":110,"line":316},[5266,5271,5275],{"type":39,"tag":108,"props":5267,"children":5268},{"style":259},[5269],{"type":45,"value":5270},"      additionalFields",{"type":39,"tag":108,"props":5272,"children":5273},{"style":121},[5274],{"type":45,"value":267},{"type":39,"tag":108,"props":5276,"children":5277},{"style":121},[5278],{"type":45,"value":662},{"type":39,"tag":108,"props":5280,"children":5281},{"class":110,"line":346},[5282,5287,5291],{"type":39,"tag":108,"props":5283,"children":5284},{"style":259},[5285],{"type":45,"value":5286},"        billingId",{"type":39,"tag":108,"props":5288,"children":5289},{"style":121},[5290],{"type":45,"value":267},{"type":39,"tag":108,"props":5292,"children":5293},{"style":121},[5294],{"type":45,"value":662},{"type":39,"tag":108,"props":5296,"children":5297},{"class":110,"line":373},[5298,5303,5307,5311,5316,5320],{"type":39,"tag":108,"props":5299,"children":5300},{"style":259},[5301],{"type":45,"value":5302},"          type",{"type":39,"tag":108,"props":5304,"children":5305},{"style":121},[5306],{"type":45,"value":267},{"type":39,"tag":108,"props":5308,"children":5309},{"style":121},[5310],{"type":45,"value":145},{"type":39,"tag":108,"props":5312,"children":5313},{"style":148},[5314],{"type":45,"value":5315},"string",{"type":39,"tag":108,"props":5317,"children":5318},{"style":121},[5319],{"type":45,"value":155},{"type":39,"tag":108,"props":5321,"children":5322},{"style":121},[5323],{"type":45,"value":313},{"type":39,"tag":108,"props":5325,"children":5326},{"class":110,"line":391},[5327,5332,5336,5340],{"type":39,"tag":108,"props":5328,"children":5329},{"style":259},[5330],{"type":45,"value":5331},"          required",{"type":39,"tag":108,"props":5333,"children":5334},{"style":121},[5335],{"type":45,"value":267},{"type":39,"tag":108,"props":5337,"children":5338},{"style":305},[5339],{"type":45,"value":3921},{"type":39,"tag":108,"props":5341,"children":5342},{"style":121},[5343],{"type":45,"value":313},{"type":39,"tag":108,"props":5345,"children":5346},{"class":110,"line":404},[5347],{"type":39,"tag":108,"props":5348,"children":5349},{"style":121},[5350],{"type":45,"value":5351},"        },\n",{"type":39,"tag":108,"props":5353,"children":5354},{"class":110,"line":2506},[5355],{"type":39,"tag":108,"props":5356,"children":5357},{"style":121},[5358],{"type":45,"value":2732},{"type":39,"tag":108,"props":5360,"children":5361},{"class":110,"line":2556},[5362],{"type":39,"tag":108,"props":5363,"children":5364},{"style":121},[5365],{"type":45,"value":4843},{"type":39,"tag":108,"props":5367,"children":5368},{"class":110,"line":2574},[5369,5373,5377],{"type":39,"tag":108,"props":5370,"children":5371},{"style":259},[5372],{"type":45,"value":4298},{"type":39,"tag":108,"props":5374,"children":5375},{"style":121},[5376],{"type":45,"value":267},{"type":39,"tag":108,"props":5378,"children":5379},{"style":121},[5380],{"type":45,"value":662},{"type":39,"tag":108,"props":5382,"children":5383},{"class":110,"line":2642},[5384,5388,5392],{"type":39,"tag":108,"props":5385,"children":5386},{"style":259},[5387],{"type":45,"value":5270},{"type":39,"tag":108,"props":5389,"children":5390},{"style":121},[5391],{"type":45,"value":267},{"type":39,"tag":108,"props":5393,"children":5394},{"style":121},[5395],{"type":45,"value":662},{"type":39,"tag":108,"props":5397,"children":5398},{"class":110,"line":2678},[5399,5404,5408],{"type":39,"tag":108,"props":5400,"children":5401},{"style":259},[5402],{"type":45,"value":5403},"        department",{"type":39,"tag":108,"props":5405,"children":5406},{"style":121},[5407],{"type":45,"value":267},{"type":39,"tag":108,"props":5409,"children":5410},{"style":121},[5411],{"type":45,"value":662},{"type":39,"tag":108,"props":5413,"children":5414},{"class":110,"line":2687},[5415,5419,5423,5427,5431,5435],{"type":39,"tag":108,"props":5416,"children":5417},{"style":259},[5418],{"type":45,"value":5302},{"type":39,"tag":108,"props":5420,"children":5421},{"style":121},[5422],{"type":45,"value":267},{"type":39,"tag":108,"props":5424,"children":5425},{"style":121},[5426],{"type":45,"value":145},{"type":39,"tag":108,"props":5428,"children":5429},{"style":148},[5430],{"type":45,"value":5315},{"type":39,"tag":108,"props":5432,"children":5433},{"style":121},[5434],{"type":45,"value":155},{"type":39,"tag":108,"props":5436,"children":5437},{"style":121},[5438],{"type":45,"value":313},{"type":39,"tag":108,"props":5440,"children":5441},{"class":110,"line":2696},[5442,5446,5450,5454],{"type":39,"tag":108,"props":5443,"children":5444},{"style":259},[5445],{"type":45,"value":5331},{"type":39,"tag":108,"props":5447,"children":5448},{"style":121},[5449],{"type":45,"value":267},{"type":39,"tag":108,"props":5451,"children":5452},{"style":305},[5453],{"type":45,"value":3921},{"type":39,"tag":108,"props":5455,"children":5456},{"style":121},[5457],{"type":45,"value":313},{"type":39,"tag":108,"props":5459,"children":5460},{"class":110,"line":2709},[5461],{"type":39,"tag":108,"props":5462,"children":5463},{"style":121},[5464],{"type":45,"value":5351},{"type":39,"tag":108,"props":5466,"children":5467},{"class":110,"line":2726},[5468,5473,5477],{"type":39,"tag":108,"props":5469,"children":5470},{"style":259},[5471],{"type":45,"value":5472},"        title",{"type":39,"tag":108,"props":5474,"children":5475},{"style":121},[5476],{"type":45,"value":267},{"type":39,"tag":108,"props":5478,"children":5479},{"style":121},[5480],{"type":45,"value":662},{"type":39,"tag":108,"props":5482,"children":5483},{"class":110,"line":2735},[5484,5488,5492,5496,5500,5504],{"type":39,"tag":108,"props":5485,"children":5486},{"style":259},[5487],{"type":45,"value":5302},{"type":39,"tag":108,"props":5489,"children":5490},{"style":121},[5491],{"type":45,"value":267},{"type":39,"tag":108,"props":5493,"children":5494},{"style":121},[5495],{"type":45,"value":145},{"type":39,"tag":108,"props":5497,"children":5498},{"style":148},[5499],{"type":45,"value":5315},{"type":39,"tag":108,"props":5501,"children":5502},{"style":121},[5503],{"type":45,"value":155},{"type":39,"tag":108,"props":5505,"children":5506},{"style":121},[5507],{"type":45,"value":313},{"type":39,"tag":108,"props":5509,"children":5510},{"class":110,"line":2751},[5511,5515,5519,5523],{"type":39,"tag":108,"props":5512,"children":5513},{"style":259},[5514],{"type":45,"value":5331},{"type":39,"tag":108,"props":5516,"children":5517},{"style":121},[5518],{"type":45,"value":267},{"type":39,"tag":108,"props":5520,"children":5521},{"style":305},[5522],{"type":45,"value":3921},{"type":39,"tag":108,"props":5524,"children":5525},{"style":121},[5526],{"type":45,"value":313},{"type":39,"tag":108,"props":5528,"children":5529},{"class":110,"line":2763},[5530],{"type":39,"tag":108,"props":5531,"children":5532},{"style":121},[5533],{"type":45,"value":5351},{"type":39,"tag":108,"props":5535,"children":5536},{"class":110,"line":4958},[5537],{"type":39,"tag":108,"props":5538,"children":5539},{"style":121},[5540],{"type":45,"value":2732},{"type":39,"tag":108,"props":5542,"children":5543},{"class":110,"line":4966},[5544],{"type":39,"tag":108,"props":5545,"children":5546},{"style":121},[5547],{"type":45,"value":4843},{"type":39,"tag":108,"props":5549,"children":5550},{"class":110,"line":4974},[5551],{"type":39,"tag":108,"props":5552,"children":5553},{"style":121},[5554],{"type":45,"value":1003},{"type":39,"tag":108,"props":5556,"children":5557},{"class":110,"line":27},[5558,5562,5566],{"type":39,"tag":108,"props":5559,"children":5560},{"style":121},[5561],{"type":45,"value":410},{"type":39,"tag":108,"props":5563,"children":5564},{"style":127},[5565],{"type":45,"value":384},{"type":39,"tag":108,"props":5567,"children":5568},{"style":121},[5569],{"type":45,"value":160},{"type":39,"tag":40,"props":5571,"children":5573},{"id":5572},"security-considerations",[5574],{"type":45,"value":5575},"Security Considerations",{"type":39,"tag":420,"props":5577,"children":5579},{"id":5578},"owner-protection",[5580],{"type":45,"value":5581},"Owner Protection",{"type":39,"tag":5583,"props":5584,"children":5585},"ul",{},[5586,5591,5596],{"type":39,"tag":52,"props":5587,"children":5588},{},[5589],{"type":45,"value":5590},"The last owner cannot be removed from an organization",{"type":39,"tag":52,"props":5592,"children":5593},{},[5594],{"type":45,"value":5595},"The last owner cannot leave the organization",{"type":39,"tag":52,"props":5597,"children":5598},{},[5599],{"type":45,"value":5600},"The owner role cannot be removed from the last owner",{"type":39,"tag":606,"props":5602,"children":5603},{},[5604],{"type":45,"value":5605},"Always ensure ownership transfer before removing the current owner:",{"type":39,"tag":97,"props":5607,"children":5609},{"className":99,"code":5608,"language":101,"meta":102,"style":102},"\u002F\u002F Transfer ownership first\nawait authClient.organization.updateMemberRole({\n  memberId: \"new-owner-member-id\",\n  role: \"owner\",\n});\n\n\u002F\u002F Then the previous owner can be demoted or removed\n",[5610],{"type":39,"tag":58,"props":5611,"children":5612},{"__ignoreMap":102},[5613,5621,5657,5686,5713,5728,5735],{"type":39,"tag":108,"props":5614,"children":5615},{"class":110,"line":111},[5616],{"type":39,"tag":108,"props":5617,"children":5618},{"style":340},[5619],{"type":45,"value":5620},"\u002F\u002F Transfer ownership first\n",{"type":39,"tag":108,"props":5622,"children":5623},{"class":110,"line":163},[5624,5628,5632,5636,5640,5644,5649,5653],{"type":39,"tag":108,"props":5625,"children":5626},{"style":115},[5627],{"type":45,"value":1156},{"type":39,"tag":108,"props":5629,"children":5630},{"style":127},[5631],{"type":45,"value":707},{"type":39,"tag":108,"props":5633,"children":5634},{"style":121},[5635],{"type":45,"value":712},{"type":39,"tag":108,"props":5637,"children":5638},{"style":127},[5639],{"type":45,"value":717},{"type":39,"tag":108,"props":5641,"children":5642},{"style":121},[5643],{"type":45,"value":712},{"type":39,"tag":108,"props":5645,"children":5646},{"style":240},[5647],{"type":45,"value":5648},"updateMemberRole",{"type":39,"tag":108,"props":5650,"children":5651},{"style":127},[5652],{"type":45,"value":247},{"type":39,"tag":108,"props":5654,"children":5655},{"style":121},[5656],{"type":45,"value":252},{"type":39,"tag":108,"props":5658,"children":5659},{"class":110,"line":205},[5660,5665,5669,5673,5678,5682],{"type":39,"tag":108,"props":5661,"children":5662},{"style":259},[5663],{"type":45,"value":5664},"  memberId",{"type":39,"tag":108,"props":5666,"children":5667},{"style":121},[5668],{"type":45,"value":267},{"type":39,"tag":108,"props":5670,"children":5671},{"style":121},[5672],{"type":45,"value":145},{"type":39,"tag":108,"props":5674,"children":5675},{"style":148},[5676],{"type":45,"value":5677},"new-owner-member-id",{"type":39,"tag":108,"props":5679,"children":5680},{"style":121},[5681],{"type":45,"value":155},{"type":39,"tag":108,"props":5683,"children":5684},{"style":121},[5685],{"type":45,"value":313},{"type":39,"tag":108,"props":5687,"children":5688},{"class":110,"line":215},[5689,5693,5697,5701,5705,5709],{"type":39,"tag":108,"props":5690,"children":5691},{"style":259},[5692],{"type":45,"value":2861},{"type":39,"tag":108,"props":5694,"children":5695},{"style":121},[5696],{"type":45,"value":267},{"type":39,"tag":108,"props":5698,"children":5699},{"style":121},[5700],{"type":45,"value":145},{"type":39,"tag":108,"props":5702,"children":5703},{"style":148},[5704],{"type":45,"value":616},{"type":39,"tag":108,"props":5706,"children":5707},{"style":121},[5708],{"type":45,"value":155},{"type":39,"tag":108,"props":5710,"children":5711},{"style":121},[5712],{"type":45,"value":313},{"type":39,"tag":108,"props":5714,"children":5715},{"class":110,"line":255},[5716,5720,5724],{"type":39,"tag":108,"props":5717,"children":5718},{"style":121},[5719],{"type":45,"value":410},{"type":39,"tag":108,"props":5721,"children":5722},{"style":127},[5723],{"type":45,"value":384},{"type":39,"tag":108,"props":5725,"children":5726},{"style":121},[5727],{"type":45,"value":160},{"type":39,"tag":108,"props":5729,"children":5730},{"class":110,"line":275},[5731],{"type":39,"tag":108,"props":5732,"children":5733},{"emptyLinePlaceholder":209},[5734],{"type":45,"value":212},{"type":39,"tag":108,"props":5736,"children":5737},{"class":110,"line":292},[5738],{"type":39,"tag":108,"props":5739,"children":5740},{"style":340},[5741],{"type":45,"value":5742},"\u002F\u002F Then the previous owner can be demoted or removed\n",{"type":39,"tag":420,"props":5744,"children":5746},{"id":5745},"organization-deletion",[5747],{"type":45,"value":5748},"Organization Deletion",{"type":39,"tag":606,"props":5750,"children":5751},{},[5752],{"type":45,"value":5753},"Deleting an organization removes all associated data (members, invitations, teams). Prevent accidental deletion:",{"type":39,"tag":97,"props":5755,"children":5757},{"className":99,"code":5756,"language":101,"meta":102,"style":102},"organization({\n  disableOrganizationDeletion: true, \u002F\u002F Disable via config\n});\n",[5758],{"type":39,"tag":58,"props":5759,"children":5760},{"__ignoreMap":102},[5761,5776,5801],{"type":39,"tag":108,"props":5762,"children":5763},{"class":110,"line":111},[5764,5768,5772],{"type":39,"tag":108,"props":5765,"children":5766},{"style":240},[5767],{"type":45,"value":717},{"type":39,"tag":108,"props":5769,"children":5770},{"style":127},[5771],{"type":45,"value":247},{"type":39,"tag":108,"props":5773,"children":5774},{"style":121},[5775],{"type":45,"value":252},{"type":39,"tag":108,"props":5777,"children":5778},{"class":110,"line":163},[5779,5784,5788,5792,5796],{"type":39,"tag":108,"props":5780,"children":5781},{"style":259},[5782],{"type":45,"value":5783},"  disableOrganizationDeletion",{"type":39,"tag":108,"props":5785,"children":5786},{"style":121},[5787],{"type":45,"value":267},{"type":39,"tag":108,"props":5789,"children":5790},{"style":305},[5791],{"type":45,"value":308},{"type":39,"tag":108,"props":5793,"children":5794},{"style":121},[5795],{"type":45,"value":337},{"type":39,"tag":108,"props":5797,"children":5798},{"style":340},[5799],{"type":45,"value":5800}," \u002F\u002F Disable via config\n",{"type":39,"tag":108,"props":5802,"children":5803},{"class":110,"line":205},[5804,5808,5812],{"type":39,"tag":108,"props":5805,"children":5806},{"style":121},[5807],{"type":45,"value":410},{"type":39,"tag":108,"props":5809,"children":5810},{"style":127},[5811],{"type":45,"value":384},{"type":39,"tag":108,"props":5813,"children":5814},{"style":121},[5815],{"type":45,"value":160},{"type":39,"tag":606,"props":5817,"children":5818},{},[5819],{"type":45,"value":5820},"Or implement soft delete via hooks:",{"type":39,"tag":97,"props":5822,"children":5824},{"className":99,"code":5823,"language":101,"meta":102,"style":102},"organization({\n  hooks: {\n    organization: {\n      beforeDelete: async ({ organization }) => {\n        \u002F\u002F Archive instead of delete\n        await archiveOrganization(organization.id);\n        throw new Error(\"Organization archived, not deleted\");\n      },\n    },\n  },\n});\n",[5825],{"type":39,"tag":58,"props":5826,"children":5827},{"__ignoreMap":102},[5828,5843,5858,5873,5908,5916,5952,5995,6002,6009,6016],{"type":39,"tag":108,"props":5829,"children":5830},{"class":110,"line":111},[5831,5835,5839],{"type":39,"tag":108,"props":5832,"children":5833},{"style":240},[5834],{"type":45,"value":717},{"type":39,"tag":108,"props":5836,"children":5837},{"style":127},[5838],{"type":45,"value":247},{"type":39,"tag":108,"props":5840,"children":5841},{"style":121},[5842],{"type":45,"value":252},{"type":39,"tag":108,"props":5844,"children":5845},{"class":110,"line":163},[5846,5850,5854],{"type":39,"tag":108,"props":5847,"children":5848},{"style":259},[5849],{"type":45,"value":4446},{"type":39,"tag":108,"props":5851,"children":5852},{"style":121},[5853],{"type":45,"value":267},{"type":39,"tag":108,"props":5855,"children":5856},{"style":121},[5857],{"type":45,"value":662},{"type":39,"tag":108,"props":5859,"children":5860},{"class":110,"line":205},[5861,5865,5869],{"type":39,"tag":108,"props":5862,"children":5863},{"style":259},[5864],{"type":45,"value":281},{"type":39,"tag":108,"props":5866,"children":5867},{"style":121},[5868],{"type":45,"value":267},{"type":39,"tag":108,"props":5870,"children":5871},{"style":121},[5872],{"type":45,"value":662},{"type":39,"tag":108,"props":5874,"children":5875},{"class":110,"line":215},[5876,5880,5884,5888,5892,5896,5900,5904],{"type":39,"tag":108,"props":5877,"children":5878},{"style":240},[5879],{"type":45,"value":4756},{"type":39,"tag":108,"props":5881,"children":5882},{"style":121},[5883],{"type":45,"value":267},{"type":39,"tag":108,"props":5885,"children":5886},{"style":224},[5887],{"type":45,"value":647},{"type":39,"tag":108,"props":5889,"children":5890},{"style":121},[5891],{"type":45,"value":4490},{"type":39,"tag":108,"props":5893,"children":5894},{"style":945},[5895],{"type":45,"value":177},{"type":39,"tag":108,"props":5897,"children":5898},{"style":121},[5899],{"type":45,"value":4507},{"type":39,"tag":108,"props":5901,"children":5902},{"style":224},[5903],{"type":45,"value":657},{"type":39,"tag":108,"props":5905,"children":5906},{"style":121},[5907],{"type":45,"value":662},{"type":39,"tag":108,"props":5909,"children":5910},{"class":110,"line":255},[5911],{"type":39,"tag":108,"props":5912,"children":5913},{"style":340},[5914],{"type":45,"value":5915},"        \u002F\u002F Archive instead of delete\n",{"type":39,"tag":108,"props":5917,"children":5918},{"class":110,"line":275},[5919,5923,5928,5932,5936,5940,5944,5948],{"type":39,"tag":108,"props":5920,"children":5921},{"style":115},[5922],{"type":45,"value":2471},{"type":39,"tag":108,"props":5924,"children":5925},{"style":240},[5926],{"type":45,"value":5927}," archiveOrganization",{"type":39,"tag":108,"props":5929,"children":5930},{"style":259},[5931],{"type":45,"value":247},{"type":39,"tag":108,"props":5933,"children":5934},{"style":127},[5935],{"type":45,"value":717},{"type":39,"tag":108,"props":5937,"children":5938},{"style":121},[5939],{"type":45,"value":712},{"type":39,"tag":108,"props":5941,"children":5942},{"style":127},[5943],{"type":45,"value":2666},{"type":39,"tag":108,"props":5945,"children":5946},{"style":259},[5947],{"type":45,"value":384},{"type":39,"tag":108,"props":5949,"children":5950},{"style":121},[5951],{"type":45,"value":160},{"type":39,"tag":108,"props":5953,"children":5954},{"class":110,"line":292},[5955,5960,5965,5970,5974,5978,5983,5987,5991],{"type":39,"tag":108,"props":5956,"children":5957},{"style":115},[5958],{"type":45,"value":5959},"        throw",{"type":39,"tag":108,"props":5961,"children":5962},{"style":121},[5963],{"type":45,"value":5964}," new",{"type":39,"tag":108,"props":5966,"children":5967},{"style":240},[5968],{"type":45,"value":5969}," Error",{"type":39,"tag":108,"props":5971,"children":5972},{"style":259},[5973],{"type":45,"value":247},{"type":39,"tag":108,"props":5975,"children":5976},{"style":121},[5977],{"type":45,"value":155},{"type":39,"tag":108,"props":5979,"children":5980},{"style":148},[5981],{"type":45,"value":5982},"Organization archived, not deleted",{"type":39,"tag":108,"props":5984,"children":5985},{"style":121},[5986],{"type":45,"value":155},{"type":39,"tag":108,"props":5988,"children":5989},{"style":259},[5990],{"type":45,"value":384},{"type":39,"tag":108,"props":5992,"children":5993},{"style":121},[5994],{"type":45,"value":160},{"type":39,"tag":108,"props":5996,"children":5997},{"class":110,"line":316},[5998],{"type":39,"tag":108,"props":5999,"children":6000},{"style":121},[6001],{"type":45,"value":2732},{"type":39,"tag":108,"props":6003,"children":6004},{"class":110,"line":346},[6005],{"type":39,"tag":108,"props":6006,"children":6007},{"style":121},[6008],{"type":45,"value":4843},{"type":39,"tag":108,"props":6010,"children":6011},{"class":110,"line":373},[6012],{"type":39,"tag":108,"props":6013,"children":6014},{"style":121},[6015],{"type":45,"value":1003},{"type":39,"tag":108,"props":6017,"children":6018},{"class":110,"line":391},[6019,6023,6027],{"type":39,"tag":108,"props":6020,"children":6021},{"style":121},[6022],{"type":45,"value":410},{"type":39,"tag":108,"props":6024,"children":6025},{"style":127},[6026],{"type":45,"value":384},{"type":39,"tag":108,"props":6028,"children":6029},{"style":121},[6030],{"type":45,"value":160},{"type":39,"tag":420,"props":6032,"children":6034},{"id":6033},"invitation-security",[6035],{"type":45,"value":6036},"Invitation Security",{"type":39,"tag":5583,"props":6038,"children":6039},{},[6040,6045,6050],{"type":39,"tag":52,"props":6041,"children":6042},{},[6043],{"type":45,"value":6044},"Invitations expire after 48 hours by default",{"type":39,"tag":52,"props":6046,"children":6047},{},[6048],{"type":45,"value":6049},"Only the invited email address can accept an invitation",{"type":39,"tag":52,"props":6051,"children":6052},{},[6053],{"type":45,"value":6054},"Pending invitations can be cancelled by organization admins",{"type":39,"tag":40,"props":6056,"children":6058},{"id":6057},"complete-configuration-example",[6059],{"type":45,"value":6060},"Complete Configuration Example",{"type":39,"tag":97,"props":6062,"children":6064},{"className":99,"code":6063,"language":101,"meta":102,"style":102},"import { betterAuth } from \"better-auth\";\nimport { organization } from \"better-auth\u002Fplugins\";\nimport { sendEmail } from \".\u002Femail\";\n\nexport const auth = betterAuth({\n  plugins: [\n    organization({\n      \u002F\u002F Organization limits\n      allowUserToCreateOrganization: true,\n      organizationLimit: 10,\n      membershipLimit: 100,\n      creatorRole: \"owner\",\n\n      \u002F\u002F Slugs\n      defaultOrganizationIdField: \"slug\",\n\n      \u002F\u002F Invitations\n      invitationExpiresIn: 60 * 60 * 24 * 7, \u002F\u002F 7 days\n      invitationLimit: 50,\n      sendInvitationEmail: async (data) => {\n        await sendEmail({\n          to: data.email,\n          subject: `Join ${data.organization.name}`,\n          html: `\u003Ca href=\"https:\u002F\u002Fapp.com\u002Finvite\u002F${data.invitation.id}\">Accept\u003C\u002Fa>`,\n        });\n      },\n\n      \u002F\u002F Hooks\n      hooks: {\n        organization: {\n          afterCreate: async ({ organization }) => {\n            console.log(`Organization ${organization.name} created`);\n          },\n        },\n      },\n    }),\n  ],\n});\n",[6065],{"type":39,"tag":58,"props":6066,"children":6067},{"__ignoreMap":102},[6068,6107,6146,6185,6192,6223,6238,6253,6261,6280,6300,6319,6347,6354,6362,6391,6398,6406,6455,6475,6510,6529,6557,6608,6669,6684,6691,6698,6706,6722,6738,6774,6841,6848,6856,6864,6880,6892],{"type":39,"tag":108,"props":6069,"children":6070},{"class":110,"line":111},[6071,6075,6079,6083,6087,6091,6095,6099,6103],{"type":39,"tag":108,"props":6072,"children":6073},{"style":115},[6074],{"type":45,"value":118},{"type":39,"tag":108,"props":6076,"children":6077},{"style":121},[6078],{"type":45,"value":124},{"type":39,"tag":108,"props":6080,"children":6081},{"style":127},[6082],{"type":45,"value":130},{"type":39,"tag":108,"props":6084,"children":6085},{"style":121},[6086],{"type":45,"value":135},{"type":39,"tag":108,"props":6088,"children":6089},{"style":115},[6090],{"type":45,"value":140},{"type":39,"tag":108,"props":6092,"children":6093},{"style":121},[6094],{"type":45,"value":145},{"type":39,"tag":108,"props":6096,"children":6097},{"style":148},[6098],{"type":45,"value":8},{"type":39,"tag":108,"props":6100,"children":6101},{"style":121},[6102],{"type":45,"value":155},{"type":39,"tag":108,"props":6104,"children":6105},{"style":121},[6106],{"type":45,"value":160},{"type":39,"tag":108,"props":6108,"children":6109},{"class":110,"line":163},[6110,6114,6118,6122,6126,6130,6134,6138,6142],{"type":39,"tag":108,"props":6111,"children":6112},{"style":115},[6113],{"type":45,"value":118},{"type":39,"tag":108,"props":6115,"children":6116},{"style":121},[6117],{"type":45,"value":124},{"type":39,"tag":108,"props":6119,"children":6120},{"style":127},[6121],{"type":45,"value":177},{"type":39,"tag":108,"props":6123,"children":6124},{"style":121},[6125],{"type":45,"value":135},{"type":39,"tag":108,"props":6127,"children":6128},{"style":115},[6129],{"type":45,"value":140},{"type":39,"tag":108,"props":6131,"children":6132},{"style":121},[6133],{"type":45,"value":145},{"type":39,"tag":108,"props":6135,"children":6136},{"style":148},[6137],{"type":45,"value":194},{"type":39,"tag":108,"props":6139,"children":6140},{"style":121},[6141],{"type":45,"value":155},{"type":39,"tag":108,"props":6143,"children":6144},{"style":121},[6145],{"type":45,"value":160},{"type":39,"tag":108,"props":6147,"children":6148},{"class":110,"line":205},[6149,6153,6157,6161,6165,6169,6173,6177,6181],{"type":39,"tag":108,"props":6150,"children":6151},{"style":115},[6152],{"type":45,"value":118},{"type":39,"tag":108,"props":6154,"children":6155},{"style":121},[6156],{"type":45,"value":124},{"type":39,"tag":108,"props":6158,"children":6159},{"style":127},[6160],{"type":45,"value":2267},{"type":39,"tag":108,"props":6162,"children":6163},{"style":121},[6164],{"type":45,"value":135},{"type":39,"tag":108,"props":6166,"children":6167},{"style":115},[6168],{"type":45,"value":140},{"type":39,"tag":108,"props":6170,"children":6171},{"style":121},[6172],{"type":45,"value":145},{"type":39,"tag":108,"props":6174,"children":6175},{"style":148},[6176],{"type":45,"value":2284},{"type":39,"tag":108,"props":6178,"children":6179},{"style":121},[6180],{"type":45,"value":155},{"type":39,"tag":108,"props":6182,"children":6183},{"style":121},[6184],{"type":45,"value":160},{"type":39,"tag":108,"props":6186,"children":6187},{"class":110,"line":215},[6188],{"type":39,"tag":108,"props":6189,"children":6190},{"emptyLinePlaceholder":209},[6191],{"type":45,"value":212},{"type":39,"tag":108,"props":6193,"children":6194},{"class":110,"line":255},[6195,6199,6203,6207,6211,6215,6219],{"type":39,"tag":108,"props":6196,"children":6197},{"style":115},[6198],{"type":45,"value":221},{"type":39,"tag":108,"props":6200,"children":6201},{"style":224},[6202],{"type":45,"value":227},{"type":39,"tag":108,"props":6204,"children":6205},{"style":127},[6206],{"type":45,"value":232},{"type":39,"tag":108,"props":6208,"children":6209},{"style":121},[6210],{"type":45,"value":237},{"type":39,"tag":108,"props":6212,"children":6213},{"style":240},[6214],{"type":45,"value":130},{"type":39,"tag":108,"props":6216,"children":6217},{"style":127},[6218],{"type":45,"value":247},{"type":39,"tag":108,"props":6220,"children":6221},{"style":121},[6222],{"type":45,"value":252},{"type":39,"tag":108,"props":6224,"children":6225},{"class":110,"line":275},[6226,6230,6234],{"type":39,"tag":108,"props":6227,"children":6228},{"style":259},[6229],{"type":45,"value":262},{"type":39,"tag":108,"props":6231,"children":6232},{"style":121},[6233],{"type":45,"value":267},{"type":39,"tag":108,"props":6235,"children":6236},{"style":127},[6237],{"type":45,"value":272},{"type":39,"tag":108,"props":6239,"children":6240},{"class":110,"line":292},[6241,6245,6249],{"type":39,"tag":108,"props":6242,"children":6243},{"style":240},[6244],{"type":45,"value":281},{"type":39,"tag":108,"props":6246,"children":6247},{"style":127},[6248],{"type":45,"value":247},{"type":39,"tag":108,"props":6250,"children":6251},{"style":121},[6252],{"type":45,"value":252},{"type":39,"tag":108,"props":6254,"children":6255},{"class":110,"line":316},[6256],{"type":39,"tag":108,"props":6257,"children":6258},{"style":340},[6259],{"type":45,"value":6260},"      \u002F\u002F Organization limits\n",{"type":39,"tag":108,"props":6262,"children":6263},{"class":110,"line":346},[6264,6268,6272,6276],{"type":39,"tag":108,"props":6265,"children":6266},{"style":259},[6267],{"type":45,"value":298},{"type":39,"tag":108,"props":6269,"children":6270},{"style":121},[6271],{"type":45,"value":267},{"type":39,"tag":108,"props":6273,"children":6274},{"style":305},[6275],{"type":45,"value":308},{"type":39,"tag":108,"props":6277,"children":6278},{"style":121},[6279],{"type":45,"value":313},{"type":39,"tag":108,"props":6281,"children":6282},{"class":110,"line":373},[6283,6287,6291,6296],{"type":39,"tag":108,"props":6284,"children":6285},{"style":259},[6286],{"type":45,"value":322},{"type":39,"tag":108,"props":6288,"children":6289},{"style":121},[6290],{"type":45,"value":267},{"type":39,"tag":108,"props":6292,"children":6293},{"style":329},[6294],{"type":45,"value":6295}," 10",{"type":39,"tag":108,"props":6297,"children":6298},{"style":121},[6299],{"type":45,"value":313},{"type":39,"tag":108,"props":6301,"children":6302},{"class":110,"line":391},[6303,6307,6311,6315],{"type":39,"tag":108,"props":6304,"children":6305},{"style":259},[6306],{"type":45,"value":352},{"type":39,"tag":108,"props":6308,"children":6309},{"style":121},[6310],{"type":45,"value":267},{"type":39,"tag":108,"props":6312,"children":6313},{"style":329},[6314],{"type":45,"value":361},{"type":39,"tag":108,"props":6316,"children":6317},{"style":121},[6318],{"type":45,"value":313},{"type":39,"tag":108,"props":6320,"children":6321},{"class":110,"line":404},[6322,6327,6331,6335,6339,6343],{"type":39,"tag":108,"props":6323,"children":6324},{"style":259},[6325],{"type":45,"value":6326},"      creatorRole",{"type":39,"tag":108,"props":6328,"children":6329},{"style":121},[6330],{"type":45,"value":267},{"type":39,"tag":108,"props":6332,"children":6333},{"style":121},[6334],{"type":45,"value":145},{"type":39,"tag":108,"props":6336,"children":6337},{"style":148},[6338],{"type":45,"value":616},{"type":39,"tag":108,"props":6340,"children":6341},{"style":121},[6342],{"type":45,"value":155},{"type":39,"tag":108,"props":6344,"children":6345},{"style":121},[6346],{"type":45,"value":313},{"type":39,"tag":108,"props":6348,"children":6349},{"class":110,"line":2506},[6350],{"type":39,"tag":108,"props":6351,"children":6352},{"emptyLinePlaceholder":209},[6353],{"type":45,"value":212},{"type":39,"tag":108,"props":6355,"children":6356},{"class":110,"line":2556},[6357],{"type":39,"tag":108,"props":6358,"children":6359},{"style":340},[6360],{"type":45,"value":6361},"      \u002F\u002F Slugs\n",{"type":39,"tag":108,"props":6363,"children":6364},{"class":110,"line":2574},[6365,6370,6374,6378,6383,6387],{"type":39,"tag":108,"props":6366,"children":6367},{"style":259},[6368],{"type":45,"value":6369},"      defaultOrganizationIdField",{"type":39,"tag":108,"props":6371,"children":6372},{"style":121},[6373],{"type":45,"value":267},{"type":39,"tag":108,"props":6375,"children":6376},{"style":121},[6377],{"type":45,"value":145},{"type":39,"tag":108,"props":6379,"children":6380},{"style":148},[6381],{"type":45,"value":6382},"slug",{"type":39,"tag":108,"props":6384,"children":6385},{"style":121},[6386],{"type":45,"value":155},{"type":39,"tag":108,"props":6388,"children":6389},{"style":121},[6390],{"type":45,"value":313},{"type":39,"tag":108,"props":6392,"children":6393},{"class":110,"line":2642},[6394],{"type":39,"tag":108,"props":6395,"children":6396},{"emptyLinePlaceholder":209},[6397],{"type":45,"value":212},{"type":39,"tag":108,"props":6399,"children":6400},{"class":110,"line":2678},[6401],{"type":39,"tag":108,"props":6402,"children":6403},{"style":340},[6404],{"type":45,"value":6405},"      \u002F\u002F Invitations\n",{"type":39,"tag":108,"props":6407,"children":6408},{"class":110,"line":2687},[6409,6414,6418,6422,6426,6430,6434,6438,6442,6446,6450],{"type":39,"tag":108,"props":6410,"children":6411},{"style":259},[6412],{"type":45,"value":6413},"      invitationExpiresIn",{"type":39,"tag":108,"props":6415,"children":6416},{"style":121},[6417],{"type":45,"value":267},{"type":39,"tag":108,"props":6419,"children":6420},{"style":329},[6421],{"type":45,"value":3137},{"type":39,"tag":108,"props":6423,"children":6424},{"style":121},[6425],{"type":45,"value":3142},{"type":39,"tag":108,"props":6427,"children":6428},{"style":329},[6429],{"type":45,"value":3137},{"type":39,"tag":108,"props":6431,"children":6432},{"style":121},[6433],{"type":45,"value":3142},{"type":39,"tag":108,"props":6435,"children":6436},{"style":329},[6437],{"type":45,"value":3155},{"type":39,"tag":108,"props":6439,"children":6440},{"style":121},[6441],{"type":45,"value":3142},{"type":39,"tag":108,"props":6443,"children":6444},{"style":329},[6445],{"type":45,"value":3164},{"type":39,"tag":108,"props":6447,"children":6448},{"style":121},[6449],{"type":45,"value":337},{"type":39,"tag":108,"props":6451,"children":6452},{"style":340},[6453],{"type":45,"value":6454}," \u002F\u002F 7 days\n",{"type":39,"tag":108,"props":6456,"children":6457},{"class":110,"line":2696},[6458,6463,6467,6471],{"type":39,"tag":108,"props":6459,"children":6460},{"style":259},[6461],{"type":45,"value":6462},"      invitationLimit",{"type":39,"tag":108,"props":6464,"children":6465},{"style":121},[6466],{"type":45,"value":267},{"type":39,"tag":108,"props":6468,"children":6469},{"style":329},[6470],{"type":45,"value":2128},{"type":39,"tag":108,"props":6472,"children":6473},{"style":121},[6474],{"type":45,"value":313},{"type":39,"tag":108,"props":6476,"children":6477},{"class":110,"line":2709},[6478,6482,6486,6490,6494,6498,6502,6506],{"type":39,"tag":108,"props":6479,"children":6480},{"style":240},[6481],{"type":45,"value":2368},{"type":39,"tag":108,"props":6483,"children":6484},{"style":121},[6485],{"type":45,"value":267},{"type":39,"tag":108,"props":6487,"children":6488},{"style":224},[6489],{"type":45,"value":647},{"type":39,"tag":108,"props":6491,"children":6492},{"style":121},[6493],{"type":45,"value":942},{"type":39,"tag":108,"props":6495,"children":6496},{"style":945},[6497],{"type":45,"value":2385},{"type":39,"tag":108,"props":6499,"children":6500},{"style":121},[6501],{"type":45,"value":384},{"type":39,"tag":108,"props":6503,"children":6504},{"style":224},[6505],{"type":45,"value":657},{"type":39,"tag":108,"props":6507,"children":6508},{"style":121},[6509],{"type":45,"value":662},{"type":39,"tag":108,"props":6511,"children":6512},{"class":110,"line":2726},[6513,6517,6521,6525],{"type":39,"tag":108,"props":6514,"children":6515},{"style":115},[6516],{"type":45,"value":2471},{"type":39,"tag":108,"props":6518,"children":6519},{"style":240},[6520],{"type":45,"value":2267},{"type":39,"tag":108,"props":6522,"children":6523},{"style":259},[6524],{"type":45,"value":247},{"type":39,"tag":108,"props":6526,"children":6527},{"style":121},[6528],{"type":45,"value":252},{"type":39,"tag":108,"props":6530,"children":6531},{"class":110,"line":2735},[6532,6536,6540,6544,6548,6553],{"type":39,"tag":108,"props":6533,"children":6534},{"style":259},[6535],{"type":45,"value":2491},{"type":39,"tag":108,"props":6537,"children":6538},{"style":121},[6539],{"type":45,"value":267},{"type":39,"tag":108,"props":6541,"children":6542},{"style":127},[6543],{"type":45,"value":679},{"type":39,"tag":108,"props":6545,"children":6546},{"style":121},[6547],{"type":45,"value":712},{"type":39,"tag":108,"props":6549,"children":6550},{"style":127},[6551],{"type":45,"value":6552},"email",{"type":39,"tag":108,"props":6554,"children":6555},{"style":121},[6556],{"type":45,"value":313},{"type":39,"tag":108,"props":6558,"children":6559},{"class":110,"line":2751},[6560,6564,6568,6572,6576,6580,6584,6588,6592,6596,6600,6604],{"type":39,"tag":108,"props":6561,"children":6562},{"style":259},[6563],{"type":45,"value":2512},{"type":39,"tag":108,"props":6565,"children":6566},{"style":121},[6567],{"type":45,"value":267},{"type":39,"tag":108,"props":6569,"children":6570},{"style":121},[6571],{"type":45,"value":2521},{"type":39,"tag":108,"props":6573,"children":6574},{"style":148},[6575],{"type":45,"value":2526},{"type":39,"tag":108,"props":6577,"children":6578},{"style":121},[6579],{"type":45,"value":2531},{"type":39,"tag":108,"props":6581,"children":6582},{"style":127},[6583],{"type":45,"value":2385},{"type":39,"tag":108,"props":6585,"children":6586},{"style":121},[6587],{"type":45,"value":712},{"type":39,"tag":108,"props":6589,"children":6590},{"style":127},[6591],{"type":45,"value":717},{"type":39,"tag":108,"props":6593,"children":6594},{"style":121},[6595],{"type":45,"value":712},{"type":39,"tag":108,"props":6597,"children":6598},{"style":127},[6599],{"type":45,"value":2544},{"type":39,"tag":108,"props":6601,"children":6602},{"style":121},[6603],{"type":45,"value":2549},{"type":39,"tag":108,"props":6605,"children":6606},{"style":121},[6607],{"type":45,"value":313},{"type":39,"tag":108,"props":6609,"children":6610},{"class":110,"line":2763},[6611,6615,6619,6623,6628,6632,6636,6640,6644,6648,6652,6656,6661,6665],{"type":39,"tag":108,"props":6612,"children":6613},{"style":259},[6614],{"type":45,"value":2562},{"type":39,"tag":108,"props":6616,"children":6617},{"style":121},[6618],{"type":45,"value":267},{"type":39,"tag":108,"props":6620,"children":6621},{"style":121},[6622],{"type":45,"value":2521},{"type":39,"tag":108,"props":6624,"children":6625},{"style":148},[6626],{"type":45,"value":6627},"\u003Ca href=\"https:\u002F\u002Fapp.com\u002Finvite\u002F",{"type":39,"tag":108,"props":6629,"children":6630},{"style":121},[6631],{"type":45,"value":2531},{"type":39,"tag":108,"props":6633,"children":6634},{"style":127},[6635],{"type":45,"value":2385},{"type":39,"tag":108,"props":6637,"children":6638},{"style":121},[6639],{"type":45,"value":712},{"type":39,"tag":108,"props":6641,"children":6642},{"style":127},[6643],{"type":45,"value":2657},{"type":39,"tag":108,"props":6645,"children":6646},{"style":121},[6647],{"type":45,"value":712},{"type":39,"tag":108,"props":6649,"children":6650},{"style":127},[6651],{"type":45,"value":2666},{"type":39,"tag":108,"props":6653,"children":6654},{"style":121},[6655],{"type":45,"value":410},{"type":39,"tag":108,"props":6657,"children":6658},{"style":148},[6659],{"type":45,"value":6660},"\">Accept\u003C\u002Fa>",{"type":39,"tag":108,"props":6662,"children":6663},{"style":121},[6664],{"type":45,"value":4947},{"type":39,"tag":108,"props":6666,"children":6667},{"style":121},[6668],{"type":45,"value":313},{"type":39,"tag":108,"props":6670,"children":6671},{"class":110,"line":4958},[6672,6676,6680],{"type":39,"tag":108,"props":6673,"children":6674},{"style":121},[6675],{"type":45,"value":2715},{"type":39,"tag":108,"props":6677,"children":6678},{"style":259},[6679],{"type":45,"value":384},{"type":39,"tag":108,"props":6681,"children":6682},{"style":121},[6683],{"type":45,"value":160},{"type":39,"tag":108,"props":6685,"children":6686},{"class":110,"line":4966},[6687],{"type":39,"tag":108,"props":6688,"children":6689},{"style":121},[6690],{"type":45,"value":2732},{"type":39,"tag":108,"props":6692,"children":6693},{"class":110,"line":4974},[6694],{"type":39,"tag":108,"props":6695,"children":6696},{"emptyLinePlaceholder":209},[6697],{"type":45,"value":212},{"type":39,"tag":108,"props":6699,"children":6700},{"class":110,"line":27},[6701],{"type":39,"tag":108,"props":6702,"children":6703},{"style":340},[6704],{"type":45,"value":6705},"      \u002F\u002F Hooks\n",{"type":39,"tag":108,"props":6707,"children":6708},{"class":110,"line":5041},[6709,6714,6718],{"type":39,"tag":108,"props":6710,"children":6711},{"style":259},[6712],{"type":45,"value":6713},"      hooks",{"type":39,"tag":108,"props":6715,"children":6716},{"style":121},[6717],{"type":45,"value":267},{"type":39,"tag":108,"props":6719,"children":6720},{"style":121},[6721],{"type":45,"value":662},{"type":39,"tag":108,"props":6723,"children":6724},{"class":110,"line":5070},[6725,6730,6734],{"type":39,"tag":108,"props":6726,"children":6727},{"style":259},[6728],{"type":45,"value":6729},"        organization",{"type":39,"tag":108,"props":6731,"children":6732},{"style":121},[6733],{"type":45,"value":267},{"type":39,"tag":108,"props":6735,"children":6736},{"style":121},[6737],{"type":45,"value":662},{"type":39,"tag":108,"props":6739,"children":6740},{"class":110,"line":5078},[6741,6746,6750,6754,6758,6762,6766,6770],{"type":39,"tag":108,"props":6742,"children":6743},{"style":240},[6744],{"type":45,"value":6745},"          afterCreate",{"type":39,"tag":108,"props":6747,"children":6748},{"style":121},[6749],{"type":45,"value":267},{"type":39,"tag":108,"props":6751,"children":6752},{"style":224},[6753],{"type":45,"value":647},{"type":39,"tag":108,"props":6755,"children":6756},{"style":121},[6757],{"type":45,"value":4490},{"type":39,"tag":108,"props":6759,"children":6760},{"style":945},[6761],{"type":45,"value":177},{"type":39,"tag":108,"props":6763,"children":6764},{"style":121},[6765],{"type":45,"value":4507},{"type":39,"tag":108,"props":6767,"children":6768},{"style":224},[6769],{"type":45,"value":657},{"type":39,"tag":108,"props":6771,"children":6772},{"style":121},[6773],{"type":45,"value":662},{"type":39,"tag":108,"props":6775,"children":6776},{"class":110,"line":5086},[6777,6782,6786,6791,6795,6799,6804,6808,6812,6816,6820,6824,6829,6833,6837],{"type":39,"tag":108,"props":6778,"children":6779},{"style":127},[6780],{"type":45,"value":6781},"            console",{"type":39,"tag":108,"props":6783,"children":6784},{"style":121},[6785],{"type":45,"value":712},{"type":39,"tag":108,"props":6787,"children":6788},{"style":240},[6789],{"type":45,"value":6790},"log",{"type":39,"tag":108,"props":6792,"children":6793},{"style":259},[6794],{"type":45,"value":247},{"type":39,"tag":108,"props":6796,"children":6797},{"style":121},[6798],{"type":45,"value":4947},{"type":39,"tag":108,"props":6800,"children":6801},{"style":148},[6802],{"type":45,"value":6803},"Organization ",{"type":39,"tag":108,"props":6805,"children":6806},{"style":121},[6807],{"type":45,"value":2531},{"type":39,"tag":108,"props":6809,"children":6810},{"style":127},[6811],{"type":45,"value":717},{"type":39,"tag":108,"props":6813,"children":6814},{"style":121},[6815],{"type":45,"value":712},{"type":39,"tag":108,"props":6817,"children":6818},{"style":127},[6819],{"type":45,"value":2544},{"type":39,"tag":108,"props":6821,"children":6822},{"style":121},[6823],{"type":45,"value":410},{"type":39,"tag":108,"props":6825,"children":6826},{"style":148},[6827],{"type":45,"value":6828}," created",{"type":39,"tag":108,"props":6830,"children":6831},{"style":121},[6832],{"type":45,"value":4947},{"type":39,"tag":108,"props":6834,"children":6835},{"style":259},[6836],{"type":45,"value":384},{"type":39,"tag":108,"props":6838,"children":6839},{"style":121},[6840],{"type":45,"value":160},{"type":39,"tag":108,"props":6842,"children":6843},{"class":110,"line":5094},[6844],{"type":39,"tag":108,"props":6845,"children":6846},{"style":121},[6847],{"type":45,"value":4637},{"type":39,"tag":108,"props":6849,"children":6851},{"class":110,"line":6850},34,[6852],{"type":39,"tag":108,"props":6853,"children":6854},{"style":121},[6855],{"type":45,"value":5351},{"type":39,"tag":108,"props":6857,"children":6859},{"class":110,"line":6858},35,[6860],{"type":39,"tag":108,"props":6861,"children":6862},{"style":121},[6863],{"type":45,"value":2732},{"type":39,"tag":108,"props":6865,"children":6867},{"class":110,"line":6866},36,[6868,6872,6876],{"type":39,"tag":108,"props":6869,"children":6870},{"style":121},[6871],{"type":45,"value":379},{"type":39,"tag":108,"props":6873,"children":6874},{"style":127},[6875],{"type":45,"value":384},{"type":39,"tag":108,"props":6877,"children":6878},{"style":121},[6879],{"type":45,"value":313},{"type":39,"tag":108,"props":6881,"children":6883},{"class":110,"line":6882},37,[6884,6888],{"type":39,"tag":108,"props":6885,"children":6886},{"style":127},[6887],{"type":45,"value":397},{"type":39,"tag":108,"props":6889,"children":6890},{"style":121},[6891],{"type":45,"value":313},{"type":39,"tag":108,"props":6893,"children":6895},{"class":110,"line":6894},38,[6896,6900,6904],{"type":39,"tag":108,"props":6897,"children":6898},{"style":121},[6899],{"type":45,"value":410},{"type":39,"tag":108,"props":6901,"children":6902},{"style":127},[6903],{"type":45,"value":384},{"type":39,"tag":108,"props":6905,"children":6906},{"style":121},[6907],{"type":45,"value":160},{"type":39,"tag":6909,"props":6910,"children":6911},"style",{},[6912],{"type":45,"value":6913},"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);}",{"items":6915,"total":275},[6916,6931,6946,6959,6970,6977],{"slug":6917,"name":6917,"fn":6918,"description":6919,"org":6920,"tags":6921,"stars":23,"repoUrl":24,"updatedAt":6930},"better-auth-best-practices","configure Better Auth servers and clients","Configure Better Auth server and client, set up database adapters, manage sessions, add plugins, and handle environment variables. Use when users mention Better Auth, betterauth, auth.ts, or need to set up TypeScript authentication with email\u002Fpassword, OAuth, or plugin configuration.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[6922,6923,6924,6927],{"name":15,"slug":16,"type":13},{"name":9,"slug":8,"type":13},{"name":6925,"slug":6926,"type":13},"Sessions","sessions",{"name":6928,"slug":6929,"type":13},"TypeScript","typescript","2026-04-06T18:05:01.910941",{"slug":6932,"name":6932,"fn":6933,"description":6934,"org":6935,"tags":6936,"stars":23,"repoUrl":24,"updatedAt":6945},"better-auth-security-best-practices","configure security best practices for Better Auth","Configure rate limiting, manage auth secrets, set up CSRF protection, define trusted origins, secure sessions and cookies, encrypt OAuth tokens, track IP addresses, and implement audit logging for Better Auth. Use when users need to secure their auth setup, prevent brute force attacks, or harden a Better Auth deployment.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[6937,6940,6941,6942],{"name":6938,"slug":6939,"type":13},"Audit","audit",{"name":15,"slug":16,"type":13},{"name":9,"slug":8,"type":13},{"name":6943,"slug":6944,"type":13},"Security","security","2026-07-11T05:40:04.318478",{"slug":6947,"name":6947,"fn":6948,"description":6949,"org":6950,"tags":6951,"stars":23,"repoUrl":24,"updatedAt":6958},"create-auth","scaffold Better Auth in TypeScript apps","Scaffold and implement authentication in TypeScript\u002FJavaScript apps using Better Auth. Detect frameworks, configure database adapters, set up route handlers, add OAuth providers, and create auth UI pages. Use when users want to add login, sign-up, or authentication to a new or existing project with Better Auth.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[6952,6953,6954,6957],{"name":15,"slug":16,"type":13},{"name":9,"slug":8,"type":13},{"name":6955,"slug":6956,"type":13},"OAuth","oauth",{"name":6928,"slug":6929,"type":13},"2026-04-06T18:04:59.364175",{"slug":6960,"name":6960,"fn":6961,"description":6962,"org":6963,"tags":6964,"stars":23,"repoUrl":24,"updatedAt":6969},"email-and-password-best-practices","configure Better Auth email and password flows","Configure email verification, implement password reset flows, set password policies, and customise hashing algorithms for Better Auth email\u002Fpassword authentication. Use when users need to set up login, sign-in, sign-up, credential authentication, or password security with Better Auth.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[6965,6966,6967],{"name":15,"slug":16,"type":13},{"name":9,"slug":8,"type":13},{"name":6968,"slug":6552,"type":13},"Email","2026-04-06T18:05:03.185369",{"slug":4,"name":4,"fn":5,"description":6,"org":6971,"tags":6972,"stars":23,"repoUrl":24,"updatedAt":25},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[6973,6974,6975,6976],{"name":15,"slug":16,"type":13},{"name":9,"slug":8,"type":13},{"name":18,"slug":19,"type":13},{"name":21,"slug":22,"type":13},{"slug":6978,"name":6978,"fn":6979,"description":6980,"org":6981,"tags":6982,"stars":23,"repoUrl":24,"updatedAt":6991},"two-factor-authentication-best-practices","set up 2FA flows in Better Auth","Configure TOTP authenticator apps, send OTP codes via email\u002FSMS, manage backup codes, handle trusted devices, and implement 2FA sign-in flows using Better Auth's twoFactor plugin. Use when users need MFA, multi-factor authentication, authenticator setup, or login security with Better Auth.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[6983,6986,6987,6988],{"name":6984,"slug":6985,"type":13},"2FA","two-factor-auth",{"name":15,"slug":16,"type":13},{"name":9,"slug":8,"type":13},{"name":6989,"slug":6990,"type":13},"MFA","mfa","2026-04-06T18:04:58.118682",{"items":6993,"total":275},[6994,7001,7008,7015,7021,7028],{"slug":6917,"name":6917,"fn":6918,"description":6919,"org":6995,"tags":6996,"stars":23,"repoUrl":24,"updatedAt":6930},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[6997,6998,6999,7000],{"name":15,"slug":16,"type":13},{"name":9,"slug":8,"type":13},{"name":6925,"slug":6926,"type":13},{"name":6928,"slug":6929,"type":13},{"slug":6932,"name":6932,"fn":6933,"description":6934,"org":7002,"tags":7003,"stars":23,"repoUrl":24,"updatedAt":6945},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7004,7005,7006,7007],{"name":6938,"slug":6939,"type":13},{"name":15,"slug":16,"type":13},{"name":9,"slug":8,"type":13},{"name":6943,"slug":6944,"type":13},{"slug":6947,"name":6947,"fn":6948,"description":6949,"org":7009,"tags":7010,"stars":23,"repoUrl":24,"updatedAt":6958},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7011,7012,7013,7014],{"name":15,"slug":16,"type":13},{"name":9,"slug":8,"type":13},{"name":6955,"slug":6956,"type":13},{"name":6928,"slug":6929,"type":13},{"slug":6960,"name":6960,"fn":6961,"description":6962,"org":7016,"tags":7017,"stars":23,"repoUrl":24,"updatedAt":6969},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7018,7019,7020],{"name":15,"slug":16,"type":13},{"name":9,"slug":8,"type":13},{"name":6968,"slug":6552,"type":13},{"slug":4,"name":4,"fn":5,"description":6,"org":7022,"tags":7023,"stars":23,"repoUrl":24,"updatedAt":25},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7024,7025,7026,7027],{"name":15,"slug":16,"type":13},{"name":9,"slug":8,"type":13},{"name":18,"slug":19,"type":13},{"name":21,"slug":22,"type":13},{"slug":6978,"name":6978,"fn":6979,"description":6980,"org":7029,"tags":7030,"stars":23,"repoUrl":24,"updatedAt":6991},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7031,7032,7033,7034],{"name":6984,"slug":6985,"type":13},{"name":15,"slug":16,"type":13},{"name":9,"slug":8,"type":13},{"name":6989,"slug":6990,"type":13}]