How do I detect if the current environment which my script runs in is Runkit?
Runkit defines a lot of environmental variables that are sufficient to detect this. More specifically, we can detect RUNKIT_ENDPOINT_PATH, RUNKIT_ENDPOINT_URL, RUNKIT_MOUNT_PATH and RUNKIT_HOST:
RUNKIT_ENDPOINT_PATH
RUNKIT_ENDPOINT_URL
RUNKIT_MOUNT_PATH
RUNKIT_HOST
const isRunkit = typeof process.env.RUNKIT_ENDPOINT_PATH === "string" && typeof process.env.RUNKIT_ENDPOINT_URL === "string" && typeof process.env.RUNKIT_MOUNT_PATH === "string" && process.env.RUNKIT_HOST === "runkit.com"
Runkit defines a lot of environmental variables that are sufficient to detect this. More specifically, we can detect
RUNKIT_ENDPOINT_PATH,RUNKIT_ENDPOINT_URL,RUNKIT_MOUNT_PATHandRUNKIT_HOST: