Not a good idea imo, because as your team grows, code is code and people will forget. Easier to use a vault, i.e. an external service where you store any secret, and from code you only load secrets from the vault.
We use knox [1], but there are other popular ones.
Edit: typos