Pex near water heater

Is there a code rule in charleston on running pex near an electric , tank, water heater - I am asking about the connections at the top. If you have pex cold water to the tank heater electric heater , and the leaving hot water line is also pex, can you connect them to the 3 inch long stub steel nipples on the top off the tank?

or do you have to have some metal pipe between the top of the tank and the pex? (some places in California and washington state do that from what I read)

In Beaufort ours is connected directly to tank. Cant imagine why it would need a metal extension. PEX is rated for 180 degrees @ 100psi.

Sorry, don’t know about the actual “code” where you are at.

Good luck,
NN

www.joinrfa.org/