Getting 404 when doing any read/write operation via Github Apps


#1

I’m struggling trying to read/write from an API call done via the app integration. Im getting 404s when trying to read
Here is a trivial example:

const app = createApp({i d: 1, cert: fs.readFileSync('x.pem') });
app.asApp().then(async github => {

        const installations = await github.apps.getInstallations({}); // this works fine
        const installation_id = installations.data[0].id; // all permisions on the repo

        const rootGit = await app.asInstallation(installation_id); // get token fro the installation_id
        const repos = await rootGit.repos.getForOrg({ org: xyz });
        console.log(repos); // I get a 404 on any calls that read or write
 

What am I missing?
I have my app installed in the repo (I tried also in my user with no luck).
Is has something to do with integrations_ids?

Does Github Apps only work for when the server sends you a webhook with a give installation?
Can it be passive as Im trying to do here?