.env file in the root of your project.
Setup
Copy the.env.example file to .env and update the values according to your environment:
Variables Reference
VITE_PUBLIC_URL
The public URL where your Stiletto instance is hosted.Example:
https://stiletto.deeme.devThis is used for:- Generating absolute URLs
- Social media meta tags
- API callbacks and redirects
VITE_RESOURCES_URL
The URL of the API endpoint that serves static resources including icons, images, and map tiles.This endpoint should provide:
- Item icons
- Walker images
- Map tiles generated using gdal2tiles-leaflet
- Other game assets
VITE_API_URL
The base URL of the Stiletto API server.The API handles:
- Clan management
- Trading system
- Discord integration
- Walker tracking
- User authentication
- Diplomacy and alliance systems
VITE_DISCORD_CLIENT_ID
Your Discord application’s client ID for OAuth integration.Used for:
- Discord OAuth login
- Linking clans to Discord servers
- Discord bot integration
- Go to the Discord Developer Portal
- Create a new application or select an existing one
- Copy the “Application ID” from the General Information page
VITE_PLAUSIBLE_URL
The URL for Plausible Analytics integration (privacy-friendly analytics).If you’re using Plausible for analytics, provide your instance URL here. Leave empty if not using analytics.Example:
https://plausible.io or your self-hosted instanceVITE_VERSION
The current version of the application.This is automatically populated from
package.json during build. You typically don’t need to set this manually.Current version: 5.45.0Example Configuration
Here’s a complete example.env file:
.env
Development vs Production
Development Environment
Development Environment
For local development, you can point to localhost or development servers:
Production Environment
Production Environment
For production, use your actual domain and API endpoints:
Using Environment Variables
In your code, access these variables using Vite’s import.meta.env:All environment variables in Vite must be prefixed with
VITE_ to be exposed to your application code.Troubleshooting
Variables not loading
Variables not loading
- Ensure your
.envfile is in the project root - Restart your development server after changing
.env - Check that variable names are prefixed with
VITE_
Discord integration not working
Discord integration not working
- Verify your Discord Client ID is correct
- Check that your redirect URIs are configured in the Discord Developer Portal
- Ensure the client ID matches your environment (dev vs production)
API connection issues
API connection issues
- Verify the API URL is accessible
- Check for CORS configuration on the API server
- Ensure the API is running and healthy
Related Resources
Contributing Guide
Learn how to set up your development environment
API Documentation
Explore the Stiletto Node API repository