Secret Management

If you have API keys or database passwords that you cannot store in your public GitHub repository, you should create a secret and access it in your code using the following approach.

1) Create a secret on the Health Universe website using lowercase. You can do this by finding the button with two dots in the top right of your app detail page:

After clicking "Secrets Management," you can create a secrete using this form.

Important: Secrets can contain letters, numbers or the "-" and "_" characters only. They must start with a letter or number.

2) Access your secret using UPPERCASE from your code.

import os
foo = os.environ.get("FOO")

Note, when you access a secret using os.environ.get() you access the secret using UPPERCASE variable names. If you do not use uppercase, you will not be able to access your secret.

Last updated