Help with javascript file

I’m trying to communicate with google sheets, I managed to develop the code to insert data in VS Code.
I would like to know how I can run this code through Losant.
I know I have to change some code variables to integrate with losant, but I don’t know where to start this migration.
Do I have to copy the code in a function node, in an experience page or run it as a file? an important detail, I had to install a “google-spreadsheet” library, as I install this library on losant.
this is the code i created
I pulled out the file with the google credentials
test (1.8 MB)

please help me

The Function Node within Losant is a heavily sandboxed environment due to the security implications of running code within our cloud infrastructure. Due to that, it will not be capable of running code like this.

The recommended workaround would be to run this code in AWS Lambda, GCP Functions, or Azure Functions. The workflow can then execute these cloud functions, which contain the code to interact with Google Sheets.