Overview
TheRaveConstant class serves as the central configuration point for the Flutterwave Rave Java Library. It stores static fields for API credentials and environment settings that are used throughout the library.
Class Definition
Public Fields
Your Flutterwave secret key used for server-side API authentication. This key should be kept confidential and never exposed in client-side code.Access:
public staticYour Flutterwave public key used for client-side operations and initial API requests. This key can be safely exposed in frontend applications.Access:
public staticThe current environment setting that determines whether API calls are made to the staging or live Flutterwave servers. Must be set to either
Environment.STAGING or Environment.LIVE.Access: public staticUsage Example
Basic Configuration
Production Configuration
Important: Always configure
RaveConstant with your API credentials and environment before making any API calls. The library relies on these static fields for authentication and routing.Best Practices
- Never hardcode credentials in your source code. Use environment variables or secure configuration files.
- Keep SECRET_KEY secure and never expose it in client-side code or version control.
- Use STAGING environment for development and testing to avoid charges on real transactions.
- Validate credentials are set before initializing any Rave services.
Related
- Environment - Environment enum for configuration
- Endpoints - API endpoint management