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

paymob-widget-alpha

v1.0.11

Published

Paymob Installments Widget that can be embedded in any web page to display **0% interest plans** and (optionally) let the user select a plan.

Readme

paymob-widget-alpha

Paymob Installments Widget that can be embedded in any web page to display 0% interest plans and (optionally) let the user select a plan.

Installing

CDN

Using jsDelivr:

<script src="https://cdn.jsdelivr.net/npm/paymob-widget-alpha@latest/main.js" type="module"></script>

Usage

Create a container element in your page:

<div id="paymob-widget"></div>

Then instantiate the widget:

new PaymobWidget({
  publicKey: 'egy_pk_live_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
  elementId: 'paymob-widget',
  amount: 1000, // amount in cents
  currency: 'EGP',
  integrationId: 123, // optional
});

Selectable mode example

To let the user select an installment plan and handle the selection in your app, enable customerCanSelect and pass an onSubmit callback.

new PaymobWidget({
  publicKey: 'egy_pk_live_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
  elementId: 'paymob-widget',
  amount: 1000, // amount in cents
  currency: 'EGP',
  integrationId: 123, // optional
  theme: 'primary',
  customerCanSelect: true, // Enable the customer to select a plan.
  onSubmit: (plan) => {
    // `onSubmit` is called when the user clicks **Buy now**.
    // In selectable mode (`customerCanSelect: true`), `plan` will be provided after the user selects a plan.
    // plan = { id: 123, tenure: 12, amount: 250 }
    // In non-selectable mode (`customerCanSelect: false`), `onSubmit` is called with no payload.
  },
});

Properties

The full list of properties is as follows:

| Property | Type | Required | Definition | | --- | --- | --- | --- | | publicKey | String | Yes | Your public key (used to resolve API base URL and authenticate requests). | | elementId | String | Yes | ID of the HTML element where the widget will be rendered. | | theme | "primary" \| "light" \| "dark" | No | Widget theme. Default: "primary". | | amount | Number | No | Amount in major units. Default: 300. | | currency | String | No | Currency code. Default: "EGP". | | integrationId | Number | No | Paymob integration ID. If provided, it will be sent when fetching installment plans. | | customerCanSelect | Boolean | No | If true, the widget allows selecting a plan and will show Buy now actions. Default: false. | | onSubmit | Function | No | Called when the user clicks Buy now. In selectable mode (customerCanSelect: true), it receives { id, tenure, amount }. In non-selectable mode (customerCanSelect: false), it is called with no payload. |

onSubmit payload

{
  id: string | number,   // installment plan id
  tenure: number,        // number of months
  amount: number         // monthly amount
}

Full HTML example

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>Paymob Widget Example</title>
    <base href="/" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <style>
      #paymob-widget {
      width: 100%;
      margin: 10% auto 0;
    }
      body {
      margin: 0;
    }
    </style>
  </head>

  <body>
    <div id="paymob-widget"></div>

    <script src="https://cdn.jsdelivr.net/npm/paymob-widget-alpha@latest/main.js" type="module"></script>

    <script>
      window.onload = () => {
        new PaymobWidget({
          publicKey: 'egy_pk_live_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
          elementId: 'paymob-widget',
          amount: 1000,
          currency: 'EGP',
          integrationId: 123, // optional
          theme: 'primary', // "primary" | "light" | "dark"
          customerCanSelect: true, // Enable the customer to select a plan.
          onSubmit: (plan) => {
    // `onSubmit` is called when the user clicks **Buy now**.
    // In selectable mode (`customerCanSelect: true`), `plan` will be provided after the user selects a plan.
    // plan = { id: 123, tenure: 12, amount: 250 }
    // In non-selectable mode (`customerCanSelect: false`), `onSubmit` is called with no payload.
          },
        });
      };
    </script>
  </body>
</html>

Notes

  • Rendering: The widget renders a Installment Widget into your elementId container.
  • Isolation: UI is rendered inside a Shadow DOM wrapper to reduce CSS conflicts with the host page.