In 1894 Judge Bartlett of the New York Supreme Court in the case of Walters decided that to compel vaccination by intimidation or force was criminal assault. Source: "Crime against the school childe". (Remember, this was the NY supreme court, which was later overridden by the US supreme court.) Chas M Higgins. 1915. https://archive.org/details/crimeagainstscho00higg_0_201804. But this was later reversed by the US supreme court.
In 1905 the US Supreme Court declares, in the case of Jacobson, that forcing a person to get vaccinated is constitutional. This is mentioned here: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1449224/ "A state may enact a compulsory vaccination law, since the legislature has the discretion to decide whether vaccination is the best way to prevent smallpox and protect public health. The legislature may exempt children from the law without violating the equal protection rights of adults if the law applies equally among adults": https://supreme.justia.com/cases/federal/us/197/11/
As I understand it, that Jacobson decision was based on the particular strength of the MA “Commonwealth” constitution (and therefore was only relevant to MA)—and only led to a permissible fine for those who opted out.