npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

rapyd-ts-sdk

v1.8.0

Published

A modern, fully-typed TypeScript SDK for the Rapyd payment platform API (unofficial).

Downloads

62

Readme

Rapyd TypeScript SDK

A modern, fully-typed TypeScript SDK for the Rapyd payment platform API (unofficial).

TypeScript

Features

✨ What makes this SDK special:

🚀 Lightweight & Efficient – Optimized for performance with minimal dependencies.
📌 TypeScript-Powered – Enjoy strong typing, autocompletion, and better developer experience.
💳 Seamless Rapyd Integration – Easily interact with Rapyd’s fintech APIs for payments, wallets, and more.
🔒 Built-in Request Signing – Secure HMAC authentication is handled automatically.
💡 Developer-Friendly – Clean, well-structured code with intuitive service methods.
🛠️ Extensible – Designed for easy customization and future enhancements.
📄 Detailed request and response typing

Installation

npm install rapyd-ts-sdk

Quick Start

import { RapydClient } from 'rapyd-typescript-sdk';

const client = new RapydClient(
    'your_access_key',
    'your_secret_key'
);


// Get payment method field requirements
const fieldRequirements = await client.PaymentMethodsService.getFieldRequirements('us_debit_card'), //  bank_tranfer = us_ach_bank , etc ;
console.log(fieldRequirements);

// Get payment methods by country
const paymentMethods = await client.PaymentMethodsService.getPaymentMethodsByCountry('US');
console.log(`Found ${paymentMethods.payment_methods.length} payment methods for ${paymentMethods.country}`);

//you could pick this option or choose the snippet below on how to create payment

// Create a payment
const payment = await client.createPayment({
    amount: 100,
    currency: 'USD',
    payment_method: 'us_debit_card'
});

Core Features

Payments


// CREATE PAYMENT
// you could use the sdk custom types in your project 
import { RapydClient, PaymentService, CreatePaymentRequest } from 'rapyd-payments-sdk';

// Initialize the client
const rapydClient = new RapydClient({
  accessKey: 'your-access-key',
  secretKey: 'your-secret-key',
  baseURL: 'https://sandboxapi.rapyd.net' // or production URL
});

const paymentService = new PaymentService(rapydClient); // just call the method based of the rapydClient class

// Create a payment
async function makePayment() {
  try {
    const paymentRequest: CreatePaymentRequest = {
      amount: 101,
      currency: 'USD',
      description: 'Payment method token',
      payment_method: 'other_7f991f72a4c14c5cd79627ebc21241de',
      ewallets: [{
        ewallet: 'ewallet_1290eef66d0b84ece177a3f5bd8fb0c8',
        percentage: 100
      }],
      metadata: {
        merchant_defined: true
      }
    };

    const paymentResponse = await paymentService.createPayment(paymentRequest);
    console.log('Payment created:', paymentResponse.data.id);
    return paymentResponse;
  } catch (error) {
    console.error('Payment failed:', error);
    throw error;
  }
}

// UPDATE PAYMENT 

// Update a payment using the client (which delegates to PaymentService)
const paymentId = 'payment_36724a4ea01b438fd24ac3ab00b29150';

// Method 1: Update general payment information
await rapydClient.updatePayment(paymentId, {
  receipt_email: '[email protected]',
  description: 'Updated payment description'
});

// Method 2: Update just the address
const address = {
  name: 'John Doe',
  line_1: '123 Main St',
  city: 'Anytown',
  country: 'US'
};
await rapydClient.updatePaymentAddress(paymentId, address);

// Method 3: Update just metadata
const metadata = {
  order_id: '12345',
  customer_type: 'premium'
};
await rapydClient.updatePaymentMetadata(paymentId, metadata);

// Method 4: Cancel escrow
await rapydClient.cancelEscrow(paymentId);

// CAPTURE PAYMENT IN FULL OR PARTIALY

// Capture full payment
rapydClient.captureFullPayment('payment_19e3edad1e9102cd24006a34c52c9a0b')
  .then(response => console.log(response))
  .catch(error => console.error(error));

// Capture partial payment
rapydClient.capturePayment('payment_19e3edad1e9102cd24006a34c52c9a0b', { 
  amount: 50.00,
  receipt_email: '[email protected]',
  statement_descriptor: 'Your Store Name'
})
  .then(response => console.log(response))
  .catch(error => console.error(error));

Wallets

// Create wallet
const wallet = await client.createWallet({
    first_name: 'John',
    last_name: 'Doe',
    email: '[email protected]',
    ewallet_reference_id: 'john-doe-001'
});

// Get balance
const balance = await client.getWalletBalance('wallet_id');

Payouts

const payout = await client.createPayout({
    beneficiary: 'beneficiary_id',
    payout_method_type: 'us_bank_transfer',
    amount: 100,
    currency: 'USD'
});

Virtual Accounts

const account = await client.createVirtualAccount({
    country: 'US',
    currency: 'USD',
    description: 'Business Account'
});

Error Handling

try {
    const payment = await client.createPayment({
        amount: 100,
        currency: 'USD',
        payment_method: 'us_debit_card'
    });
} catch (error) {
    console.error('Payment failed:', error.message);
}

Contributing

  1. Fork the repository
  2. Create your branch (git checkout -b feature/amazing)
  3. Commit changes (git commit -m 'Add feature')
  4. Push (git push origin feature/amazing)
  5. Open a Pull Request

Support

License

MIT © LICENSE


Built with ❤️ by Awuah, Hunt