Detect environment is development/staging/production via code

Is there a way to detect environment using process.env... or another way?
console.log({ env: process.env.NODE_ENV }); returns “production”
Even though my deployed environment in the console is dev.
Deployed app to the DEV;

By environment I mean: Environments and versions (atlassian.com)

If you’re using the Node JS runtime you can use the App Context API

3 Likes

In addition to @AdamMoore response, you can check process.env in a resolver to also know if you are under a forge tunnel…

if ('FUNCTION_IS_SNAPSHOTTED' in env) return 'tunnel';