Skip to main content

DRP SDKs & Libraries

Official SDKs make it easy to integrate DRP into your application. All SDKs are open-source, actively maintained, and provide type-safe interfaces to the DRP API.

Available SDKs


SDK Features

All official DRPs SDKs provide:

Core Functionality

  • [Yes] Receipt encryption/decryption - RSA-2048-OAEP with proper padding
  • [Yes] Cryptographic signing - RSA-SHA256 signature generation and verification
  • [Yes] Key management - Secure key storage and rotation
  • [Yes] API client - Type-safe HTTP client for all DRP endpoints
  • [Yes] Error handling - Structured exceptions with retry logic
  • [Yes] Rate limiting - Built-in rate limit handling and backoff

Advanced Features

  • Hardware security - HSM integration (server SDKs), Secure Enclave/KeyStore (mobile SDKs)
  • JSON-LD support - Schema.org receipt format validation
  • Automatic retries - Configurable exponential backoff
  • Logging & metrics - Structured logging and telemetry
  • Testing utilities - Mock clients and test helpers
  • TypeScript/Type hints - Full type safety where applicable

Quick Start

Server-Side (Merchant Integration)

const DRP = require('@drp/sdk');

const client = new DRP.Client({
  apiKey: process.env.DRP_API_KEY,
  issuerDomain: 'issuer-bank.com',
  environment: 'production'
});

// Get customer's public key
const keyData = await client.publicKeys.get(cardToken);

// Encrypt and send receipt
const receipt = await client.receipts.send({
  receipt: receiptData,
  customerPublicKey: keyData.public_key,
  transactionId: txnId
});

Client-Side (Banking App)

import DRPKit

let client = DRPClient(
    oauthToken: userSession.accessToken,
    issuerDomain: "issuer-bank.com"
)

// Fetch encrypted receipts
let receipts = try await client.receipts.list(
    startDate: startDate,
    endDate: endDate
)

// Decrypt with Secure Enclave
for receipt in receipts {
    let decrypted = try await SecureEnclaveManager.shared.decrypt(
        receipt.encryptedReceipt,
        keyID: receipt.encryptionKeyID
    )
    print("Receipt from: \(receipt.merchantName)")
}

Installation Guides

Select your platform for detailed installation and setup instructions:

SDK Comparison

FeatureJavaScriptPythonGoPHPiOSAndroid
Merchant API[Yes][Yes][Yes][Yes][No][No]
User API[Yes][Yes][Yes][Yes][Yes][Yes]
Receipt Encryption[Yes][Yes][Yes][Yes][Yes][Yes]
Receipt Decryption[Yes][Yes][Yes][Yes][Yes][Yes]
HSM Support[Yes][Yes][Yes][Partial]N/AN/A
Secure EnclaveN/AN/AN/AN/A[Yes]N/A
KeyStoreN/AN/AN/AN/AN/A[Yes]
Type Safety[Yes] (TS)[Yes][Yes][No][Yes][Yes]
Async/Await[Yes][Yes][Yes][Yes][Yes][Yes]
Webhook Helpers[Yes][Yes][Yes][Yes]N/AN/A
[Partial] = Partial support or requires additional setup

Community SDKs

Community-maintained SDKs for additional languages:
Community SDKs are maintained by third-party contributors. While we encourage their use, official support is limited. Consider contributing if you’d like to help maintain these SDKs!

SDK Support


Contributing

All official SDKs are open-source under the MIT license. We welcome contributions!

How to Contribute

  1. Fork the repository for your language
  2. Create a feature branch
  3. Add tests for new functionality
  4. Submit a pull request
See individual SDK repositories for contribution guidelines.

Version Compatibility

SDK VersionDRP API VersionMinimum Language Version
JavaScript 1.xv1Node.js 16+
Python 1.xv1Python 3.8+
Go 1.xv1Go 1.19+
PHP 1.xv1PHP 8.0+
iOS 1.xv1iOS 13+, Swift 5.5+
Android 1.xv1Android 8+ (API 26+), Kotlin 1.7+

Next Steps

1

Choose Your SDK

Select the SDK for your platform/language
2

Install & Configure

Follow the installation guide for your chosen SDK
3

Review Examples

Check code examples and sample applications
4

Test Integration

Use sandbox environment to test your implementation
5

Go Live

Deploy to production with confidence