When you want to hold some configurable data, you use custom setting. Like You have an Integration and this work on some auth code. This will be different for Sandbox and production. Si for this scenario, you can use custom setting and Put your key there. Advantage will be, when you will deploy your code to PROD, you just need to change the custom setting value and that's all.
Si for this scenario, you can use custom setting and Put your key there. Advantage will be, when you will deploy your code to PROD, you just need to change the custom setting value and that's all.