SDK ReferenceAuthentication

Authentication

SDK Authentication

All SDKs use HMAC-based authentication built in automatically — you only need to pass your keys when initializing the client.

Node.js

const { AparaPaymentAPI } = require("apara-checkout");

const client = new AparaPaymentAPI({
  publicKey: process.env.APARA_PUBLIC_KEY,
  secretKey: process.env.APARA_SECRET_KEY,
});

Python

from apara import AparaPaymentAPI

api = AparaPaymentAPI(
    public_key="YOUR_PUBLIC_KEY",
    secret_key="YOUR_SECRET_KEY",
)

Java

sdkConfig config = new sdkConfig("YOUR_PUBLIC_KEY", "YOUR_SECRET_KEY");
aparaPaymentApi api = new aparaPaymentApi(config);

PHP

use Apara\AparaPaymentAPI;
use Apara\AparaError;
use Apara\PaymentInvoiceRequest;
use Apara\Individual;
use Apara\ProductDetails;

$api = new AparaPaymentAPI([
    'publicKey' => 'YOUR_PUBLIC_KEY',
    'secretKey' => 'YOUR_SECRET_KEY',
]);

Parameters

ParameterTypeRequiredDescription
publicKey / public_keystringYour Apara API public key (pk_...)
secretKey / secret_keystringYour Apara API secret key

Get your keys from Dashboard → Settings. Sandbox and Production have separate key pairs.

Security notice: Never hardcode your Public Key or Secret Key in source code. Always store them in environment variables.