[PR #378] [MERGED] Add API option to add member without invite #11506

Closed
opened 2026-04-13 07:49:30 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/378
Author: @Elliot-Alexander
Created: 10/31/2024
Status: Merged
Merged: 11/22/2024
Merged by: @Bekacru

Base: nextHead: add-member


📝 Commits (6)

  • b0641b2 feat(organization): add api to add member without invite
  • 4bd69c4 Merge branch 'main' into add-member
  • 1cca9bd chore: update demo
  • 8402471 Merge branch 'main' into add-member
  • 07d7bd0 Merge remote-tracking branch 'origin/main' into add-member
  • 8a5e0c0 refactor

📊 Changes

6 files changed (+114 additions, -2 deletions)

View changed files

📝 demo/nextjs/app/dashboard/user-card.tsx (+0 -1)
📝 docs/content/docs/plugins/organization.mdx (+15 -0)
📝 packages/better-auth/src/api/routes/session.ts (+1 -1)
📝 packages/better-auth/src/plugins/organization/organization.test.ts (+25 -0)
📝 packages/better-auth/src/plugins/organization/organization.ts (+2 -0)
📝 packages/better-auth/src/plugins/organization/routes/crud-members.ts (+71 -0)

📄 Description

Changes to the organization plugin that adds a new method to add members to a specified organization. Realistically I see this being primarily server side, so keen to get some guidance around the implementation.
The use case I had in mind was potentially allow organization admins to add others into org directly, without invite; to speed up onboarding and allow for better org management.

await client.organization.addMember({
	organizationId: orgId,
	userIdOrEmail: "test2@test.com",
	role: "member",
});

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/378 **Author:** [@Elliot-Alexander](https://github.com/Elliot-Alexander) **Created:** 10/31/2024 **Status:** ✅ Merged **Merged:** 11/22/2024 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `next` ← **Head:** `add-member` --- ### 📝 Commits (6) - [`b0641b2`](https://github.com/better-auth/better-auth/commit/b0641b2a5372bdb281a873e752139adb8070ed6d) feat(organization): add api to add member without invite - [`4bd69c4`](https://github.com/better-auth/better-auth/commit/4bd69c463ce519fedf8778c01650362230a3706e) Merge branch 'main' into add-member - [`1cca9bd`](https://github.com/better-auth/better-auth/commit/1cca9bd6fd53cb2e3a263ade0f64cc99bcc0e4c4) chore: update demo - [`8402471`](https://github.com/better-auth/better-auth/commit/8402471a76e3a3b3dc1047ef6bbb85254a7f0b4a) Merge branch 'main' into add-member - [`07d7bd0`](https://github.com/better-auth/better-auth/commit/07d7bd017616785f0b427ef96d2d3e3867db6244) Merge remote-tracking branch 'origin/main' into add-member - [`8a5e0c0`](https://github.com/better-auth/better-auth/commit/8a5e0c013e9dee6cf991c7f99425b2e8d3d96d66) refactor ### 📊 Changes **6 files changed** (+114 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `demo/nextjs/app/dashboard/user-card.tsx` (+0 -1) 📝 `docs/content/docs/plugins/organization.mdx` (+15 -0) 📝 `packages/better-auth/src/api/routes/session.ts` (+1 -1) 📝 `packages/better-auth/src/plugins/organization/organization.test.ts` (+25 -0) 📝 `packages/better-auth/src/plugins/organization/organization.ts` (+2 -0) 📝 `packages/better-auth/src/plugins/organization/routes/crud-members.ts` (+71 -0) </details> ### 📄 Description Changes to the organization plugin that adds a new method to add members to a specified organization. Realistically I see this being primarily server side, so keen to get some guidance around the implementation. The use case I had in mind was potentially allow organization admins to add others into org directly, without invite; to speed up onboarding and allow for better org management. ```typescript await client.organization.addMember({ organizationId: orgId, userIdOrEmail: "test2@test.com", role: "member", }); ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-13 07:49:30 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#11506