Like JimB, in a pinch, I have milled away the plastic carrier around the broken pin and soldered a wire on.
I would fit the device in a turned pin socket and solder the wire to the socket just to get me by until I could get a replacement, but as has already been pointed out, it's the kind of thing you do at 3am when you are bread boarding something that can't wait
Get a replacement and fit it in a turned pin socket to begin with, in order to protect the pins when plugging and unplugging into your breadboard.