A proton-conducting lanthanide metal-organic framework integrated with a dielectric anomaly and second-order nonlinear optical effect.