CreateSolvaPayConfig
SolvaPay SDK / server/src / CreateSolvaPayConfig
Interface: CreateSolvaPayConfig
Defined in: packages/server/src/factory.ts:33
Configuration for creating a SolvaPay instance.
You can provide either an apiKey (for production) or an apiClient (for testing).
If neither is provided, the SDK will attempt to read SOLVAPAY_SECRET_KEY from
environment variables. If no API key is found, the SDK runs in stub mode.
Example
// Production: Use API key
const config: CreateSolvaPayConfig = {
apiKey: process.env.SOLVAPAY_SECRET_KEY
};
// Testing: Use mock client
const config: CreateSolvaPayConfig = {
apiClient: mockClient
};
Properties
apiBaseUrl?
optionalapiBaseUrl:string
Defined in: packages/server/src/factory.ts:50
Optional API base URL override (only used with apiKey). Defaults to production API URL if not provided.
apiClient?
optionalapiClient:SolvaPayClient
Defined in: packages/server/src/factory.ts:44
API client for testing or custom implementations. Use this for stub mode, testing, or custom client implementations.
apiKey?
optionalapiKey:string
Defined in: packages/server/src/factory.ts:38
API key for production use (creates client automatically).
Defaults to SOLVAPAY_SECRET_KEY environment variable if not provided.