there are many plugins which do this by adding a section to the Admin menu where API keys/secrets can be entered and stored in the database.
On the other hand, if you are uncomfortable storing keys in the database, you could use environment variables, accessing them (server-side) with
The Core mail service is an example where both techniques are used. you can set your connection string either in
or as part of the Shop's settings.https://github.com/Brewline/reserve-reaction/blob/master/server/api/core/email/config.js#L69-L185