fetch is a web api which is not accessible in the runtime provided by the windows installer. Is there a way to import third-party libraries?
Microsoft JScript (which is what is run in WiX custom actions) provides native web requests like this:
// Instantiate a WinHttpRequest object. var WinHttpReq = new ActiveXObject("WinHttp.WinHttpRequest.5.1");
WinHttpRequest can then be used similar to XMLHttpRequest.