How can I run a daily job using _User data along with an external library?

Hi everyone!

I am trying to figure out how I can use _User data to check each user against an API and set a value to true or false. After running that function, I want to pass in the list of users where the value = true into a job that uses an external library (Lamden JS) to do some functions.

I was thinking I could do it directly with webhooks, but _User data is not accessible as far as I can see in the documentation for webhooks at this time. Additionally, I cannot use the lamden-js library in the cloud job itself as far as I can see.

What do you guys suggest? Also, if you think webhooks are the way, what would you use for the server to host the daily job on?

Thank you all so much!


1 Like


You can run a cloud code job that runs daily, that can access all the users info (you can do that in cloud code with master key parameter), and make HTTP requests to your server (similar to how webhooks would work).

You can also make a request from your server to a cloud code function that give you all the info specific to users.

In the not too distant future we plan to make the server open source and at that time you can host the server part yourself and use any other external library.

1 Like

Thank you! Would you mind giving me a suggestion on what to use as a server in this case? My current stack is React JS + Moralis (obviously) and then blockchain stuff. I’m not super familiar with hosting JS servers so I’d greatly appreciate any guidance or pointers.

you need a server first where to run the code, you can use next js for example to also have a server component

Would express work as well? (Trying to avoid gutting things for NextJS)

Also, do you have any resources you’d recommend for getting started with the external server setup?

Thank you again!

I think that express will work as well.