How do I save user customData on Signup

I have just been working with Realm but I have hit a dead end when trying to save user data like names and phone numbers when they sign up

so the idea is when a username signs up their full name and phone number gets saved on user data and they will receive an email for the confirmation as usual

Please help with a solution or idea on how I can go about achieving this using Realm

@Jeremie_D_Negie : Have thought of setting up a Realm function which get triggered as soon as sign up is complete.

In that function you can save all the custom information you want in the User Model.

Hi @Mohit_Sharma , thank you for your answer.

Yes, I have set up a function already but what I do not know what to do is pass data to that function.

for example, my function looks like this

exports = async function (authEvent, firstname, lastname, phoneNumber) {
  const user = authEvent.user;
  const collection = context.services
    .get("mongodb-atlas")
    .db("educators")
    .collection("user");

  const updateDoc = { firstname, lastname, phoneNumber, userID: user.id };

  const result = await collection.insertOne(updateDoc);

};

The trigger will call this function on user sign up but how do I pass the required arguments so firstname, lastname, and phoneNumber

Can someone please help with this, I have bee sitting with this problem for a week now

@Jeremie_D_Negie : Once you get the sign-up success callback on the client you can call this function to save the custom information.