A Strapi plugin that connects your Strapi application with Open Mercato through a user-friendly interface. It features a custom product field and efficient product synchronization via the Open Mercato REST API (/catalog/products). The plugin comes with configurable caching mechanisms to optimize performance.
- β¨ Features
- π Requirements
- π¦ Installation
- π§ Plugin Configuration
- π¨βπ» Development & Testing
- π Links
- π¬ Community Support
- π License
- Attach Open Mercato products to Strapi Content Types using a dedicated custom field
- Automatic product data synchronization via REST API
- Built-in caching (in-memory or Redis)
- Strapi v5.7.0 or later
- Node.js 18+
- An Open Mercato instance with REST API access
- For Redis cache: a running Redis instance
npm install @sensinum/strapi-plugin-open-mercato@latest
# or
yarn add @sensinum/strapi-plugin-open-mercato@latestThen, rebuild your Strapi admin panel:
npm run build
# or
yarn buildConfigure the plugin in your Strapi project's ./config/plugins.js (or .ts):
encryptionKey(string, required): A 32-character string used for encrypting sensitive data stored in StrapiapiUrl(string, optional): Your Open Mercato instance URL (e.g.https://my-instance.openmercato.com)accessToken(string, optional): Your Open Mercato API access tokenengine(string, optional, default not set): Cache engine β'memory'or'redis'connection(object, required ifengineis'redis'): Redis connection details:host(string)port(number)db(number)password(string, optional)username(string, optional)
Using Memory Engine:
// ./config/plugins.js
module.exports = ({ env }) => ({
'open-mercato': {
enabled: true,
config: {
encryptionKey: env('OPEN_MERCATO_ENCRYPTION_KEY'),
apiUrl: env('OPEN_MERCATO_API_URL'),
accessToken: env('OPEN_MERCATO_ACCESS_TOKEN'),
engine: 'memory',
},
},
});Using Redis Engine:
// ./config/plugins.js
module.exports = ({ env }) => ({
'open-mercato': {
enabled: true,
config: {
encryptionKey: env('OPEN_MERCATO_ENCRYPTION_KEY'),
apiUrl: env('OPEN_MERCATO_API_URL'),
accessToken: env('OPEN_MERCATO_ACCESS_TOKEN'),
engine: 'redis',
connection: {
host: env('REDIS_HOST', '127.0.0.1'),
port: env.int('REDIS_PORT', 6379),
db: env.int('REDIS_DB', 0),
password: env('REDIS_PASSWORD', undefined),
username: env('REDIS_USERNAME', undefined),
},
},
},
});Remember to add the corresponding environment variables to your .env file.
- Build:
yarn build - Test backend:
yarn test:server - Test frontend:
yarn test:ts:front
- GitHub (Bug reports, contributions)
- Discord (For live discussion with the Community and Strapi team)
- Community Forum (Questions and Discussions)
See the MIT License file for licensing information.
