Overview
Nexus Access Vault uses environment variables for configuration. All variables are defined in the.env file at the root of your project. Copy .env.example to .env and configure the values for your deployment.
Variable Categories
Supabase
Database and authentication backend
Zitadel
OIDC authentication provider
Network
Network access and isolation
Supabase Configuration
These variables configure the connection to your Supabase backend.VITE_SUPABASE_PROJECT_ID
Your Supabase project ID. Find this in your Supabase project settings.Example:
The project ID is visible in your Supabase project URL:
https://app.supabase.com/project/[PROJECT_ID]VITE_SUPABASE_PUBLISHABLE_KEY
Your Supabase anon/public API key. This key is safe to use in a browser.Example:
Find this in your Supabase project settings under API → Project API keys → anon public
VITE_SUPABASE_URL
The full URL to your Supabase project API endpoint.Example:
Find this in your Supabase project settings under API → Project URL
Zitadel OIDC Configuration
These variables configure authentication using Zitadel as the OIDC provider.Before configuring these variables, you must create an OIDC application in your Zitadel instance. See Zitadel OIDC Setup for detailed instructions.
VITE_ZITADEL_ISSUER_URL
The base URL of your Zitadel instance. This is used for OIDC discovery.Example:
VITE_ZITADEL_CLIENT_ID
The client ID of your OIDC application in Zitadel.Example:
This is generated when you create an OIDC application in Zitadel. Find it in your Zitadel project under the application settings.
VITE_ZITADEL_REDIRECT_URI
The redirect URI where users will be sent after authentication. This must match the redirect URI configured in your Zitadel application.Examples:Development:Production (VPN):Production (Domain):
Network Configuration
These variables control network access and isolation for your deployment.VITE_NETWORK_MODE
Controls the network access mode for the application.Values:
internal: Restricts access to internal network only (VPN required)public: Allows public internet access
When set to
internal, the application will enforce VPN-only access. Users must be connected to your Netbird network or VPN to access the portal.VITE_INTERNAL_HOST
The internal IP address or DNS name where the application is accessible on your VPN network.Examples:Using Netbird IP:Using internal DNS:
This should be the IP or hostname assigned by your VPN solution (Netbird, Tailscale, WireGuard, etc.)
Complete Configuration Example
Here’s a complete example.env file with all variables configured:
.env
Environment-Specific Configurations
Development Environment
.env.development
Production Environment
.env.production
Validation
You can validate your environment configuration by running the development server:Build-Time vs Runtime
All environment variables prefixed withVITE_ are embedded into the application at build time. This means:
Important: If you change any
VITE_* variable, you must rebuild the application:Security Considerations
Sensitive Variables
Sensitive Variables
The following variables contain sensitive information:
VITE_SUPABASE_PUBLISHABLE_KEY(safe to expose in browser)- Zitadel client secrets (if using confidential clients)
.env.example with placeholder values instead.VITE_ Prefix Exposure
VITE_ Prefix Exposure
All variables prefixed with
VITE_ are exposed in the browser bundle. This is intentional and safe for:- Public API keys (like Supabase anon key)
- OIDC configuration (client ID, issuer URL)
- Network configuration
VITE_ prefix for truly secret values like service account tokens or private keys.Redirect URI Security
Redirect URI Security
The redirect URI must be an exact match in Zitadel. This prevents authorization code interception attacks.Always use:
https://in production (except for internal VPN addresses)- Exact protocol, host, port, and path matches
- No wildcards in redirect URIs
Troubleshooting
Variables not taking effect
Variables not taking effect
If your environment variables aren’t being applied:
- Ensure you’ve created
.envfile (not just.env.example) - Rebuild the application:
npm run build - Restart the development server:
npm run dev - Check that variables are prefixed with
VITE_ - Verify no syntax errors in
.envfile
Supabase connection fails
Supabase connection fails
If you can’t connect to Supabase:
- Verify project ID matches your Supabase project
- Check that the anon key hasn’t been rotated
- Ensure the URL includes
https://and.supabase.co - Test the URL in your browser to verify it’s accessible
- Check Supabase project status in the dashboard
Zitadel authentication fails
Zitadel authentication fails
If authentication with Zitadel doesn’t work:
- Verify issuer URL is accessible from your browser
- Check that client ID exactly matches Zitadel application
- Ensure redirect URI is added to allowed URIs in Zitadel
- Verify redirect URI matches exactly (protocol, host, port, path)
- Check browser console for OIDC error messages
Network mode not working
Network mode not working
If network isolation isn’t working:
- Verify
VITE_NETWORK_MODEis set tointernal - Check that
VITE_INTERNAL_HOSTmatches your VPN IP - Ensure you’re connected to the VPN:
netbird status - Rebuild the application after changing variables
- Test access from both inside and outside VPN
Next Steps
Database Setup
Configure and migrate your Supabase database
Network Configuration
Set up VPN-only access with Netbird
Zitadel OIDC
Configure Zitadel authentication
Self-Hosted Deployment
Complete deployment guide