Eight years ago, Karen Daggett nearly died while on a Valentine’s date with her husband when her prescription medications built up to a toxic level in her body. She felt dizzy and almost blacked out.

Daggett, now 71, was taking several prescriptions for an irregular heartbeat, but neither she nor her doctors realized the pills weren't helping her — and were actually causing her harm.

Daggett is now on a safer heart medication, which was prescribed to her after undergoing genetic testing at the Mayo Clinic in Rochester, Minnesota.

Her family members also went through testing and found that they, too, had the same genetic variant that caused her heart medications not to work.

This type of gene test that Daggett and her family took is part of a burgeoning field of individualized medicine — called pharmacogenomics — that promises to provide safer and more effective drug therapy. These genetic tests, which can be used for heart disease, cancer, and depression help doctors tailor therapy to an individual's DNA sequence.

“What we’re trying to do is, determine ahead of time, who the drug is not going to work in and who might have a severe adverse response or simply a bad reaction to the drug, and avoid that,” said Dr. Richard Weinshilboum, co-medical director of the pharmacogenomics program at Mayo Clinic's Center for Individualized Medicine.

Pharmacogenomic testing uses a small blood or saliva sample to determine the most effective medication, dosage, and possible side effects. The take-home test Daggett took, the OneOme RightMed Test, spots genetic differences which can play a role in how quickly or how slowly a drug is metabolized in the body.

Genetic tests have been used by millions of people for everything from prenatal testing to determining paternity and ancestry, but it's unclear how many people have undergone pharmacogenomic testing. Experts caution that the field is still new and research is ongoing.

The Mayo Clinic, one of the leaders in this type of testing, is currently collaborating with the Baylor College of Medicine to sequence the DNA of 10,000 participants, to determine if it improves long-term health and can lower health care costs.

“We can use this data to make better decisions about which drug to give patients, but it’s not a crystal ball," Mark Dunnenberger, director of Pharmacogenomics at NorthShore University HealthSystem in Chicago told NBC News. "This technology helps us in our decision making."

There are limitations to the genetic tests. Doctors can misinterpret the findings and avoid prescribing potentially helpful drugs and "people can over-interpret minor results," said Dr. Robert C. Green, professor of medicine and director of the Genomes2People Research Program at Brigham and Women's Hospital.

“There is a great deal of hope that these markers will help, but to what extent is yet to be known," Green told NBC News. "The analytical validity is very good but whether that translates to clinical validity is an entirely separate issue.”

Related: Is Genetic Testing Right for You?

The cost for pharmacogenomic testing in the lab or clinic is sometimes covered by insurance, but often not, costing up to $3,000 out-of-pocket. The new home test can be done for just $250.

For Daggett, who lives in Frazee, Minnesota, getting the right medication saved her life.

“I’m alive today because of it, and I feel great,” she said.

NBC Nightly News medical producer Jane Derenowski contributed to this report