Authentication
Get Your API Key
- Visit Legnext Dashboard
- Log in to your account
- Navigate to API Keys section
- Create a new API key
- Copy and save it securely
Using Your API Key
Method 1: Direct Initialization
Method 2: Environment Variable (Recommended)
Set the environment variable:Method 3: .env File
Create a.env file:
Security Best Practices
⚠️ Never hardcode API keys in your code ✅ Always use environment variables or .env files ✅ Add.env to .gitignore to prevent accidental commits
✅ Rotate keys regularly and revoke compromised ones