Back

account

  • 0
  • Functions
  • Cloud
zombikaa
5 Mar, 2025, 20:11

Hi, can i use account.get if i want to check if a user exists ? in a function

TL;DR
Developers can use `users.get(USER_ID)` to check if a user exists, instead of `account.get()`.
Kenny
5 Mar, 2025, 20:15

No, account.get() gets the currently logged in user.

You would want to use users.get(USER_ID)

https://appwrite.io/docs/references/cloud/server-nodejs/users#get

zombikaa
5 Mar, 2025, 20:16

thank you so much, ill try it :)

zombikaa
5 Mar, 2025, 20:39

and can i somehow search by email?

Kenny
5 Mar, 2025, 20:43

sure, try

TypeScript
const res = users.list([
  Query.equal('email', 'USER_EMAIL')
]);

const user = res.users[0]
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more