Integration is currently the only feasible route towards scalable photonic quantum processing devices that are sufficiently complex to be genuinely useful in computing, metrology, and simulation. Embedded on-chip detection will be critical to such devices. We demonstrate an integrated photon-number resolving detector, operating in the telecom band at 1550 nm, employing an evanescently coupled design that allows it to be placed at arbitrary locations within a planar circuit. Up to 5 photons are resolved in the guided optical mode via absorption from the evanescent field into a tungsten transition-edge sensor. The detection efficiency is 7.2 pm 0.5 %. The polarization sensitivity of the detector is also demonstrated. Detailed modeling of device designs shows a clear and feasible route to reaching high detection efficiencies.