Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Antony-Figueroa/my-evershop-app/llms.txt
Use this file to discover all available pages before exploring further.
Extension Configuration
Extensions are the core building blocks of EverShop’s modular architecture. They encapsulate business logic, API endpoints, page components, and background jobs.Configuration Location
Extensions are configured in thesystem.extensions array within your configuration files:
config/default.json- Base extension configurationconfig/development.json- Development overridesconfig/production.json- Production overrides
Extension Schema
Each extension in the configuration array must follow this schema:Unique identifier for the extension. Used internally by EverShop to reference the extension.Example:
"offlinePayments", "productCatalog"Path to the extension directory, relative to the project root.Format:
"extensions/{extension-name}"Example: "extensions/offlinePayments"Controls whether the extension is active. Set to
false to disable without removing the configuration.Default: trueConfiguration Example
Here’s the actual extension configuration fromconfig/default.json:
Built-in Extensions
This project includes the following extensions:offlinePayments
Offline Payment Methods Extension
Offline Payment Methods Extension
Provides offline payment methods for checkout, including:
- Cash on Delivery (COD)
- Bank Transfer
extensions/offlinePayments/Components:src/pages/frontStore/checkout/cod/CashOnDelivery.tsxsrc/pages/frontStore/checkout/transfer/BankTransfer.tsx
productCatalog
Product Catalog Extension
Product Catalog Extension
Extends product functionality with additional catalog features.Location:
extensions/productCatalog/Components:- GraphQL extensions for product types
- Front store supplement information display
src/graphql/types/ProductExtension/ProductExtension.resolvers.jssrc/pages/frontStore/productView/SupplementInfo.tsx
productReviews
Product Reviews Extension
Product Reviews Extension
Enables customer reviews and ratings on product pages.Location:
extensions/productReviews/Components:- Product review display on product detail pages
src/pages/frontStore/productView/ProductReviews.tsx
Extension Directory Structure
A typical extension follows this structure:Managing Extensions
Enabling an Extension
To enable an existing extension:-
Update
config/default.json: -
Rebuild the application:
Disabling an Extension
To temporarily disable an extension without removing it:-
Set
enabledtofalse: -
Rebuild:
Disabled extensions remain in the codebase but their routes, components, and logic are not loaded.
Adding a New Extension
To add a custom extension:-
Create the extension directory:
-
Create
package.json: -
Create
tsconfig.json: -
Register in
config/default.json: -
Rebuild:
Extension Development
Bootstrap File
Extensions can include abootstrap.ts file for initialization logic:
API Endpoints
Create REST API endpoints with aroute.json configuration:
Page Components
Page components are React components with special exports:Environment-Specific Configuration
You can enable different extensions per environment:Development Extensions
Development Extensions
Production Extensions
Production Extensions
Best Practices
Extension Naming
- Use descriptive, lowercase names
- Use camelCase for multi-word names
- Prefix custom extensions to avoid conflicts (e.g.,
mystore-shipping)
Extension Dependencies
- Keep extensions independent when possible
- Document any dependencies on other extensions
- Use event subscribers for inter-extension communication
Version Control
- Commit extension source code to version control
- Exclude
dist/directories (auto-generated) - Document extension configuration in README files
Common Issues
Extension not loading after enabling
Extension not loading after enabling
Ensure:
- The extension path in
resolveis correct package.jsonexists in the extension directory- You’ve run
npm run buildafter configuration changes - No syntax errors in extension code
TypeScript compilation errors
TypeScript compilation errors
Verify:
tsconfig.jsonis properly configured- All dependencies are installed
- TypeScript types are available (
@types/react, etc.) - Import paths are correct
Related Configuration
- Shop Settings - Configure language and currency
- Theme Configuration - Configure active theme
Next Steps
- Learn about Theme Configuration
- Explore the sample extension structure
- Create your first custom extension