Magnesium-dependent glutamate N-prenyltransferase: part of the gene cluster that mediates the biosynthesis of kainic acid (KA) and derivatives, natural products with neurochemical activity acting as ionotropic glutamate receptor (iGluR) agonists, thus being neurotoxins (PubMed:30995339). Catalyzes the conversion of L-glutamic acid (L-Glu) to prekainic acid in the presence of dimethylallyl diphosphate (DMAPP) (PubMed:30995339, PubMed:32457155). Can also use geranyl diphosphate (GPP) as substrate, thus leading to the formation of N-geranyl-L-glutamic acid (L-NGG) (PubMed:32457155, PubMed:30995339). dimethylallyl diphosphate + L-glutamate = diphosphate + prekainate kcat is 0.29 min(-1) with geranyl diphosphate as substrate (PubMed:32457155). kcat is 1.3 min(-1) with dimethylallyl diphosphate as substrate (PubMed:32457155). Secondary metabolite biosynthesis. Belongs to the terpene synthase family.