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

coffee-pay-sdk

v1.0.7

Published

Node.js SDK for Coffee-Pay payment gateway

Readme

COFFEE-PAY SDK for Node.js

Node.js SDK to integrate with the COFFEE-PAY payment gateway easily and securely using TypeScript/JavaScript.

npm version license


✨ Features

  • 🔐 Automatic JWT Authentication: Handles apiKey and apiSecret encryption automatically.
  • 🧾 Subscription Management: Full CRUD support for subscription plans.
  • 💳 Payment Methods: Consult available payment methods.
  • 🛡️ Web Signing Utilities: Easy signature generation for secure web payment buttons.
  • 🧠 Fully Typed: Built with TypeScript for excellent developer experience.
  • ⚙️ Modern: Compatible with Node.js v18+.

📦 Installation

npm install coffee-pay-sdk
# or
yarn add coffee-pay-sdk

🚀 Quick Start

1. Initialize the Client

The SDK automatically handles JWT token generation (valid for 30s) for every request.

import { CoffeeSDK } from 'coffee-pay-sdk';

const coffee = new CoffeeSDK({
  apiKey: 'YOUR_API_KEY',
  apiSecret: 'YOUR_API_SECRET',
  // baseUrl: 'https://staging.coffee-pay.co/api/v1' // Optional: default is production
});

2. Manage Subscription Plans (CRUD)

// List plans
const plans = await coffee.subscriptionsPlans.list(10, 1);

// Create a new plan
const newPlan = await coffee.subscriptionsPlans.create({
  name: 'Monthly Premium',
  description: 'Pro access',
  price: 25000,
  currencyId: '...', // Bogota UUID
  interval: 'monthly',
  billingDay: 1,
  freeDays: 0,
  status: true,
  source: 'API'
});

// Get by ID
const plan = await coffee.subscriptionsPlans.get('PLAN_ID');

// Update plan
await coffee.subscriptionsPlans.update('PLAN_ID', {
  description: 'Updated description'
});

// Delete plan
await coffee.subscriptionsPlans.delete('PLAN_ID');

3. Consult Currencies

// List currencies
const currencies = await coffee.currencies.list(10, 1);

// Get currency by ID
const currency = await coffee.currencies.get('CURRENCY_ID');

4. Consult Payment Methods

// List available payment methods
const methods = await coffee.paymentMethods.list(10, 1);

// Get payment method by ID
const method = await coffee.paymentMethods.get('METHOD_ID');

5. Signing for Web Payments

Use this utility to sign requests made from the browser (e.g., for payment buttons).

import { CryptoUtils } from 'coffee-pay-sdk';

const accountKey = "YOUR_ACCOUNT_KEY";
const integrityKey = "YOUR_INTEGRITY_KEY";
const timestamp = Math.floor(Date.now() / 1000);

const signature = CryptoUtils.generateWebSignature(accountKey, integrityKey, timestamp);

🛠️ API Reference

CoffeeSDK

| Option | Type | Description | | --- | --- | --- | | apiKey | string | Your Coffee-Pay API Key. | | apiSecret | string | Your Coffee-Pay API Secret. | | baseUrl | string | (Optional) API endpoint URL. | | timeout | number | (Optional) Request timeout in ms (default: 30000). |

subscriptionsPlans

| Method | Description | | --- | --- | | list(limit, page) | Returns a paginated list of plans. | | create(data) | Creates a new plan. | | get(id) | Retrieves a plan by ID. | | update(id, data) | Partially updates a plan. | | delete(id) | Deletes a plan. |

currencies

| Method | Description | | --- | --- | | list(limit, page) | Returns a list of supported currencies. | | get(id) | Retrieves detailed information for a specific currency. |

paymentMethods

| Method | Description | | --- | --- | | list(limit, page) | Returns a list of available payment methods. | | get(id) | Retrieves detailed information for a specific payment method. |


🤝 Contributing

Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.


📝 License

MIT © Coffee-Pay