Telling a friend you’re pregnant

Sa

One of my closest friends is struggling with getting pregnant after being diagnosed with endometriosis. I just found out I’m pregnant and would really like to tell her soon.

When/how can I tell her I’m pregnant? How do I tell her my good news while also keeping her struggle in mind? Would it be better just to wait and announce on social media in several weeks and her find out that way?