Accessing AppData from embedded JS script

Greetings, fellow Backenders!

We’re building an MVP of our service.
It actively uses p2p video calling routine.
So, we are integrating external service via embedding external service’s script using “Custom Code” UI Builder node.
In order to provide this script some data about current logged user, we need to access to the User data from the script.

Please direct, how could it be done?
Are we to use our app’s REST API?
Or is there any other way to access this data (for example, getting it from the database via Object, storing it in AppData/PageData nodes, and somehow accessing it from the script via including some specific Backendless Framework namespace)?

Thanks a lot!

Hello @Sm1else

Welcome to the community and thanks for trying Backendless! :handshake:

In order to provide this script some data about current logged user, we need to access to the User data from the script.

you’ve got two options:

  1. inside the Custom Code block you can use methods of the JS-SDK await Backendless.UserService.getCurrentUser()
  2. pass variables into the block

Regards, Vlad

Thank you very much!
Will definitely try that.