  Optically-active spin defects in hexagonal boron nitride (hBN) are promising
quantum systems for the design of two-dimensional quantum sensing units
offering optimal proximity to the sample being probed. In this work, we first
demonstrate that the electron spin resonance frequencies of boron vacancy
centres (V$_\text{B}^-$) can be detected optically in the limit of
few-atomic-layer thick hBN flakes despite the nanoscale proximity of the
crystal surface that often leads to a degradation of the stability of
solid-state spin defects. We then analyze the variations of the electronic spin
properties of V$_\text{B}^-$ centres with the hBN thickness with a focus on (i)
the zero-field splitting parameters, (ii) the optically-induced spin
polarization rate and (iii) the longitudinal spin relaxation time. This work
provides important insights into the properties of V$_\text{B}^-$ centres
embedded in ultrathin hBN flakes, which are valuable for future developments of
foil-based quantum sensing technologies.
