Get camera focal length as scalar value in shader node
At its simplest:

Right-click in the Focal Length property-field of the camera, and 'Copy as New Driver'
Create an Input &gt; Value node in your tree
Right-click in the Value field, and 'Paste Driver'.