How to transition from a Green function to vacuum expectation value in quantum field theory for a scalar field?

When considering the scalar field that solves the Klein-Gordon equation, one can use Green's functions to identify a propagator. This can be constructed from first principles, and can be left as an integral with the boundary conditions to be specified $$G(x^{\mu};x^{\mu}_0) = \int \frac{d^3k}{(2\pi)^3} e^{i\bf{k} \cdot (\bf{x} -\bf{x_0})} \int^{\infty}_{-\infty} \frac{d\omega}{2\pi}\frac{e^{-i \omega (t - t_0)}}{\omega^2 - \omega_{\bf{k}}^2}$$ or developed as the difference of the advanced and retarded green function if considering over all time. $$G(x^{\mu};x^{\mu}_0) \int \frac{d^3k}{(2\pi)^3} e^{i\bf{k} \cdot (\bf{x} -\bf{x_0})} (\frac{\text{sin}(\omega_{\bf{k}}(t - t_0)}{\omega_{\bf{k}}})$$

What I want to answer is, when considering the propagation of the quanta for some fixed time interval between two spacetime points, how these intergral equations transform to; $$i G = \langle0|[\phi(x), \phi(x_0)]|0\rangle$$ My understanding is that the commutator is required to separate the positive and negative frequency Wightman functions, because the modes originate at some infinte time and space distance. What I struggle with is the actual operation of the vacuum expectation value, why can't the green functions be equated directly with the commutator instead, and why a factor of i is introduced.
Any insight would be appreciated, thanks

In Peskin's book he addresses your question in section 2.4. He computes $$[\phi(x), \phi(y)]$$ and then says $$[\phi(x), \phi(y)]$$ is "just a c-number so we can write: $$[\phi(x), \phi(y)] = \langle 0| [\phi(x), \phi(y)] |0 \rangle$$." The factor of $$i$$ is just a convention, I think different books use different conventions in their definitions of the propagators.