How to gently tell your infertile friends you're pregnant...?

My husband and I had given up hope of conceiving as I have PCOS as well as an autoimmune disorder. My best friend and her husband have been wanting another child as well (they too only have 1 currently). She's had 2 early miscarriages over the last couple of years. My friend also has PCOS and her husband has diabetes which affects his count. I've known I'm pregnant for over a week now and have been dreading telling her... I know she'll be happy for me but I also know it'll crush her in some ways too. I have my first ultrasound next week for confirmation/dating and I plan on telling her soon after the ultrasound.

Anyone have any ideas on how to tell her gently without coming across as bragging? What should I do of she pulls away from the friendship... just give her time and space right? Any suggestions or advice is appreciated.

Update: I should add that we won't be "announcing" to everyone until I do hit my 2nd trimester due to the chances of miscarriage. But I do want to share this with her sooner because we've been best friends since kindergarten and as far as I know, haven't kept serious/big news from each other ever. I think she'd be more hurt if I didn't confide in her and she were to find out when everyone else does.

FINAL UPDATE: So I finally told her and she was over the moon excited for me... I did send it via message instead of in person so she could have a true reaction instead of feeling like she had to act a certain way in front of me and respond on her own terms... she called me immediately lol. I did explain to her when we'd found out and why I waited to tell her and she understood and thanked me for trying to think of her too. But she also said that it doesn't bother her with it being me because she can "live vicariously" through me and babysit lol and also that she knows how hard we've struggled too and feels we truly deserve this blessing. Thanks everyone for all the suggestions... ALL were appreciated.