How do I detect if the current workspace is the development workspace?

How do I detect if the current workspace is the development workspace? I our case, the development workspace has different IDā€™s depending on the developerā€¦

Hi @twj ,

For development workspaces, Workspace.app should return None.

Thank you for your answer.

In my search for the environment variable ā€œTOKENā€ that the documentation is mentioning for the API class, I came across an environment variable called ā€œENVIRONMENTā€ where the value is ā€œdevelopmentā€ in development and ā€œproductionā€ in production. Is there a reason why you did not recommend that one?

So the solution can be: os.getenv("ENVIRONMENT") == "development"

Hi @twj,
I wasnā€™t fully aware of this env variable, that should work fine. Although Iā€™d say be cautious with it, as env variables could potentially be overwritten.

FYI, the ā€˜tokenā€™ variable is there, as it should be set to your Personal access token. This is required to authenticate your api calls.

1 Like