get latest version of compiled pdf download link from a overleaf read token
generated link can be directly download without cookie/token verification.
const compileOverleaf = require('compile-overleaf');
try {
// https://overleaf.com/read/fjspyrhfrsgc
const token = 'fjspyrhfrsgc';
const compiled = await compileOverleaf(token);
/**
* {
* name: 'projectName',
* link: {pdf: 'https://compiles.overleaf.com/....'}
* }
**/
console.log(compiled);
} catch (e) {
/**
* status: e.statusCode, <response from server>
* stage: e.message, <where error happens>
**/
console.log(e);
}
https://compile-overleaf.now.sh/#{token}
https://compile-overleaf.now.sh/api/read?token={token}
e.g. https://compile-overleaf.now.sh/api/read?token=fjspyrhfrsgc