Ask coding questions

← Back to all posts
Cannot Restrict my Google API key to my Repl.it
Leo32345

I recently made a project using the Google Developers API and hosted it on Repl.it. However, when I try to restrict my Google API key to my Repl.it url, it blocks access completely.

I have a feeling this issue has to do with Repl.it; does anyone know how to fix this?

Voters
Leo32345
Comments
hotnewtop
EpicGamer007

Try to go the the shell of the repl and type printenv REPL_ID then go to <INSERT REPL ID RETURNED BY THE PREVIOUS command>.id.repl.co. Confirm that works then put that on the whitelist for the url

Leo32345

@EpicGamer007 I tried that, but it does not work for some reason

Leo32345

Is there some way to see all the domains that requested API data on the Google Developers console so maybe I can make sure I am using the right domain?

Coder100

Try opening it into a new window, the embedded output is different than the one you see in replname.username.repl.co

Leo32345

@Coder100 Yes, I actually always go to the actual webpage to see the results, but doing so doesn't fix the issue.

ch1ck3n

what url did you set it on google and what is the URL of the repl?

Leo32345

@ch1ck3n I added the following URLs:

Then I tried the following but to no avail: