Skip to main content

createSolvaPayClient

SolvaPay SDK


SolvaPay SDK / server/src / createSolvaPayClient

Function: createSolvaPayClient()

createSolvaPayClient(opts): SolvaPayClient

Defined in: packages/server/src/client.ts:62

Creates a SolvaPay API client that implements the full SolvaPayClient interface.

This function creates a low-level API client for direct communication with the SolvaPay backend. For most use cases, use createSolvaPay() instead, which provides a higher-level API with paywall protection.

Use this function when you need:

  • Direct API access for custom operations
  • Testing with custom client implementations
  • Advanced use cases not covered by the main API

Parameters

opts

ServerClientOptions

Configuration options

Returns

SolvaPayClient

A fully configured SolvaPayClient instance

Throws

If API key is missing

Example

// Create API client directly
const client = createSolvaPayClient({
apiKey: process.env.SOLVAPAY_SECRET_KEY!,
apiBaseUrl: 'https://api.solvapay.com' // optional
});

// Use client for custom operations
const agents = await client.listAgents();

See

Since

1.0.0