Demi Lovato broke her silence on the overdose that nearly killed her … making it clear it was a near-death experience.

Demi went on social media to say she’s “grateful to be alive,” and is now sober and getting the help she needs.

She goes off on the media for making up crap about her to sell stories, saying, “If I feel like the world needs to know something, I will tell them MYSELF.”

She goes on to say, “Someday I’ll tell the world what exactly happened, why it happened and what my life is like today but until I’m ready to share that with people, please stop prying.”

TMZ broke the story … Demi almost died earlier this year after OD’ing at her Hollywood Hills home. She was hospitalized for 10 days before going to rehab for extensive treatment.

She’s been back in L.A. for a while now, clean, sober and healthy. She says she needs space and time to heal, adding, “All my fans need to know is I’m happy and clean and I’m SO grateful for their support.”