Skip to main content
FinConnect reads provider credentials from the config object you pass at initialization. There is no global config file — each FintechSDK instance is scoped to one provider and one set of credentials. Use environment variables to keep credentials out of your source code.
Install the dotenv package (npm install dotenv) and call require('dotenv').config() (or import 'dotenv/config') at the top of your entry file to load .env values into process.env automatically.

Environment variables

Add a .env file to your project root with the variables for the providers you use:
Add .env to your .gitignore so credentials are never committed to version control.

PesaPal configuration

Pass these fields in the config object when initializing with ProviderType.pesapal:

ClickPesa configuration

Pass these fields in the config object when initializing with ProviderType.clickpesa:

Azampay configuration

Pass these fields in the config object when initializing with ProviderType.azampay:

Sandbox vs. production

You switch between sandbox and production by changing baseUrl. No other code changes are needed.
The SDK does not enforce which URL you use — passing a production URL in development will make real charges. Always verify your baseUrl before running payment flows.
The SDK is now using sandboxed URL
Azampay’s authentication method now uses the sandbox token generator

Validation

ProviderFactory validates that all required config fields are present before instantiating a provider. If any field is missing, the constructor throws immediately with a descriptive error:
This means misconfiguration fails fast at startup rather than at runtime during a payment request.