Using Azure package for Teams server-side
I am using this Microsoft tutorial to receive incoming call events locally from inside a teams tab app, with success. These notifications aren't received when the user selects any other tab in Teams, however, so I would like to run the same code from a server. That way, the events can be sent to the user at any time.
My issue is that while copying the code for receiving events to a server environment, the line
const { CallClient } = require('@azure/communication-calling');
causes referenceError: window is not defined.
The package contains many references to the window object and its properties, which obviously are not available in a server environment. My code only creates a new CallClient and uses its method createTeamsCallAgent, I highly doubt the window object is needed for that.
Is there any way to get around this? I'm open to rewriting the code in a different language if that has a version of the package that doesn't need the browser environment. So far I've only seen a 'Windows' implementation, which also took the web page approach.
Thanks in advance and kind regards,
Jeroen
P.S. I was under the impression that these Teams libraries were specifically made for use by third-party applications, yet only web-page-based programs can use this it seems, isn't that strange?