The type definition makes it seem like Accounts.findUserByEmail is available on the client, but this function is undefined.
I propose we update this to be a reactive source on the client, and fix any other such confusing discrepancies in other APIs.
On the client, it should only succeed if the user is given such permission, otherwise should only work with the user’s own account by default (it would work with all emails they have), or similar.
Accounts.findUserByEmail is a server-only function. It may be autocompleted by types in client code, but this happens because TypeScript can’t distinguish between client and server code during autocompletion.
If you would like to make it available on the client with the behavior you described, feel free to open a PR at https://github.com/meteor/meteor. I have nothing against having an isomorphic version that works on both client and server. It is a bit unusual to have many users published to the client and the usage of Accounts.findUserByEmail, but it is doable in a supervisor-style app or similar cases.
This specific requirement is a good opportunity for a contribution to address it.
Yeah, for various cases not needed. I’m thinking to show user lists (f.e. users who are friends, or public parts of profiles to explore other users profiles, etc). And yeah for admin dashboard useful too.
I may try it when (if lucky) I get time for OSS contributions beyond what I’m currently trying to build. Maybe one day, when I finally get rich, I can pay for it haha.