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

@sendmate/inline-js

v1.2.1

Published

SendMate Inline Checkout - Embed checkout as popup/iframe on external websites

Readme

SendMate Inline Checkout

SendMate Inline Checkout allows you to embed checkout as a popup or iframe on external websites.

Installation

Via npm

npm install @sendmate/inline-js

Via CDN (unpkg.com)

<!-- Simple URL (uses unpkg field from package.json) -->
<script src="https://unpkg.com/@sendmate/inline-js"></script>

<!-- Or with version -->
<script src="https://unpkg.com/@sendmate/inline-js@latest"></script>

<!-- Or direct path -->
<script src="https://unpkg.com/@sendmate/inline-js@latest/dist/sendmate-checkout.umd.js"></script>

Usage

Basic Setup

<script src="https://unpkg.com/@sendmate/inline-js"></script>
<script>
  // Create an instance
  const checkout = new SendMateCheckout();
  
  // Initialize (apiBaseUrl and frontendUrl are auto-detected based on public key)
  checkout.init({
    publicKey: 'your-public-key'
  });

  // Open checkout
  checkout.open({
    amount: '100',
    currency: 'KES',
    description: 'Payment for order'
  }, 
  (session) => {
    console.log('Payment successful!', session);
  },
  () => {
    console.log('Payment cancelled');
  },
  (error) => {
    console.error('Payment error:', error);
  });
</script>

ES Module

import SendMateCheckout from '@sendmate/inline-checkout';

const checkout = new SendMateCheckout();
checkout.init({
  publicKey: 'your-public-key',
  apiBaseUrl: 'https://api.your-domain.com',
  frontendUrl: 'https://your-domain.com'
});

checkout.open({
  amount: '100',
  currency: 'KES',
  description: 'Payment for order'
}, onSuccess, onCancel, onError);

Development

Run Demo

npm run dev

This starts the demo application at http://localhost:3000

Build Library

npm run build:lib

This builds the library for distribution in the dist folder.

Build Demo

npm run build:demo

This builds the demo application.

Publishing

The library is configured to be published to npm and can be accessed via unpkg.com:

https://unpkg.com/@sendmate/inline-checkout@latest/dist/sendmate-checkout.umd.js

API Reference

init(options)

Initialize the SendMate Checkout library.

Parameters:

  • publicKey (string, required): Your SendMate public key
  • apiBaseUrl (string, required): API base URL
  • frontendUrl (string, required): Frontend URL for checkout
  • popupWidth (number, optional): Popup width in pixels (default: 800)
  • popupHeight (number, optional): Popup height in pixels (default: 600)
  • iframeMode (boolean, optional): Use iframe instead of popup (default: false)

open(checkoutData, onSuccess, onCancel, onError)

Open checkout popup/iframe.

Parameters:

  • checkoutData (object, required):
    • amount (string, required): Payment amount
    • currency (string, required): Currency code (e.g., 'KES', 'USD')
    • description (string, optional): Payment description
    • returnUrl (string, optional): URL to redirect after successful payment
    • cancelUrl (string, optional): URL to redirect after cancellation
    • paymentMethods (array, optional): Payment methods (default: ['mpesa', 'card'])
    • metadata (object, optional): Additional metadata
  • onSuccess (function, optional): Callback when payment is successful
  • onCancel (function, optional): Callback when payment is cancelled
  • onError (function, optional): Callback when an error occurs

License

MIT