How to judge whether it is a local environment or an online environment?

What flags are generally used to judge different environments?

process.env.NODE_ENV or url ? I want to use environment variable inside extension

@wenqi you can use something like this:

import { environment } from '@theia/core/shared/@theia/application-package/lib/environment';
const isElectron =; // Indicates whether we run in electron or web mode