The concept of using a single nonlinear kicker (NLK) to inject electron beams into a storage ring has been proposed and tested in several synchrotron radiation light source facilities. Different from pulsed dipole kicker magnets used in a conventional local-bump injection, the single nonlinear kicker provides a nonlinear distribution of magnetic fields which has a maximum value off axis where the injected beam arrives and a zero or near-zero value at the center where the stored beam passes by. Therefore, the injected beam will receive a kick from the NLK and lose its transverse momentum, and will be eventually captured by the storage ring. In the meantime the stored beam at the center will receive no kick or less kick, which significantly reduces the injection perturbations on the stored beam. In addition, the NLK injection requires less space for the kicker and removes the complications of synchronizing four pulsed kicker magnets. Because of these advantages, several light source facilities are either proposing or already using this NLK injection as a replacement of the conventional local-bump injection scheme. In this paper, we will discuss the working principal of this NLK injection, and use both Advanced Light Source and Advanced Light source Upgrade as examples to optimize the NLK injections. By optimizing the NLK design and injection conditions, we could achieve maximum injection efficiencies for both facilities with a large injected beam from the existing ALS booster.