Juniper berries are used to flavor food and beverages. They are the required ingredient that flavors gin. Some bartenders may use juniper berries/oil in infusions, syrups, as garnishes, and in other cocktail uses.
Not all juniper species are suitable for consumption, so people harvesting juniper berries should ensure they can identify the plants correctly.
According to Gin Foundry [link] "All juniper species grow berries, but most are considered too bitter to eat. In addition to Juniperus Communis, other edible species include Juniperus Drupacea, Juniperus Phoenicea, Juniperus Deppeana and Juniperus Californica. Some species, for example Juniperus Sabina, are toxic and consumption is inadvisable."
The United States FDA includes Juniperus Sabina in its poisonous plant database [link] "oil of sabina has an irritant effect on the mucosal lining of the intestinal tract, causes congestion of the kidneys with haematuria, congestion of other abdominal viscera, menorrhagia and abortion."
According to the book California Foraging [link], one should avoid juniper berries if pregnant or trying to become pregnant, or are experiencing bladder or kidney problems. According to WebMD, "Juniper might affect blood sugar levels, making blood sugar control more difficult during and after surgery. Stop using juniper at least 2 weeks before a scheduled surgery." [link]
"Juniper" Gin Foundry [link]
"Edible Juniper Varieties" SFGate [link]