Hi, @hamzayusuf !
Seems you need additional logic on server side, study video tutorial on how easily expand the server logic yourself: this(golang), this(lua) or this(typescript), depend on programming language you more familiar with. Then just call yourself writed RPC function and get what you wish.
This question is not related to Nakama, it’s related to programming in general. You can see the problem, that your IDE shows you, it’s clearly written: Connot compile modules using option 'outFile' unless the '--module' flag is 'amd' or 'system'. Always make attempts to google this messages and follow the people’s answers, recommendations ang guides.
@hamzayusuf the Nakama JS runtime is ES5 compliant and bear in mind that it is not a Node.js environment. To include any other JS libraries you’ll need to use something like rollup to transpile the dependencies, and even then not all libraries will be compatible.