For $G$ a Lie 3-group, a connection on a $G$-principal 3-bundle coming from a cocycle $g : X \to \mathbf{B}G$ is a lift of the cocycle to the 3-groupoid of Lie 3-algebra valued forms $\mathbf{B}G_{conn}$
connection on a 2-bundle / connection on a gerbe / connection on a bundle gerbe
connection on a 3-bundle / connection on a bundle 2-gerbe
The higher parallel transport of local 3-connections is considered in
Examples of 3-connections obtained from fibrations of Courant algebroids are discussed in
A discussion of fully general local 3-connections is in
and the globalization is in
For a discussion of all this in a more comprehensive context see section xy of
See also connection on an infinity-bundle for the general theory.