
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
- Unable to create push providers - FCM or...
Currently unable to create a push provider for FCM or APNS.... https://github.com/appwrite/console/issues/2045 When uploading a file... FCM = Valid file retu...
- Stuck in "deleting"
my parent element have relationship that doesnt exist and its stuck in "deleting", i cant delete it gives me error: Collection with the requested ID could not b...
- Help with 409 Error on Relationship Setu...
I ran into a 409 document_already_exists issue. with AppWrite so I tried to debug. Here's what I've set up: Collection A has 3 attributes and a two-way 1-to-m...
