Both types can be installed in either vertical or horizontal position on sump pump discharge line. There’s a flow arrow on the body of the check valve which must be pointing in the direction of the water flow.
Swing check valves also require their designated side (it should be marked as such) to be positioned “up” when installed horizontally for the swing to operated properly. Spring assisted check valves may not require that. The last installation requirement is that they cannot be installed upside down, even if the flow arrow is pointing correctly / with the flow.