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 🙏

© 2025 – Pkg Stats / Ryan Hefner

mileston-payments

v0.2.3

Published

Open source Mileston Payment SDK to seamlessly integrate and build crypto (USDC) payment links, invoices and recurring payments into your apps!

Readme

Mileston Payments SDK

The Mileston Payments SDK is a simple and powerful library for managing payments, invoices, and recurring subscriptions. It provides seamless integration with your application, enabling you to create, update, and manage payment workflows effortlessly. Contact [email protected] if you have any issues integrating this.

Want to integrate crypto payment gateway into your application? Head on to https://mileston.co

Features

  • Create and manage payment links.
  • Generate and update invoices.
  • Handle recurring payments with ease.
  • Secure and reliable integration.
  • Lightweight and developer-friendly.

Installation

Install the SDK using npm:

npm install mileston-payments

Initialization

To get started, import the SDK and initialize it with your API key, and business ID.

import { PaymentLink, Invoice, RecurringPayment } from 'mileston-payments';

const apiKey = 'your-api-key';             // Your API key
const businessId = 'your-business-id';     // Your business ID

// Initialize PaymentLink, Invoice, or RecurringPayment as needed
const paymentLink = new PaymentLink(apiKey, businessId);
const invoice = new Invoice(apiKey, businessId);
const recurringPayment = new RecurringPayment(apiKey, businessId);

Usage Examples

1. Creating a Payment Link

const createPaymentPayload = {
  amount: '100.00',
  description: 'Purchase of premium subscription',
  customerEmail: '[email protected]',
};

const paymentLinkResponse = await paymentLink.create(createPaymentPayload);
console.log('Payment Link:', paymentLinkResponse.paymentLink);

2. Generating an Invoice

const createInvoicePayload = {
  amount: '200.00',
  itemName: 'Service Fee',
  customerEmail: '[email protected]',
  dueDate: new Date(),
};

const businessName = 'Acme';

const invoiceResponse = await invoice.create(businessName, createInvoicePayload);
console.log('Invoice Link:', invoiceResponse.invoiceLink);

3. Handling Recurring Payments

const createRecurringPaymentPayload = {
  amount: '50.00',
  subscriberFullName: 'John Doe',
  subscriberEmail: '[email protected]',
  recurringDate: new Date('2025-01-01'),
  recurringInterval: 30, // Interval in days
};

const recurringPaymentResponse = await recurringPayment.create(businessName, createRecurringPaymentPayload);
console.log('Recurring Payment Created:', recurringPaymentResponse);

4. Updating a Payment Link

const updatePayload = {
  amount: '120.00',
  description: 'Updated subscription fee',
};

const updatedPaymentLink = await paymentLink.update('paymentLinkId', updatePayload);
console.log('Updated Payment Link:', updatedPaymentLink);

API Reference

Classes

  1. PaymentLink

    • create(payload: CreatePaymentLinkPayload): Promise<CreatePaymentLinkResponse>
    • update(id: string, payload: UpdatePaymentLinkPayload): Promise<UpdatePaymentLinkResponse>
    • get(id: string): Promise<UpdatePaymentLinkResponse>
    • delete(id: string): Promise<DeletePaymentLinkResponse>
  2. Invoice

    • create(payload: CreateInvoicePayload): Promise<CreateInvoiceResponse>
    • update(id: string, payload: UpdateInvoicePayload): Promise<UpdateInvoiceResponse>
    • get(id: string): Promise<UpdateInvoiceResponse>
    • delete(id: string): Promise<DeleteInvoiceResponse>
  3. RecurringPayment

    • create(payload: CreateRecurringPaymentPayload): Promise<CreateRecurringPaymentResponse>
    • update(id: string, payload: UpdateRecurringPaymentPayload): Promise<UpdateRecurringPaymentResponse>
    • getAll(): Promise<GetAllRecurringPaymentResponse>

Contributing

We welcome contributions! Feel free to fork this repository and submit pull requests for any improvements or features you'd like to add.

License

This project is licensed under the MIT License. See the LICENSE file for details.