Let f be an holomorphic endomorphism of P k and µ be its measure of maximal entropy. We prove an almost sure invariance principle for the systems (P k , f, µ). Our class U of observables includes the Hölder functions and unbounded ones which present analytic singularities. The proof is based on a geometric construction of a Bernoulli coding map ω : ( , s, ν) → (P k , f, µ). We obtain the invariance principle for an observable ψ on (P k , f, µ) by applying Philipp-Stout's theorem for χ = ψ • ω on ( , s, ν). The invariance principle implies the central limit theorem as well as several statistical properties for the class U. As an application, we give a direct proof of the absolute continuity of the measure µ when it satisfies Pesin's formula. This approach relies on the central limit theorem for the unbounded observable log Jac f ∈ U.