Skip to content
Sign upLog in
← Back to Community
Check if code is running on repl.it (platform)
Profile icon
techpixel

Is there a way to check if the platform my code is running on is repl.it? The solution with environ variables can be easily bypassed.

Voters
Profile icon
MikhailBusko
Profile icon
ironblockhd
Profile icon
techpixel
Comments
hotnewtop
Profile icon
ironblockhd

I don't think theres a way to do it that can't be bypassed, the easiest way would indeed be to look if the environment variable REPL_ID exists

Profile icon
techpixel

@ironblockhd
I guess that's the best solution available, but I might try doing something with polygott

Profile icon
Coder100

Hi, the only way to do it is to visit the repl to see if its online or not.

Profile icon
techpixel

@Coder100
That's not what I meant. Im building a library that is only supposed to work on repl.it. I want to test if the code is running on repl.it servers or normal hardware. I'll reword my question

Profile icon
Coder100

oh, well, repl.it uses a linux shell, so you could check for that, but otherwise there is no difference.

@HarperframeInc