I finally found a blog that got the answer, my problem was the same the autor had.
Here's the link: Sharepoint/Project Server App with javascript and Web Part
And here the code I developed in case someone else needs to do the same I needed:
<script src="../SiteAssets/scripts/jquery-1.11.2.min.js" type="text/javascript"></script>
<script type="text/javascript" src="/_layouts/15/sp.core.js"></script>
<script type="text/javascript" src="/_layouts/15/sp.runtime.js"></script>
<script type="text/javascript" src="/_layouts/15/sp.js"></script>
<script type="text/javascript" src="/_layouts/15/ps.js"></script>
<script type="text/javascript">
var contexto;
var proyectos;
var arr_proy;
function init() {
contexto = PS.ProjectContext.get_current()
console.log(contexto);
proyectos = contexto.get_projects();
console.log(proyectos);
contexto.load(proyectos);
console.log('Carga');
contexto.executeQueryAsync(Function.createDelegate(this, this.Exito), Function.createDelegate(this, this.Error));
}
init();
function Exito() {
console.log('Exito');
for(i = 0; i < proyectos.get_count(); i++)
{
console.log(proyectos.get_item(i));
console.log(proyectos.get_item(i).get_name());
}
}
function Error() {
alert('Error');
}
</script>