We present JWST/NIRSpec integral field spectroscopy in the rest-frame optical bands of the system PJ308--21, a quasar at $z=6.2342$ caught as its host galaxy interacts with companion galaxies. We detect the spatially extended emission of several emission lines ( and ), which we used to study the properties of the ionized phase of the interstellar medium: the source and hardness of the photoionizing radiation field, metallicity, dust reddening, electron density and temperature, and star formation. We also marginally detected continuum starlight emission associated with the companion sources. We find that at least two independent satellite galaxies are part of the system. While the quasar host appears highly enriched and obscured, with photoionization conditions typical of an Active Galactic Nucleus, the western companion shows minimal dust extinction, low metallicity ($Z and star formation driven photoionization. The eastern companion shows higher extinction and metallicity ($Z compared to the western companion, and it is at least partially photoionized by the nearby quasar. We do not find any indication of AGN in the companion sources. Our study shows that while the quasar host galaxy is already very massive dyn it is still rapidly building up by accreting two relatively massive star companion sources. This dataset showcases the power of JWST in exposing the buildup of massive galaxies in the first gigayear of the Universe.