Documentation
Secrets
Store sensitive data like API keys and passwords securely. Secrets are encrypted and injected into scripts at runtime.
Creating Secrets
- Go to Secrets in the sidebar
- Click New Secret
- Enter a name (e.g.,
API_KEY) - Enter the secret value
Using Secrets in Scripts
Secrets are available as environment variables:
import os
# Access your secret
api_key = os.environ.get('API_KEY')
db_password = os.environ.get('DB_PASSWORD')
# Use them securely
print(f"Connecting with key: {api_key[:4]}***")
Best Practices
- Use descriptive names like
STRIPE_API_KEY - Never print full secret values in logs
- Rotate secrets periodically
- Use separate secrets for production vs development