[GH-ISSUE #7012] allow passing userId for listUserTeams API #19333

Open
opened 2026-04-15 18:16:45 -05:00 by GiteaMirror · 5 comments
Owner

Originally created by @xmlking on GitHub (Dec 27, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/7012

Originally assigned to: @ping-maxwell on GitHub.

Is this suited for github?

  • Yes, this is suited for github

I am implementing admin UI to add/remove teams to a selected member.
I need to show Add / Remove team based on if the selected member has the that team already.
listUserTeams() without params work for only for logged in user, But I want to get listUserTeams for other members as well.

Please add listUserTeams(userId) API

Image

Describe the solution you'd like

Please add listUserTeams(userId) API

Describe alternatives you've considered

I can pull Team Members for each Team and check given userId has that team, but since users size is many times more than teams size, it will be inefficient

Additional context

No response

Originally created by @xmlking on GitHub (Dec 27, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/7012 Originally assigned to: @ping-maxwell on GitHub. ### Is this suited for github? - [x] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. I am implementing admin UI to add/remove teams to a **selected member**. I need to show `Add` / `Remove` team based on if the selected member has the that team already. `listUserTeams()` without params work for only for logged in user, But I want to get `listUserTeams` for other members as well. Please add `listUserTeams(userId)` API <img width="1199" height="631" alt="Image" src="https://github.com/user-attachments/assets/c7553002-a662-438b-9797-caf32583568e" /> ### Describe the solution you'd like Please add `listUserTeams(userId)` API ### Describe alternatives you've considered I can pull `Team Members` for each Team and check given `userId` has that team, but since users size is many times more than teams size, it will be inefficient ### Additional context _No response_
GiteaMirror added the awaiting external contributorenhancementorganization labels 2026-04-15 18:16:46 -05:00
Author
Owner

@better-auth-agent[bot] commented on GitHub (Dec 27, 2025):

It looks like you're proposing an enhancement for the listUserTeams() API to allow passing a userId. This would be beneficial for implementing an admin UI feature to manage team memberships for selected members, as the current implementation only retrieves teams for the logged-in user.

As of now, there isn’t an existing method in the Better Auth framework that allows for listUserTeams(userId) directly yet; however, this is a great feature request! You may want to consider tagging @bekacru and @ping__ for further discussion on this topic, as they are part of the Better Auth team and can provide updates or insights into the feasibility of adding this feature.

How do you envision the interaction with this new API improving the user experience on your admin UI?

If you need more help, tag @better-auth-agent in a comment so I can respond.

DiagramDiscordGitHub

Diagram Join Star

<!-- gh-comment-id:3693508971 --> @better-auth-agent[bot] commented on GitHub (Dec 27, 2025): It looks like you're proposing an enhancement for the `listUserTeams()` API to allow passing a `userId`. This would be beneficial for implementing an admin UI feature to manage team memberships for selected members, as the current implementation only retrieves teams for the logged-in user. As of now, there isn’t an existing method in the Better Auth framework that allows for `listUserTeams(userId)` directly yet; however, this is a great feature request! You may want to consider tagging @bekacru and @ping__ for further discussion on this topic, as they are part of the Better Auth team and can provide updates or insights into the feasibility of adding this feature. How do you envision the interaction with this new API improving the user experience on your admin UI? _If you need more help, tag @better-auth-agent in a comment so I can respond._ <!-- bot:webhook reply v1 --> [Diagram](https://repodiagrams.s3.eu-north-1.amazonaws.com/skyvern_ultra_detailed_interactive.html) • [Discord](https://discord.gg/fG2XXEuQX3) • [GitHub](https://github.com/Skyvern-AI/Skyvern) [![Diagram](https://img.shields.io/badge/Diagram-2b3137?style=flat-square)](https://repodiagrams.s3.eu-north-1.amazonaws.com/skyvern_ultra_detailed_interactive.html) [![Join](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&style=flat-square)](https://discord.gg/fG2XXEuQX3) [![Star](https://img.shields.io/badge/star-181717?logo=github&logoColor=white&style=flat-square)](https://github.com/Skyvern-AI/Skyvern)
Author
Owner

@GautamBytes commented on GitHub (Dec 27, 2025):

Looking into it

<!-- gh-comment-id:3693956713 --> @GautamBytes commented on GitHub (Dec 27, 2025): Looking into it
Author
Owner

@xmlking commented on GitHub (Mar 22, 2026):

any plans to implement this request?

<!-- gh-comment-id:4106674995 --> @xmlking commented on GitHub (Mar 22, 2026): any plans to implement this request?
Author
Owner

@xmlking commented on GitHub (Apr 1, 2026):

wonder if there is any alternative ways for listUserTeams(userId) API if it is not going to be implemented by better-auth team.

<!-- gh-comment-id:4167410374 --> @xmlking commented on GitHub (Apr 1, 2026): wonder if there is any alternative ways for `listUserTeams(userId)` API if it is not going to be implemented by better-auth team.
Author
Owner

@GautamBytes commented on GitHub (Apr 1, 2026):

Hey please reach out to team on discord for this https://discord.gg/4aDD2KrBBd . Still pinging @ping-maxwell @bytaesu for response here!

<!-- gh-comment-id:4168019767 --> @GautamBytes commented on GitHub (Apr 1, 2026): Hey please reach out to team on discord for this https://discord.gg/4aDD2KrBBd . Still pinging @ping-maxwell @bytaesu for response here!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#19333