Node.js: make module use local `window` variable

I have such a function with imported module that I cannot edit

function create() {
  const window = {}; // Normally initialized by JSDOM to make fake window
  const appboy = require("@braze/web-sdk");
}

What I want is that appboy sees the local window from create function.

I want to avoid globalThis.window because of race conditions of create function when run concurrently.