PriceFX Currency Converter
Currency exchange rate conversion plugin for Medusa with support for multiple rate providers including Frankfurter, Exchangerate API, and CurrencyLayer
Overview
The medusa-plugin-pricefx is a currency exchange rate conversion plugin for Medusa commerce platforms. This plugin integrates with multiple exchange rate providers to provide accurate, up-to-date currency conversion for multi-currency stores.
Supported Platforms
The plugin supports three different exchange rate providers with varying features:
| Service | Free Tier | Update Frequency | Best For |
|---|---|---|---|
| Frankfurter | Unlimited requests | Daily | High-volume stores |
| Exchangerate API | 1,500 requests/month | Daily | Medium-traffic stores |
| CurrencyLayer | 100 requests/month | Real-time | Real-time rate needs |
System Requirements
Before installing the plugin, ensure your system meets the following requirements:
- Medusa server: v2.7.0 or later
- Node.js: v20 or later
Installation
Install the plugin using npm:
npm i medusa-plugin-pricefx
Configuration
Configure the plugin in your medusa-config.js file:
module.exports = {
plugins: [
{
resolve: "medusa-plugin-pricefx",
options: {
platform: 'frankfurter', // or 'exchange-rate' or 'currency-layer'
access_token: '', // Required for some platforms
ttl: 3600, // Cache TTL in seconds, set to 0 to disable caching
},
}
]
}
Configuration Options
platform
Choose your preferred exchange rate provider:
'frankfurter'- Free, unlimited requests with daily updates'exchange-rate'- 1,500 free requests/month with daily updates'currency-layer'- 100 free requests/month with real-time updates
access_token
API token for the selected platform (required for some providers):
- Frankfurter - No token required
- Exchangerate API - Token required (get token)
- CurrencyLayer - Token required (get token)
ttl
Cache time-to-live in seconds:
- Default: 3600 (1 hour)
- Disable caching: Set to 0
- Recommended: 3600-86400 (1-24 hours) depending on your update frequency needs
Environment Variables
Alternatively, configure using environment variables:
PRICEFX_PLATFORM=frankfurter
PRICEFX_ACCESS_TOKEN=your_api_token_here
PRICEFX_TTL=3600
Then reference in your config:
{
resolve: "medusa-plugin-pricefx",
options: {
platform: process.env.PRICEFX_PLATFORM,
access_token: process.env.PRICEFX_ACCESS_TOKEN,
ttl: parseInt(process.env.PRICEFX_TTL || '3600'),
},
}
Features
- Multiple Providers - Choose from three reliable exchange rate services
- Flexible Caching - Configurable TTL for optimal performance
- Real-time Rates - Access to real-time rates (with CurrencyLayer)
- Daily Updates - Automatic daily rate updates (with Frankfurter/Exchangerate)
- Easy Integration - Simple configuration and setup
Use Cases
This plugin is ideal for:
- Multi-Currency Stores - Display prices in multiple currencies
- International Sales - Accurate pricing for global customers
- Dynamic Pricing - Real-time currency conversion
- Price Display - Show converted prices at checkout
Choosing a Provider
Use Frankfurter if:
- You need unlimited requests
- Daily updates are sufficient
- You want a completely free solution
- You have high traffic volume
Use Exchangerate API if:
- You need daily updates
- Traffic is moderate (under 1,500 requests/month)
- You want a balance of features and cost
Use CurrencyLayer if:
- You need real-time exchange rates
- Traffic is low (under 100 requests/month)
- Accuracy is critical for your business
Performance Tips
- Enable Caching - Use a TTL of 3600+ seconds to reduce API calls
- Choose Appropriate Provider - Match provider to your traffic volume
- Monitor Usage - Track API request usage to avoid limits