Some glitter is designated for food use, other glitter is for decorative purposes only and not safe to consume. Be sure you purchase/consume the food-safe version.
According to the United States FDA [link]:
There are easy things you can do to determine what’s edible and what’s non-edible:
Carefully check the label of any decorative product you’re considering for use in foods. Companies that make edible glitters and dusts are required by law to include a list of ingredients on the label.
Common ingredients in edible glitter or dust include sugar, acacia (gum arabic), maltodextrin, cornstarch, and color additives specifically approved for food use, including mica-based pearlescent pigments and FD&C colors such as FD&C Blue No. 1.
Most edible glitters and dusts also state “edible” on the label. If the label simply says “non-toxic” or “for decorative purposes only” and does not include an ingredients list, you should not use the product directly on foods.