Sonny Bill Williams has revealed he has had open-heart surgery, in a major health scare for the 41-year-old retired New Zealand league and rugby international.

In a lengthy video on his YouTube channel, Williams revealed that a major heart defect he has had since birth was found during a routine follow-up to recent neck surgery.

Williams revealed harrowing footage during the video, including lying in a hospital bed taped up to machines post surgery, and then having a bandage removed down the middle of his chest that revealed the large surgical incision in all its glory.

Perhaps the most revealing part of the video was a piece to camera from Williams after he had been discharged and was waiting to board a plan to return home.

"That's the hardest thing I've ever done ... day two, honestly, I thought I wasn't going to make it. To go from there to here, where I'm in transit lounge and we're about to leave, back home to the kids ... It's just amazing," he said.

Williams also revealed extensive background information as to what role his heart defect might have had on his sporting career.

"So the doctor I [have] seen this morning just told me that having this heart implication throughout my life would have implicated me and my sporting career.

"And upon reflecting, I feel like towards my late 20s I definitely felt like I couldn't get as fit as I used to ... still do.

"So understanding that I had this throughout my career, I'm so grateful.

"The doctors both said that it's a miracle that you found it, because it's a case of a perfectly fit-looking person dropping dead.

"I was about to pop, as the doctors said.

"Now, I've got a better heart than when I walked in here, because it's more efficient now.

"The magnitude of the surgery - two open-heart surgeries in one - and it's been so successful," he said.