Troubleshooting Google API Access Restrictions for Vercel-Deployed Websites

Current versus Expected behavior

I’ve set up restrictions on the Google API to only allow requests from my website by specifying the website URL. However, when I deploy the app on Vercel, the restriction seems to block access from the website. The app works fine in the deployed environment if I remove the restriction, but I’d prefer to keep it in place for security. Could you please advise on how I can resolve this issue?

Code, configuration, and steps that reproduce this issue

Vercel Deploy Plan: → Hobby
Steps to reproduce:

  1. Go to Google API dashborad
  2. Choose my API key for this project
  3. Go to Restriction section
  4. Choose website
  5. Add website: *.example.vercel.app/*
  6. Save

Project information

Environment (local, preview, production): production
Node/Runtime Version: node 20.x
Package Manager: npm
Project Framework: Next.js v14

Hi, @lada496! Welcome to the Vercel Community :smile:

Is this your production URL? Or a vercel.app URL? Or both? Make sure that you include e all possible Vercel, custom, development domains.

Let us know how you’re getting on!

Hi @pawlean Thank you for your reply. I’m using vercel.app URL. I added both domain and development urls but I still get rejected :< Is there another reason you can come up with?

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