Skip to content

VirtusLab-Open-Source/strapi-plugin-open-mercato

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Logo - Strapi Plugin Open Mercato

Strapi Open Mercato Plugin

Seamless Open Mercato integration for your Strapi instance

NPM version Monthly download on NPM CircleCI Build Status codecov

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.

πŸ“‹ Table of Contents

✨ Features

  • 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)

πŸ“‹ Requirements

  • Strapi v5.7.0 or later
  • Node.js 18+
  • An Open Mercato instance with REST API access
  • For Redis cache: a running Redis instance

πŸ“¦ Installation

npm install @sensinum/strapi-plugin-open-mercato@latest
# or
yarn add @sensinum/strapi-plugin-open-mercato@latest

Then, rebuild your Strapi admin panel:

npm run build
# or
yarn build

πŸ”§ Plugin Configuration

Required Configuration

Configure 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 Strapi
  • apiUrl (string, optional): Your Open Mercato instance URL (e.g. https://my-instance.openmercato.com)
  • accessToken (string, optional): Your Open Mercato API access token
  • engine (string, optional, default not set): Cache engine β€” 'memory' or 'redis'
  • connection (object, required if engine is 'redis'): Redis connection details:
    • host (string)
    • port (number)
    • db (number)
    • password (string, optional)
    • username (string, optional)

Example Configurations

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.

πŸ‘¨β€πŸ’» Development & Testing

  • Build: yarn build
  • Test backend: yarn test:server
  • Test frontend: yarn test:ts:front

πŸ”— Links

πŸ’¬ Community Support

  • GitHub (Bug reports, contributions)
  • Discord (For live discussion with the Community and Strapi team)
  • Community Forum (Questions and Discussions)

πŸ“„ License

See the MIT License file for licensing information.

About

Open Mercato x Strapi Integration

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors