A scalable cavity-based spin-photon interface in a photonic integrated circuit