← Back to Home

FMP Node API Documentation

Configuration

The FMP Node Wrapper supports multiple configuration options to suit different use cases and security requirements.

API Key Configuration

The FMP client supports three ways to provide your API key:

Option 1: Environment Variable (Recommended)

Set the FMP_API_KEY environment variable and initialize without parameters:

Setup:

Option 2: Direct Configuration

Provide the API key directly in the constructor:

Option 3: Mixed Configuration

Provide partial configuration and let the client fall back to environment variables:

Configuration Options

OptionTypeDefaultDescription
apiKeystringFMP_API_KEY env varYour FMP API key (optional if env var is set)
timeoutnumber10000Request timeout in milliseconds

Error Handling

The client provides clear error messages for configuration issues:

Security Best Practices

1. Use Environment Variables

Always use environment variables for API keys in production:

2. Never Commit API Keys

Ensure your .env file is in .gitignore:

3. Use Different Keys for Different Environments

Environment-Specific Configuration

Development

Production

Testing

Advanced Configuration

Multiple Client Instances

You can create multiple client instances with different configurations:

Troubleshooting

Common Issues

Issue: "FMP API key is required" error Solution: Set the FMP_API_KEY environment variable or provide it in the config

Issue: Environment variable not detected Solution:

  • Ensure the variable is set correctly
  • Restart your terminal/IDE
  • Check for typos in the variable name

Issue: Timeout errors Solution: Increase the timeout value:

Debugging

Enable debug logging to troubleshoot configuration issues:

Next Steps