MarcelOriginal post
Web Developer
We already use the Auth setup from Appwrite to login from the React app, which works great. Now, I want to create a feature where you can connect/invite another user by email. When you "friend" someone I need to check if the account yet exists in Appwrite, if not, send an email to create an account first. If it does exist, it will connect it in the database.
I understand I'll have to use a Function for this, but I can't find any relevant APIs to check if an account already exists or not. The only API I can find is to get the currently logged in user (not just any user by email).
How to approach this?
Summary
You need to check if an account exists in Appwrite from a Function. To accomplish this, you can create a custom API endpoint using Appwrite Functions that will check if the user account exists based on the provided email. You can use the Appwrite Users API to achieve this by fetching a user by their email address. If the user exists, you can proceed with connecting them in the database. If the user doesn't exist, you can trigger an email to prompt them to create an account first.