Developing a Confluence Macro-Template App with Secure REST API Integration

We aim to develop a macro-template app within Confluence that integrates with a REST API. Our objective is to securely store the REST API key within Confluence for use by the macro-template. Since Confluence’s Storage API is not shared across different apps, we are seeking advice on the optimal architecture for this implementation.
We have tried to persist The Api Key using storage API from “Globalsetting” App but we can’t retrieve this parameter from the “macro-template” App, can you please advise ?