Overview
Tesslate Studio provides secure management for API keys, environment variables, and other sensitive data your projects need.Secure Storage
Encrypted storage for sensitive data
Per-Project
Different keys for different projects
Environment Variables
Access via process.env in your code
Never Committed
Keys never appear in Git history
Types of Secrets
- AI Provider Keys
- Third-Party APIs
- Database
- Authentication
For AI agents
- OpenAI API keys
- Anthropic API keys
- OpenRouter keys
- Custom model providers
Managing AI Provider Keys
Adding Your Keys
1
Open Settings
Click profile → Settings → API Keys
2
Select Provider
Choose OpenAI, Anthropic, or OpenRouter
3
Enter Key
Paste your API key from the provider
4
Save
Click Save - key is encrypted
5
Verify
Test by using an AI agent
Getting API Keys
OpenAI
OpenAI
Where to get:
- Go to platform.openai.com
- Sign up or log in
- Go to API Keys section
- Create new secret key
- Copy and save (shown once)
Anthropic (Claude)
Anthropic (Claude)
Where to get:
- Go to console.anthropic.com
- Sign up or log in
- Go to API Keys
- Create new key
- Copy immediately (shown once)
OpenRouter
OpenRouter
Where to get:
- Go to openrouter.ai
- Sign up
- Go to Keys
- Generate API key
- Copy key
API keys are like passwords - never share them publicly or commit them to GitHub!
Project Environment Variables
Adding Variables
1
Open Project Settings
In your project, click Settings icon
2
Go to Environment
Navigate to Environment Variables tab
3
Add Variable
Click Add New Variable
4
Enter Details
- Variable name (e.g.,
STRIPE_KEY) - Value (the actual key/secret)
5
Save
Click Save - available in your code
Using in Code
Access environment variables in your React code:Vite requires environment variables to be prefixed with
VITE_ to be exposed to client-side code.Naming Conventions
Client-Side
VITE_ prefix required
VITE_API_URLVITE_STRIPE_PUBLIC_KEY- Accessible in browser
Server-Side
No prefix needed
DATABASE_URLSTRIPE_SECRET_KEY- Backend/API routes only
Secret Types
Public vs Private Keys
- Public/Publishable
- Secret/Private
Safe to expose
- Stripe publishable keys
- Firebase public config
- API base URLs
- Public app IDs
VITE_ prefixNever use
VITE_ prefix for secret keys! This exposes them to client-side JavaScript and anyone can see them.Security Best Practices
Never Commit Secrets
Never Commit Secrets
- Don’t put keys in code files
- Use environment variables
- Add
.envto.gitignore - Verify before committing
Rotate Keys Regularly
Rotate Keys Regularly
- Change API keys periodically
- Rotate after team member leaves
- Update if potentially exposed
- Use different keys per environment
Limit Key Permissions
Limit Key Permissions
- Use read-only keys when possible
- Restrict API key scopes
- Set usage limits
- Monitor key usage
Per-Project Keys
Per-Project Keys
- Different keys for each project
- Easier to track usage
- Better security isolation
- Simpler to rotate
Environment Files
.env Structure
Tesslate projects use.env files:
File Location
Commit
.env.example with placeholder values so team members know what variables are needed.Managing Multiple Environments
- Development
- Staging
- Production
Local development
- Test API keys
- Local database URLs
- Debug mode enabled
- Verbose logging
.env or .env.developmentViewing and Editing
In Tesslate Studio
1
Open Settings
Project → Settings → Environment Variables
2
View Variables
See all configured variables (values hidden)
3
Edit
Click variable to edit value
4
Delete
Remove unused variables
5
Restart
Restart dev server to apply changes
Values are Hidden
For security:- Values shown as
••••••••• - Click “Reveal” to see temporarily
- Never logged or displayed in console
- Not included in exports
Troubleshooting
Variable Not Working
Variable Not Working
Problem: Can’t access environment variableSolutions:
- Check variable name spelling
- Ensure
VITE_prefix for client-side - Restart development server
- Verify variable is saved
- Check .env file location
API Key Invalid
API Key Invalid
Problem: API key not workingSolutions:
- Verify key is correct (no extra spaces)
- Check key hasn’t expired
- Ensure sufficient API credits
- Verify key permissions/scope
- Try regenerating key
Variables in Git
Variables in Git
Problem: Accidentally committed secretsSolutions:
- Immediately rotate all exposed keys
- Remove from Git history (git filter-branch)
- Add .env to .gitignore
- Use .env.example for templates
- Consider using git-secrets tool
Server Not Restarting
Server Not Restarting
Problem: Changes not applyingSolutions:
- Manually restart dev server
- Check for syntax errors in .env
- Clear browser cache
- Verify file is saved
- Check file permissions
Best Practices
Use .env.example
Template for required variables
Document Variables
Comment what each variable does
Validate on Startup
Verify required variables exist
Rotate Regularly
Change keys periodically