Health Universe
  • Core Concepts
    • Overview of Health Universe
    • How Health Universe Works
  • Building Apps in Health Universe
    • Getting started with Health Universe
      • Create a Health Universe Account
      • Create a Github Account
      • Link your Github Account to your Health Universe Account
    • Creating a Workspace
    • Developing your Health Universe App
      • Streamlit vs FastAPI
      • Working in Streamlit
        • Typical Project Setup
        • Your First Health Universe App
        • Streamlit Best Practices
      • Working in FastAPI
        • Typical Project Setup
        • Your First Health Universe App
        • Navigator FastAPI best practices
    • Deploying your app to Health Universe
      • Deploying to Health Universe
      • Secret Management
      • Connecting to an LLM
      • Connecting to an external data source
  • Testing your app
  • Re-deploying your app
  • Document your app
  • Deleting your App on Health Universe
  • Additional resources
    • Data Formats, Standards & Privacy
    • External Tools and Libraries
Powered by GitBook
On this page

Was this helpful?

  1. Building Apps in Health Universe
  2. Deploying your app to Health Universe

Secret Management

PreviousDeploying to Health UniverseNextConnecting to an LLM

Last updated 19 days ago

Was this helpful?

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. For example, if you want to access a private database, or use an LLM like ChatGPT, you'll need to have API keys to manage access.

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 secret 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.