Managing Secrets

Safely storing sensitive information, like API keys, is easy with the Secrets section.

The Secrets tab in the Configuration section is your go-to place for securely storing sensitive information like API keys. This ensures your app’s backend stays safe and organized.

Storing secrets : 1) Use the Agent to Store Secrets ; Right: Chat with the Agent and let it handle it for you. 2) Adding Secrets Manually ; Go to the Secrets tab in the Configuration menu on the left and add your New Secret and corresponding Value.

The easiest way to manage secrets is by letting the Agent handle it for you:

  1. Ask the Agent to store a secret.

  2. It will open an input box in the chat where you can enter your secret.

  3. Once submitted, the secret is securely saved in the Secrets section.


Adding Secrets Manually

  1. Go to the Secrets tab in the Configuration section.

  2. Click the + button to add a new secret.

  3. Enter a Name (e.g., OPENAI_API_KEY) and its Value (e.g., your API key).

  4. Hit Save to securely store the secret.


Frequently Asked Questions

How does the Databutton Agent handle secrets?

Databutton uses its own internal Python package that the agent is well-versed in for securely handling secrets. Here’s an example of how the agent retrieves a secret:

import databutton as db

api_key = db.secrets.get("OPENAI_API_KEY")

The above command retrieves the API key stored in the Secrets section under the name "OPENAI_API_KEY"

Can the secrets be accessed via the frontend?

No, secrets are securely stored and can only be accessed from the backend of your app.

Last updated

Was this helpful?