Downloading Platform-Specific Code
If you prefer to host your proxy function on your own infrastructure instead of using the EnvManager hosted proxy, you can download generated code for your deployment platform.
Supported Platforms
| Platform | Runtime | Generated File |
|---|---|---|
| Vercel | Edge Functions | api/proxy-{slug}.ts |
| Netlify | Edge Functions | netlify/edge-functions/proxy-{slug}.ts |
| Cloudflare | Workers | src/proxy-{slug}.ts |
| AWS Lambda | Node.js Lambda | lambda/proxy-{slug}.mjs |
How to Download
Open the Download Modal
On the proxy functions page, find the proxy you want to download. Click the three-dot menu on the proxy row and select Download Code.
Select a Platform
The download modal shows four platform options. Click the platform you deploy to. The generated code updates in the preview area.
Review the Code
The preview shows the complete, ready-to-deploy code. It includes:
- The proxy endpoint function
- Secret injection from environment variables
- CORS header handling based on your allowed origins
- The correct HTTP method and target URL
Copy or Download
- Copy Code -- copies the code to your clipboard
- Download -- downloads the code as a file with the correct filename and path for your platform
Deployment Instructions
After downloading the code, you need to:
- Place the file in the correct directory for your platform (shown in the modal)
- Set environment variables on the platform for each secret variable used in the proxy
- Deploy your application
Setting Environment Variables
The generated code reads secrets from environment variables on the hosting platform. The variable names match the keys from your EnvManager environment. You can set these manually on each platform, or use EnvManager's platform integrations to sync them automatically.
Hosted vs Self-Hosted
| Feature | Hosted Proxy | Self-Hosted (Downloaded Code) |
|---|---|---|
| Setup effort | None -- works immediately | Requires deploying to your platform |
| Secret management | Handled by EnvManager | You manage secrets on the hosting platform |
| Latency | Routes through EnvManager | Runs on your edge/server infrastructure |
| CORS | Configured in EnvManager | Configured in the generated code |
| Token authentication | x-proxy-token header required | Depends on your platform's auth setup |
| Billing | Counts against invocation limits | No invocation limits from EnvManager |
Self-hosted proxies run independently of EnvManager after download. Changes to the proxy configuration in EnvManager are not automatically reflected in the downloaded code. Download the code again after making changes.