MCPcopy Index your code
hub / github.com/davidamunga/pesaqr

github.com/davidamunga/pesaqr @v1.0.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.0.3 ↗ · + Follow
9 symbols 24 edges 7 files 0 documented · 0% updated 6mo agowordpress@1.0.0 · 2026-01-09★ 38
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

PESAQR

A lightweight, framework-agnostic library for generating M-PESA Payment QR codes. Built using Web Components, PesaQR works seamlessly with any modern JavaScript framework or vanilla HTML.

Features

  • 🎯 Generate Payment QR codes for Till Numbers
  • 💳 Generate Payment QR codes for Paybill Numbers
  • 📱 Generate Payment QR codes for Phone Numbers (Send Money)
  • 🔌 Framework agnostic - works with React, Vue, Angular, or vanilla JavaScript
  • 📱 Mobile-responsive
  • 🔒 Offline support

Installation

npm install pesaqr

Usage

Basic HTML


<script
  type="module"
  src="https://github.com/davidamunga/pesaqr/raw/v1.0.3/node_modules/pesaqr/dist/pesaqr.mjs"
></script>


<pesa-qr type="till" tillNumber="123456" amount="100" width="300"></pesa-qr>


<pesa-qr
  type="paybill"
  paybillNumber="888880"
  accountNumber="ACC123"
  amount="100"
  width="300"
></pesa-qr>


<pesa-qr
  type="phone"
  phoneNumber="0712345678"
  amount="100"
  width="300"
></pesa-qr>

React

import "pesaqr";

function App() {
  return <pesa-qr type="till" tillNumber="123456" amount="100" width={300} />;
}

Vue

<template>
  <pesa-qr type="till" :tillNumber="'123456'" :amount="'100'" :width="300" />
</template>

<script>
import "pesaqr";

export default {
  name: "App",
};
</script>

Angular

// app.module.ts
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import 'pesaqr';

@NgModule({
  // ...
  schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class AppModule { }

// component template
<pesa-qr
  type="till"
  tillNumber="123456"
  amount="100"
  [width]="300"
></pesa-qr>

API Reference

Properties

Property Type Description Required
type string Payment type: "till", "paybill", or "phone" Yes
tillNumber string Till number for till payments Yes (for type="till")
paybillNumber string Paybill number for paybill payments Yes (for type="paybill")
accountNumber string Account number for paybill payments Yes (for type="paybill")
phoneNumber string Phone number for send money payments Yes (for type="phone")
amount string Payment amount Yes
width number QR code width in pixels No (default: 600)

Browser Support

  • Chrome/Edge (latest)
  • Firefox (latest)
  • Safari (latest)
  • Opera (latest)

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT

Author

David Amunga

portfolio linkedin twitter

Feedback

If you have any feedback or questions, please reach out to me on Twitter.

Extension points exported contracts — how you extend this code

PesaQRProps (Interface)
(no doc)
src/pesaqr.ts
HTMLElementTagNameMap (Interface)
(no doc)
src/pesaqr.ts

Core symbols most depended-on inside this repo

render
called by 1
src/pesaqr.ts
generateQRCode
called by 1
src/pesaqr.ts
constructor
called by 0
src/pesaqr.ts
updated
called by 0
src/pesaqr.ts
App
called by 0
examples/react/src/App.tsx

Shape

Method 4
Class 2
Interface 2
Function 1

Languages

TypeScript100%

Modules by API surface

src/pesaqr.ts8 symbols
examples/react/src/App.tsx1 symbols

For agents

$ claude mcp add pesaqr \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page