Search code examples
javascriptfirebasefirebase-authenticationnetlify

How to access the netlify deploy logs which are stored in firebase using the token through API?


I'm trying to build a client app for Netlify that would show all the sites and deploys and their logs. I'm using the Netlify API for this.

I can get the details of a specific deploy by sending a GET request to https://api.netlify.com/api/v1/sites/<site-id>/deploys/<deploy-id> which also has the deploy log data in this format:

  "log_access_attributes": {
    "type": "firebase",
    "url": "https://netlify-builds6.firebaseio.com/builds/63de8c3d80c560398670a877/log",
    "database": "netlify-builds6",
    "endpoint": "https://netlify-builds6.firebaseio.com",
    "path": "/builds/63de8c3d80c560398670a877/log",
    "token": <auth-token>
  },

But when I try to access the logs from firebase using the token like https://netlify-builds9.firebaseio.com/builds/63de8d936a21a82f300b132d/log?access_token=<auth-token>, I'm being redirected to google sign-in page, and when signed in, it tells this, This project does not exist or you do not have permission to view it.

Am I doing something wrong? Also please let me know if there are any other ways of getting the deploy logs.

Many thanks for considering my request.


Solution

  • We assumed that it should work but folks from netlify confirms that we can not access the logs via API and that is only accessible from UI as of 25th May, 2023

    Link to the Discussion
    https://answers.netlify.com/t/cant-access-firebase-log/19398/8