Installation
Install the plugin using npm:Configuration & Parameters
The plugin requires a configuration object with the following parameters:Required Parameters
Optional Parameters
Usage Examples
Basic Usage
Full Configuration with Historical Rates
Using Utility Functions
Troubleshooting
Common Error Messages
Error Handling
The plugin handles errors gracefully by attaching them directly to records in Flatfile:- Validation errors: Attached to specific fields using
record.addError(fieldName, message) - API/Network errors: Attached as general record errors using
record.addError('general', message)
Notes
Requirements
- An active subscription to the Open Exchange Rates API is required
- The
OPENEXCHANGERATES_API_KEYenvironment variable must be set in your Flatfile Space with your API key
Limitations
- All currency conversions are routed through USD as a base currency due to Open Exchange Rates API limitations on free/lower-tier plans
- The
dateFieldmust contain dates inYYYY-MM-DDformat only - Converted amounts are fixed to 4 decimal places
- Exchange rates are fixed to 6 decimal places
Default Behavior
- When
dateFieldis not provided, the plugin uses the current date to fetch the latest exchange rates - When
exchangeRateFieldis not provided, the calculated exchange rate is not stored on the record - When
conversionDateFieldis not provided, the conversion timestamp is not stored on the record - Empty date fields default to the current date in YYYY-MM-DD format

