Really 😮
I personally would split up the code but I would just differentiate based on the event. See here https://appwrite.io/docs/advanced/platform/events
But if they all use the same trigger how would you differentiate then?
nice idea, but still this particular function does so many things
Can you elaborate what your function does?
that's just it, except if all the functions have different events but still, it will still need to tell the cloud function instance what function to execute
except if you want all functions to execute either asynchronously or all at once, which is far from the goal
I have written a method in my starter function which can differiantiate the event. What type it is and the event item id (like document id, file id, etc.)
writing to database after account creation, fetching data after login, writing to database after transactions are successful, communication with third party API and more
Account creation != login, no?
I still don't get picture you're trying to paint 🎨
???
Does your user register via the official method or via your function?
Via official method
But I don't want to write to the database via client app
But all done in backend, to follow best practices
Yeah, because if a user registers it triggers this event "users..create" and when the user logins it triggers this "users..sessions.*"
so user create it not the same as login
it is two different events
I mean one cloud function to have more than 30 different features that it does (as dart function)
I know about all these, but this will be best when I have different cloud functions for different services and features.
Idk if you got my motive?
Kinda and kinda not I think. Let me reread real quick. I think putting too many features within a single function makes it too complex unesseccarily. Each function should just do a certain thing or flow (like registration flow)
yes, this is because I can only create 5 cloud functions
Yeah ok that explains it. Are you in production already? If not I would just spin up appwrite locally on your pc with docker
I tried using local appwrite instance, it ate up weeks of my time.
I was unable to communicate with it via docker despite looking for solutions 😞
Recommended threads
- Cant configure email templates
i configure it on the console, and when i send the OTP, it sends with appwrite's email (instead of custom smtp) and with the branding, but i have the Pro (educa...
- Need help with createExecution function
Hi, Need some help understanding createExecution. When requesting function execution via createExecution, the function handler arguments are incorrect and rese...
- Need Help with Google OAuth2 in Expo usi...
I'm learning React Native with Expo and trying to set up Google OAuth2 with Appwrite. I couldn't find any good docs or tutorials for this and my own attempt did...