Can the same JS middleware be used for different APIs?

We have a JS middleware that does some simple CSRF validation and I’m wondering on the implications of referencing the same middleware file from multiple different APIs.

Is this something that can be done without issue? Are multiple instances of the middleware loaded into the JSVM? Is there anything to be aware of regarding concurrency if doing this?

Thanks!