Installation & Configuration

How to install the prism library?

Start by installing the library from your terminal, using the programming language of your choice. This should be followed by configuring the environment and payment processor API keys to proceed with the next steps.

The below examples are templates for configuring Stripe and Adyen.

Prerequisites

Terminal
npm install hyperswitch-prism
index.js
const { PaymentClient } = require('hyperswitch-prism');
const { ConnectorConfig, ConnectorSpecificConfig, SdkOptions, Environment } = require('hyperswitch-prism').types;

// Configure Stripe client
const stripeConfig = ConnectorConfig.create({
    options: SdkOptions.create({ environment: Environment.SANDBOX }),
});
stripeConfig.connectorConfig = ConnectorSpecificConfig.create({
    stripe: { apiKey: { value: process.env.STRIPE_API_KEY } }
});
const stripeClient = new PaymentClient(stripeConfig);

// Configure Adyen client
const adyenConfig = ConnectorConfig.create({
    options: SdkOptions.create({ environment: Environment.SANDBOX }),
});
adyenConfig.connectorConfig = ConnectorSpecificConfig.create({
    adyen: {
        apiKey: { value: process.env.ADYEN_API_KEY },
        merchantAccount: process.env.ADYEN_MERCHANT_ACCOUNT
    }
});
const adyenClient = new PaymentClient(adyenConfig);

That would be all. The SDK handles native library loading automatically. Start building in the Quick Startarrow-up-right.

Minimum version supported

The prerequisites are:

  • Node.js: 16+ (FFI bindings require native compilation)

  • Python: 3.9+ (uses ctypes for FFI)

  • Java: 11+ (uses JNI bindings)

  • PHP: 8.0+ (uses FFI extension)

Last updated

Was this helpful?