Skip to main content

Overview

EverShop uses a JSON-based configuration system with environment-specific overrides. Configuration files control extensions, themes, shop settings, and system behavior.

Configuration Files

File Hierarchy

Configuration files are merged in order: default.json → environment file → .env variables.

Configuration Structure

Base Configuration (config/default.json)

Here’s the actual configuration from the project:
config/default.json
object
Store-level settingsProperties:
  • language - Default store language (ISO 639-1 code)
  • currency - Currency code (ISO 4217)
object
System-level settingsProperties:
  • extensions - Array of extension configurations
  • theme - Active theme name

Development Configuration

config/development.json
Development config typically includes:
  • Debug flags
  • Local database connections
  • Development-only extensions
  • Verbose logging

Production Configuration

config/production.json
Production config should:
  • Use environment variables for secrets
  • Enable caching
  • Disable debug logging
  • Use production database

Extension Configuration

Extension Object Structure

Real Examples

Adding New Extensions

To register a new extension:
1

Create Extension Directory

2

Update config/default.json

3

Restart Development Server

Extensions are loaded in the order they appear in the configuration array.

Theme Configuration

Setting Active Theme

config/default.json
This tells EverShop to load components from themes/anasuplements/.

Switching Themes

Changing themes requires a rebuild:

Shop Configuration

Language Settings

This sets Spanish as the default language. Translation files should exist at:

Currency Settings

Supported currencies:
  • USD - US Dollar
  • EUR - Euro
  • GBP - British Pound
  • CAD - Canadian Dollar
  • And more…

Environment Variables

.env File

Sensitive configuration goes in .env (never commit this file):
.env
Always add .env to .gitignore:

Accessing Environment Variables

Advanced Configuration

Conditional Extension Loading

You can enable/disable extensions per environment:

Extension-Specific Configuration

Extensions can read custom config:
config/default.json
extensions/emailNotifications/src/bootstrap.ts

Configuration Best Practices

Bad:
Good:
Keep default.json minimal and override in environment files:
config/default.json
config/production.json
If extensions depend on each other, document the required load order:

Troubleshooting

Extension Not Loading

1

Check Configuration

Verify extension is registered in config/default.json:
2

Verify Path

Ensure the resolve path is correct:
3

Check Enabled Flag

Make sure "enabled": true
4

Rebuild

Theme Not Applying

1

Check Theme Name

2

Verify Theme Directory

3

Rebuild Theme

Configuration Not Merging

Config files merge using deep merge:

Configuration API

Reading Configuration in Code

Setting Configuration Programmatically

Programmatic changes are not persisted to disk. They only exist during the current process.

Example Configurations

Minimal Setup

config/default.json

Full Production Setup

config/production.json

Next Steps

System Architecture

Learn how extensions and themes work together

Create Extension

Build your first extension