Selena Gomez’s kidney transplant post hit all the right notes.

The 25-year-old “Hands to Myself” singer revealed on Thursday that she’s been laying low this summer to recover from this major surgery as part of her lupus treatment – and that her friend and actress Francia Raisa donated the life-saving organ.

“There aren’t words to describe how I can possibly thank my beautiful friend Francia Raisa,” Gomez captioned the moving snap that shows the BFFs lying in adjacent hospital beds. “She gave me the ultimate gift and sacrifice by donating her kidney to me. I am incredibly blessed. I love you so much sis.”

I’m very aware some of my fans had noticed I was laying low for part of the summer and questioning why I wasn’t promoting my new music, which I was extremely proud of. So I found out I needed to get a kidney transplant due to my Lupus and was recovering. It was what I needed to do for my overall health. I honestly look forward to sharing with you, soon my journey through these past several months as I have always wanted to do with you. Until then I want to publicly thank my family and incredible team of doctors for everything they have done for me prior to and post-surgery. And finally, there aren’t words to describe how I can possibly thank my beautiful friend Francia Raisa. She gave me the ultimate gift and sacrifice by donating her kidney to me. I am incredibly blessed. I love you so much sis. Lupus continues to be very misunderstood but progress is being made. For more information regarding Lupus please go to the Lupus Research Alliance website: www.lupusresearch.org/ -by grace through faith

A post shared by Selena Gomez (@selenagomez) on

But be warned that a life-changing announcement or personal emergency post can come across as needy or selfish, such as “Real Housewives of Miami” star Lisa Hochstein’s tone-deaf Instagram snap, which caught flack for showing her family grinning and posing in front of a private jet while fleeing Hurricane Irma.

Dr. Pamela Rutledge, director of the Media Psychology Research Center, told Moneyish that Gomez’s big reveal works because it’s a gratitude posting.

“She’s grateful for her friend, she’s grateful for her life, and such a gratification post boosts your mood and the mood of everyone who sees it,” said Dr. Rutledge. “So now when she or anyone else revisits this post – because we all come back and scan our photos and our posts now and then – she’ll remember that moment of gratification and re-experience the positive emotions and the positive reactions from friends and fans.”

Plus, coming out with your health diagnosis – or coming out as gay, getting divorced or expecting a child on your own social media account – helps you establish control over what can otherwise be an overwhelming event – which is especially important to celebrities.

“This [kidney transplant] story was going to come out eventually, so Selena got to control it and told it her way,” brand expert Mark Zablow from Cogent Entertainment Marketing told Moneyish. “For someone of that caliber, the pressure of trying to keep things private is immense and unfair – but if she posts it herself, she doesn’t have to worry about a nurse selling it, or a friend of a friend leaking it.”

In the same vein, Beyonce revealing she was pregnant with twins over that record-breaking Instagram post earlier this year, or Serena Williams posting the first pic of her newborn daughter this week, gets ahead of the rumor mill and stops the paparazzi trying to snag those “first photos” for tabloids and gossip sites.

There are some benefits to sharing a life-changing event over social media for the less famous of us, too. You can tell everyone at once, for example, instead of having to repeat the difficult or nuanced news over and over. And those revealing a serious health condition can find support and encouragement.

“When you share your experience, you’ll get people commenting that they are going through the same thing, and they know how you feel, so you don’t feel so isolated anymore,” said Dr. Rutledge.  “And it helps you normalize your experience.”

There’s a fine line between oversharing cries for attention, and posts that educate friends and family and/or spur inspiration and support. Everyone’s situation is different, but here are a few rules of thumb for posting your personal upheavals on social.

Think about why you’re sharing. Are you just looking for attention, a.k.a. Pharma bro Martin Shkreli, or are you: Scared and reaching out to your support system; looking to inspire others; or thanking everyone who’s been a part of your journey? The latter examples will get much more positive feedback. “Think for a moment about how this is going to be received,” said Dr. Rutledge. “You want to make sure you’re not framing this as a show-off moment if it’s good news, or attention-bait if it’s bad.”

Think about where you’re sharing. “Facebook and Instagram can be great community tools where you can really document your progress and build a big conversation,” said Zablow, versus Twitter and Snapchat. Or consider posting through a private message board or Facebook group with members going through the same experience, like new moms, cancer survivors or people being treated for depression, where you’ll find the most understanding and sympathetic audience that can share support and suggestions.

Think about how much you’re sharing. “When we post to our social media, we tend to think we’re just posting to our ‘personal public’ – the dozen friends and family we interact with the most with on Instagram – and forget that the public at large can often see it,” warns Dr. Rutledge. So do you really want a potential employer or romantic partner Googling your divorce or medical treatment?

Think about who else this impacts. You can bet that Gomez cleared this post with her life-saving BFF before putting her in the spotlight. So make sure your partner is OK with announcing your pending marriage, divorce or pregnancy, or that it’s OK with your employer before revealing a promotion or new hire. “You don’t want to share something that directly impacts another person without getting their permission, the same way you shouldn’t post a picture of someone without getting their consent first,” said Dr. Rutledge.