API Key Management
API key management — secure storage, environment variables,.env files, rotation.
Last updated
Was this helpful?
Was this helpful?
import os
from layerlens import Stratix
# Secure: Load from environment variables
client = Stratix(
api_key=os.getenv('LAYERLENS_STRATIX_API_KEY'),
)# Add to your shell profile (.bashrc,.zshrc, etc.)
export LAYERLENS_STRATIX_API_KEY="sk-your-key-here"
# Reload your shell configuration
source ~/.bashrc # or ~/.zshrc# Command Prompt (persistent)
setx LAYERLENS_STRATIX_API_KEY "sk-your-key-here"
# PowerShell (session-only)
$env:LAYERLENS_STRATIX_API_KEY="sk-your-key-here"#.env
LAYERLENS_STRATIX_API_KEY=sk-your-key-herefrom dotenv import load_dotenv
import os
# Load environment variables from.env file
load_dotenv()
from layerlens import Stratix
# Now environment variables are available
client = Stratix()#.gitignore.env.env.local.env.*.local
*.env