Environment Setup
Generate environment configuration files for your framework.
Configuration
Enter your API key and select your framework
Your key will only be used locally to generate the config
Security Tips
- Never commit API keys to version control
- Add .env.local to your .gitignore
- Client-exposed keys can be seen by users
.env.local
Environment variables for Next.js
# Katsau API Configuration # Get your API key at https://katsau.com/dashboard/keys KATSAU_API_KEY=ks_live_your_api_key_here KATSAU_API_URL=https://api.katsau.com
Usage Example
How to use environment variables in Next.js
// lib/katsau.ts
const KATSAU_API_KEY = process.env.KATSAU_API_KEY;
const KATSAU_API_URL = process.env.NEXT_PUBLIC_KATSAU_API_URL || 'https://api.katsau.com';
export async function extractMetadata(url: string) {
const response = await fetch(
`${KATSAU_API_URL}/v1/extract?url=${encodeURIComponent(url)}`,
{
headers: {
'Authorization': `Bearer ${KATSAU_API_KEY}`,
},
}
);
if (!response.ok) {
throw new Error(`API error: ${response.status}`);
}
return response.json();
}
// Usage in Server Component or API Route
// const data = await extractMetadata('https://github.com');Add to .gitignore
Make sure your environment files are not committed to version control:
# Environment files
.env
.env.local
.env.*.local
.env.development
.env.production
# API keys
*.pem
*.keyFramework Documentation
Environment Variable Best Practices
- Use different keys for development and production
- Store production secrets in your CI/CD platform
- Rotate keys periodically for security
- Use .env.example to document required variables
- Validate env vars at startup in production
- Never log or expose sensitive environment values