Best way to call a GO module function from the Typescript module

Hello,

I have a Unity game with a Nakama server as backend using the Typescript runtime for all the functions and I need to send an HTTP POST request from the Nakama backend to another server, I don’t need the response from the request.

After trying to send an HTTP request from the Typescript runtime and some researches, I found out that is not currently possible to send HTTP requests with functions like fetch nor to add a package to do it with the Typescript runtime.

However, with the GO runtime sending HTTP requests aren’t an issue. So I wrote a GO function to do what I needed and I’m now looking for the best way to call this GO function from the Typescript module functions.

I would appreciate any advice on this.
Thank you!

AFAIK there’s no way to communicate internally using different runtimes.
There’s a workaround that i’m thinking, maybe you can create an RPC endpoint on your GO runtime, then call it on typescript runtime utilizing nk.httpRequest for this?

2 Likes