Provided herein are biocompatible hydrogel polymers capable of gelling in vivo comprising a therapeutic agent such as a protein or other biomolecule and kits comprising at least one nucleophilic compound or monomer unit, at least one electrophilic compound or monomer unit, and at least one therapeutic agent. The biocompatible hydrogel polymer is bioabsorbable and releases the therapeutic agent at a target site, avoiding systemic exposure and achieving a controlled delivery.