See: alpinejs/alpine#3016
I have found the bset approach to be this:
Install Alpine.js from npm and bundle it with your js file (documentation). Don't assign it to window:
import Alpine from "alpinejs";
// Assign a custom prefix:
Alpine.prefix("xyz-");
// Don't assign Alpine to the window (keep it private):