Skip to content
← Back to Community
Cannot Restrict my Google API key to my Repl.it
Profile icon
h
has Hacker Plan
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
Profile icon
mochirondesu
Profile icon
Leo32345
Comments
hotnewtop
Profile icon
mochirondesu

Any answers yet?

Profile icon
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

Profile icon
Leo32345

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

Profile icon
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?

Profile icon
Coder100

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

Profile icon
Leo32345

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

Profile icon
ch1ck3n

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

Profile icon
Leo32345

@ch1ck3n I added the following URLs:

myprojectname.leo32345.repl.co

Then I tried the following but to no avail:

*.leo32345.repl.co *.repl.co *.replit.com
Profile icon
CakraDarma

@Leo32345 do you have solution for now?