The cause of the death is disputed. There is a detailed chronology of the last day of Swami Vivekananda in the Bengali Best Seller 'Achena Ajana Vivekananda' by Sankar.
9:00 pm: The Swami was lying face up.He turned on his left side. For a
few second his right hand shook slightly. There were beads of
perspiration on his forehead. Then he began to cry like a baby.
9:02-9:10 pm: He exhaled a deep breath. He remained still for 2
minutes and then he again exhaled a deep breadth. His head shook and
then fell off from the pillow. His eyes became still and an unearthly
glow began to emit from his smiling face.
9:30 pm: Everyone came running in thinking that the Swami has enetered
Samadhi. Swami Bodhananda checked the pulse and then began crying. One
person told someone to immediately bring Dr. Mahendra Majumdar to the
Belur Math. Swamis Premananda and Nischayananda started to recite
Ramakrishna's name in the Swami's ears to bring him down from Samadhi.
10:30 pm: Dr. Majumdar, Swamis Brahmananda and Saradananda came
allmost at the same time to Belur Math. Baikuntha Sanyal also came.
Dr. Majumdar examined the body and saw the heart has stopped. He tried
to artificially stimulate the heart.
12:am: Dr. Majumdar informed the inmates that the Swamiji has passed
away. His diagnosis was that stoppage of the heart caused the death of
Vivekananda lived 39 years 5 months and 24 days. He has kept his word
since he had told his intimates that he will not see 40.
About 3 months before his death (28 March 1902) the Swami told his
disciple Nivedita that 'he has given everything that he could give.
Now he will have to go'.
Two days before his death he told his intimates that the spiritual
power in Belur will create a powerful movement for 1500 years.
Three days before his death (1st July 1902) while walking the grounds
of the Belur Math the Swami showed his disciples a spot on the bank
of the Ganga and told them to cremate his body there.
The day after death: 5 July, 1902: It was seen that the eyes of the
Swami were redshot and blood was oozing out of his nose and face.
Dr. Bipin Ghosh said that he has died of sannyas disease (thrombosis). Dr. Mahendra Majumdar has opined that the Swami has died of heart
stoppage. Other doctors said that the death has been caused by torn
vein in the brain.
My free translation of Achena Ajana Vivekananda by Sankar.