We present a versatile transmitter capable of performing both discrete variable and continuous variable quantum key distribution protocols (DV-QKD and CV-QKD, respectively). Using this transmitter, we implement a time-bin encoded BB84 DV-QKD protocol over a physical quantum channel of 47 km and a GG02 CV-QKD protocol with true local oscillator over a 10.5 kin channel, achieving secret key rates of 4.1 kbps and 1 Mbps for DV- and CV-QKD, respectively. The reported transmitter scheme is particularly suitable for re-configurable optical networks where the QKD protocol is selected to optimize the performance according to the parameters of the links.