I am creating a Apex class to report bugs to Bugsnag. This integration requires an API key as described in the documentation.
In other environments, I usually store this kind of information outside the code (i.e. .env file), so that I can easily change it without updating the source code.
I was wondering what would be the equivalent of an .env file or a .properties file when writing Apex classes.
I've created a new Custom Setting Definition (Hierarchy) called BugsnagSettings__c with a Custom Field API_KEY__c.
Here is how I consume it inside my APEX class:
BugsnagSettings__c bugsnagSettings = BugsnagSettings__c.getOrgDefaults(); String apiKey = bugsnagSettings.API_Key__c;