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
- Google Auth not working in a React App
Authentication with Google has failed. It redirects back to the signin route in React. Attached screenshots for configuration of Google console and Appwrite Go...
- How to display images from storage
I tried the link above, but it returns the error โ`Please upgrade to a higher plan.`โ I donโt need Transformations at the moment, I just want to display the ima...
- Cant sign up for appwrite cloud. Never s...
Cant sign up for appwrite cloud. Never sends me an email verification