We can get the current environment type value by programmatically checking the current mode setup in the admin configuration.
There will be two possible environment types sandbox and production.
You need to create a PHP Class to render the function to fetch the current environment mode value,
