From realm app function, access another realm app's functions

I need to access, from a realm app function, another realm app’s (in the same project) functions.
Is there a straightforward way to do this? I could not find any explicit information in the documentation.
I have tried using this approach https://docs.mongodb.com/realm/node/call-a-function/.
I then needed to upload the “realm” dependency. I installed the realm-package locally and followed the instructions here: https://docs.mongodb.com/realm/functions/upload-external-dependencies/. But on upload I get the following error

Failed to upload node_modules.tar.gz: unknown: Unexpected token (216:9) 214 | } 215 | > 216 | async* watch({ids = undefined, filter = undefined} = {}) { | ^ 217 | let args = { 218 | database: this.databaseName, 219 | collection: this.collectionName,

which I find impossible to interpret.

Very thankful for any help you could provide!

You can’t use the realm SDKs in our functions - however a workaround here would be to use an incoming webhook for the function you want to call from your first App.

Example:

You have App A with function foo and App B with function bar. You want to call bar in foo.

You will have to create an incoming webhook (3rd party services --> HTTP ) in App B which will execute your logic. You can send a request to this webhook from App A in function foo

1 Like

Great, I will try that.
Thanks for the quick reply!

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.