Following the Mexican War of Independence (1810–1821), Costa Rica became part of the independent Mexican Empire in 1821. Subsequently, Costa Rica was part of the Federal Republic of Central America in 1823, before gaining full independence in 1838.
I took that class yesterday and the teacher gave me this for notes
And the notes helped me I hope it helps you too