No, surgery is not the only treatment for ectopic pregnancy. It depends on the size of the fetus, the intensity of patient's symptoms and the extent of complication involved. If the patient undergoes heavy bleeding after diagnosis of pregnancy, it is a sure shot signal of fallopian tube rupture and a case of emergency. If it is not treated within short span, chances are that the woman might lose her life due to hemorrhage. In this case surgery is the only option to remove the ruptured tubes and fetus. Surgery is also an option when the fetus size is large and any other forms which are discussed below would not have a lasting effect on pregnancy.
Surgery in most of the cases involves laparoscopy, which is doing small incisions on the abdominal part, inserting a device to rupture the fetus and the tube(if needed). The doctor should discuss the severity involved and the patient should be intimated about the removal of tubes in advance. Laparotomy is another form, which involves making a big cut to the abdominal area and usually done when the fetus size is large and tubal damages are extreme.
The other treatments available apart of surgery are:
Methotrexate drug - This is given as an injection on the buttocks which stops the pregnancy. After this the blood test has to be done to identify the levels of hCG. If the levels haven't reduced after one dose of injection, another dose is taken. It usually comes with it's own side effects, which involve, abdominal pain, dizziness, diarrhea etc. This is usually prefered when symptoms are low to medium.
Expectant management method - This method has zero side effects as there are no medications involved. It involves continuous checking of hCG levels in blood and expecting the pregnancy to dissolve by itself. This is prefered only at times when fetus is of least size and symptoms are mild. This however involves a range of uncertainty since the existence of pregnancy after continuous monitoring is not confirmed.