How old is your cat? I often help people (not on this board), as I've had cats for 30 years now, and been through a lot, though I'm not a vet.
I always ask them to describe the vomit/throw up to me. 'Foamy' concerns me and I think your cat should see a vet and have a blood panel if at all...