I am encountering an issue when trying to fetch data from Supabase using Node.js and the node-fetch library. The response I receive is showing an empty data array (data: []) even though I expect data to be present in the 'contacts' table. It's worth noting that the request works as expected in Postman when hitting directly to https://${subdomain}.supabase.co/rest/v1/contacts when passing the auth token and API key, but encounters issues when making the same request in Node.js to the same url.
Make a GET request to the Supabase endpoint URL to fetch data.
It works well in postman, but not through Node.js
Expected behavior
I expect to receive the data from the 'contacts' table when making a GET request to the Supabase endpoint, similar to the successful response in Postman.
Bug report
Describe the bug
I am encountering an issue when trying to fetch data from Supabase using Node.js and the node-fetch library. The response I receive is showing an empty data array (data: []) even though I expect data to be present in the 'contacts' table. It's worth noting that the request works as expected in Postman when hitting directly to https://${subdomain}.supabase.co/rest/v1/contacts when passing the auth token and API key, but encounters issues when making the same request in Node.js to the same url.
To Reproduce
Expected behavior
I expect to receive the data from the 'contacts' table when making a GET request to the Supabase endpoint, similar to the successful response in Postman.
Screenshots
Directly hitting https://${subdomain}.supabase.co/rest/v1/contacts from postman:
Trying to make call https://${subdomain}.supabase.co/rest/v1/contacts through Node.js
Here's the code
System information