dd was in a biting phase, which she revisits every now and again (she's 21 months now) and my approach has always been the same. "No biting. You can bite a pillow, you can bite the blanket, you can bite a toy, you can bite the spoon, or your cup, but you can NOT bite mommy and daddy because it hurts." Sometimes I'll add "we don't hurt you. Please do not hurt us." which really reinforces in the moment that we DON'T hit or hurt her!
Once she understood the concept of getting hurt (slamming finger in door, falling and hurting herself and attaching that to the word "ow") and we could verify that with her using the word "ow" we began to use it too. As in: "that does "ow" to mommy and daddy. It hurts. You don't like to have an "ow" do you? Neither do we." and then I reapeat the options of what she CAN safely bite.
Now she will come at us with mouth open to bite (and I notice that this USALLY coinsides with teeth coming in, actually and redundantly enough) and I will say "no, bite the ________" (fill in the blank, what ever is closer, like "pillow") and she does and it is over. She'll take a few bites and then bite some other inananimate object and then it's done.
MUCH more effective than the ONE TIME my husband just "reacted" and hit her on the hand. She just did it again a second later, and my husband was in tears he felt so bad that he had reacted without thinking. First and last time we ever did THAT hitting method. Thankfully it was more like a quick slap on the hand and not hard or painful. She didn't even seem to notice (for better or for worse) but boy did we feel shitty.
It's important to just be like "okay, we made a mistake" and then move on. Don't beat yourself up about this (no pun intended). We are all tryingour best. Be gentle with yourself as well and good luck!