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

@cofee/checkout-web-sdk

v0.2.0

Published

CoFee Standard Checkout — overlay SDK for merchant websites

Readme

@cofee/checkout-web-sdk

Browser SDK for CoFee Standard Checkout. It opens a checkout overlay on your site and returns success, failure, and dismiss events to your page.

Always verify the payment on your server. Browser callbacks are not a source of truth.

Requirements

  • A CoFee merchant publishable key
  • A payment order_id created on your server before opening checkout

Install

npm install @cofee/checkout-web-sdk

For prerelease builds:

npm install @cofee/checkout-web-sdk@beta

Quick start

import { CofeeCheckout } from '@cofee/checkout-web-sdk';

const cofee = new CofeeCheckout({
  key: 'YOUR_KEY_ID',
  order_id: 'ord_…',
  environment: 'production', // or 'sandbox'
  currency: 'INR',
  name: 'Acme Corp',
  description: 'Test Transaction',
  logo_url: 'https://example.com/logo.png',
  handler(response) {
    // Payment completed in the overlay — verify on your server
    console.log(response.order_id, response.intent_id, response.amount, response.status);
  },
  modal: {
    ondismiss() {
      console.log('Checkout closed');
    }
  }
});

cofee.on('payment.failed', (response) => {
  console.log(response.error.code, response.error.description);
});

document.getElementById('pay-btn')?.addEventListener('click', (e) => {
  e.preventDefault();
  cofee.open();
});

Sandbox

const cofee = new CofeeCheckout({
  key: 'YOUR_KEY_ID',
  order_id: 'ord_…',
  environment: 'sandbox',
  handler(response) { /* … */ }
});

| environment | Checkout host | |---------------|---------------| | 'production' (default) | https://www.cofee.life/pay | | 'sandbox' | https://www.dev.cofee.life/pay |

Payment UI v2

Pass ui_version: 'v2' to open the v2 checkout experience inside the overlay:

const cofee = new CofeeCheckout({
  key: 'YOUR_KEY_ID',
  order_id: 'ord_…',
  ui_version: 'v2',
  theme: {
    color: '#05954e',
    ctaVarient: 'default' // or 'dark'
  },
  handler(response) { /* … */ }
});

The SDK appends version=v2 to the iframe entry URL. Bank return and in-checkout redirects preserve the flag automatically.

API

new CofeeCheckout(options)

| Option | Required | Description | |--------|----------|-------------| | key | Yes | Merchant publishable key | | order_id | Yes | Payment order id | | environment | No | 'production' (default) or 'sandbox' — selects the checkout host | | currency | No | Defaults to INR | | name | No | Business / display name | | description | No | Short description | | logo_url | No | Merchant logo URL | | ui_version | No | Pass 'v2' for the v2 payment gateway UI (default is v1) | | handler | No | Success callback | | modal.ondismiss | No | Called when the user closes checkout without completing | | modal.escape | No | Allow Escape to close (default true) | | theme.color | No | Accent color for v2 UI (hex, e.g. #05954e) | | theme.ctaVarient | No | Solid CTA fill: 'default' (green) or 'dark' (#262626). Accents still follow theme.color. |

Amount is taken from the order on CoFee’s side — you do not pass it into the SDK.

Methods

| Method | Description | |--------|-------------| | open() | Open the checkout overlay | | close() | Close the overlay (fires modal.ondismiss if payment was not completed) | | on(event, handler) | Listen for payment.success or payment.failed | | off(event, handler?) | Remove listener(s) |

Success response (handler / payment.success)

{
  order_id: 'ord_…',
  intent_id: '…',
  amount: '118',
  status: 'success'
}

Failure response (payment.failed)

{
  error: {
    code: 'PAYMENT_FAILED',
    description: 'Payment failed'
  }
}

Recommended flow

  1. Create an order on your backend and receive an order_id.
  2. Pass key and order_id into CofeeCheckout (set environment for sandbox).
  3. Call open() when the customer chooses to pay.
  4. On success, confirm the payment with your server before fulfilling the order.

More detail

License

MIT