Configuration
You now have the server and files setup, so we can get to configuring the bot. We will go over every variable in the .env file.
These environment variables are stored securely in your .env file to keep sensitive information like tokens and API keys safe.
Important
Never commit your .env file to version control or share it publicly. It contains sensitive credentials.
License Key
LICENSE_KEY=- You get this from https://shadowdevs.com/license. This is your license from us to use Shopify Bot.
- Example:
LICENSE_KEY=your_license_key_here
Discord Bot Configuration
-
DISCORD_TOKEN=- Your Discord bot token from the Discord Developer Portal.
- Navigate to your application > Bot tab > Click "Reset Token" to get your token.
- See the Discord Application Setup guide for detailed instructions.
- Example:
DISCORD_TOKEN=your_bot_token_here
-
CLIENT_ID=- Your Discord Application ID (also called Client ID).
- Navigate to your application > General Information > Copy the "Application ID".
- See the Discord Application Setup guide for detailed instructions.
- Example:
CLIENT_ID=your_bot_client_id_here
Shopify Configuration
-
SHOPIFY_SHOP_NAME=- Your Shopify store name (the part before
.myshopify.com). - For example, if your store is
https://my-store.myshopify.com, usemy-store. - Example:
SHOPIFY_SHOP_NAME=your-store-name
- Your Shopify store name (the part before
-
SHOPIFY_CLIENT_ID=- Your Shopify Admin API Client ID.
- Get this from your Shopify Dev Dashboard.
- See the Shopify App Setup guide for detailed instructions.
- Example:
SHOPIFY_CLIENT_ID=your_admin_api_client_id
-
SHOPIFY_CLIENT_SECRET=- Your Shopify Admin API Client Secret.
- Get this from your Shopify Dev Dashboard.
- Keep this secret secure! It provides access to your Shopify store data.
- Example:
SHOPIFY_CLIENT_SECRET=your_admin_api_client_secret
-
SHOPIFY_WEBHOOK_SECRET=(Optional)- Your Shopify Webhook Secret for webhook verification.
- Get this from your Shopify app settings when creating webhooks.
- This is optional but recommended for security.
- Example:
SHOPIFY_WEBHOOK_SECRET=your_webhook_secret_here
MongoDB Configuration
MONGODB_URI=- The MongoDB connection string for your database.
- For local MongoDB:
mongodb://localhost:27017/shopifybot - For MongoDB Atlas:
mongodb+srv://username:[email protected]/shopifybot - Example:
MONGODB_URI=mongodb://localhost:27017/shopifybot
Web Server Configuration
-
WEB_SERVER_PORT=- The port number for the ExpressJS web server.
- By default, this is
3000. Make sure this matches your Nginx configuration. - Example:
WEB_SERVER_PORT=3000
-
WEB_SERVER_URL=- The full URL where your web server is accessible.
- For local development:
http://localhost:3000 - For production, use your actual domain with HTTPS:
https://yourdomain.com - This is used for customer account linking and OAuth redirects.
- Example:
WEB_SERVER_URL=https://yourdomain.com
Logging Configuration
-
WEB_LOGGING=- Enable or disable console logging for web server requests.
- Set to
trueto enable,falseto disable. - Useful for debugging web server issues.
- Example:
WEB_LOGGING=true
-
WEBHOOK_LOGGING=- Enable or disable console logging for webhook processing.
- Set to
trueto enable,falseto disable. - Useful for debugging webhook integration with Shopify.
- Example:
WEBHOOK_LOGGING=true
Deployment Configuration
SKIP_DEPLOY=- Set to
trueto skip deploying slash commands to Discord on bot startup. - Set to
falsewhen running the bot for the first time or when you've added new commands. - After the first deployment, you can set this to
trueto make the bot load faster. - Make sure to set it to
falseafter any updates, so any command changes are deployed. - Example:
SKIP_DEPLOY=true
- Set to
Configuration Complete
Once you've filled in all the required values in your .env file, save it and you're ready to start the bot! Remember to restart the bot whenever you make changes to the .env file for them to take effect.