A vast range of optical imaging techniques strive toward high-resolution imaging at elevated penetration depths. However, as the light travels through biological tissue, it gets scattered, leading to image deterioration with increasing imaging depth. Consequentially, a number of wavefront-shaping techniques have emerged, aiming to control the scattered light by tailoring the illumination wavefront. We propose a novel wavefront-shaping device based on integrated photonics which, compared to the conventional liquid-crystal spatial light modulators, can improve on the modulation speed and pixel pitch and reduce the overall optical path length of the system. These improvements are highly relevant for, e.g., in vivo imaging of neural activity in a freely moving animal. The device relies on a one-dimensional optical phased array consisting of 128 emitters placed at 2.3 μm pitch and operates in the near-infrared spectral region (λ = 1.55 μm). Using a photonic integrated circuit to modulate the wavefront phase, we demonstrate diffraction-limited focusing through static scatterers. Focus intensity enhancements close to the maximum value predicted by the random matrix theory are experimentally achieved. Furthermore, our one-dimensional wavefront shaper can focus the scattered light over a two-dimensional grid, enabling raster scanning of the spot for imaging. Characterization of the phase modulators shows that the device is capable of modulation rates up to 5 kHz.