John F. Kennedy’s actor nephew has died at age 63 — and hot yoga may be to blame, according to his cousin.

Christopher Kennedy Lawford, who appeared on TV shows such as “Frasier” and “The O.C.,” suffered a heart attack and collapsed during the sweaty yoga session in Vancouver, Canada, Tuesday night, according to his cousin, former U.S. Rep. Patrick J. Kennedy.

The exhausting workout “must have been too much for him at that point,” Kennedy said.

Lawford — who wrote a book about his battle with drug addiction — was considered political and Hollywood royalty. He was the son of Patricia Kennedy, sister of John, Robert and Ted Kennedy. His dad was legendary “Rat Pack” entertainer Peter Lawford.

As a kid, stars such as Marilyn Monroe, Judy Garland and Milton Berle would attend his parents’ parties.

But Lawford began experimenting with drugs while away at boarding school as a teenager in the 1960s, not long after JFK’s assassination, he wrote in his 2005 book “Symptoms of Withdrawal: A Memoir of Snapshots and Redemption.”

By the 1970s, he had moved on to heroin and other opioids. The addiction got so bad that, at one point, he mugged women for money — and even panhandled in Grand Central Station, he wrote in the book.

Lawford later got arrested twice for drug possession before finally sobering up at age 30. Afterward, he made it his mission to help others recover from drug abuse, including his cousin, Patrick Kennedy.

“He was the absolute cornerstone to my sobriety, along with my wife,” said Patrick Kennedy, who also struggled with drug addiction. “He was the one who walked me through all the difficult days of that early period.”

Lawford’s cousin Maria Shriver paid respects to him in a heartfelt Instagram post Wednesday.

“This handsome, loving, fun man is my cousin Christopher Lawford. He passed away suddenly yesterday,” she wrote. “He was my age, full of love and very much alive.” She added, “He lived a big life and he cared deeply about life. He fought for his and in turn he fought to help so many people dealing with addiction issues. He was really at the forefront of the recovery movement.”

Lawford also had a small role in the movie “Terminator 3: Rise of the Machines” and made appearances on TV shows including “All My Children” and “General Hospital.”

Hot yoga enthusiasts perform their poses in a sauna-like room, often heated to around 105 degrees.

Lawford’s exact cause of death has not yet been released by a medical examiner, TMZ reported.

With Post wires