GoogleSheets API credential issue

I have an app that I am deploying through Vercel. it works locally but when loading with vercel I get 500 errors on multiple APIs. I have my credentials in the vercel UI credential location and have tried many ways of formatting it (removing line breaks, “”“”, Etc) but still no success. Are there any other solutions I should try?

500 errors typically refers to server-side issues, although could you tell us a bit more about the exact error that you see? Have you also configured the relevant credentials under Vercel environment variables?

2 Likes

Hi @lemmeyg, welcome to the Vercel Community!

Yes, you should check the error logs on Vercel to learn more.

Thanks @aruns for jumping in. :raised_hands:

1 Like

image
Here is the error message from the console logs. In the Vercel logs I get …

… research suggests that my private key is not formatted correctly but I have tried a number of different adjustments and then redeployed. I have deployed via github and direct into vercel. I pushed my .env file from local to vercel’s environment variables. I was wondering if I could log the payload sent to the google API or if i needed to authorize this somehow in google but the key is still valid and everything is working in local so I would appreciate any insight / assistance offered.

Could you tell a bit more about the setup and app? What is private key here, a custom SSL implementation, and how exactly is it being used?

1 Like

+1 It would help to have this information.

@lemmeyg May also be worth asking v0?

1 Like

The app is built in cursor, typescript and using a service account for google sheets api. The private key is the standard key with “——-begin key here——-……———-end key here——-“\n ( from memory). I have tried it as one line, one line with \n removed, on multiple lines ( which gives a warning message in the vercel environment filed). I am wondering if there was any url restrictions when I set up the service account authentication so will try that next. But all suggestions are welcome. Is these any other info that would be useful? ( this isn’t my first app but I’m figuring this app dev thing out as I go and it’s my first prod google api)

Great idea. Tried cursor( what I used to build) and perplexity so far but not V0. Do you think I am on the tight track- I don’t think it is the code as it works in local, more likely to do with vercel or google. It would be good to get more insight into the payloads being sent but not sure how to achieve this. Thanks for your help.

I’m not sure I still understand why a SSL private key is required in this case. Since you’re building with Google Sheets API in Typescript, can you generate an API key and use it?

Yes, I have a private key, it’s fully functional in local. The private_key is used in both environments. I set up a service account for authentication as it seemed simpler ( at the time). I have multiple users of the app but didn’t want to do signs- ins.

Do you mind pointing me to Google documentation about how SSL keypair is used for authentication? Maybe with that information, I could help identify a way forward.

1 Like

here are the Docs.

let me know if you find anything. I appreciate any help you have.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.