The npm
kulmipay package is a browser checkout SDK. Do not use it as a secret-key backend SDK. For PHP backends, use the Composer package kulmipay/kulmipay-php.Browser checkout SDK
The browser package is published on npm askulmipay.
Install
Browser checkout button
Add a button with thekulmiPayButton class. The SDK reads the button’s data-* attributes and creates a checkout session when the customer clicks it.
React or bundled JavaScript
When installing from npm, import or require the package from your browser bundle.Inline checkout
Usemode: "inline" when you want the checkout frame rendered inside a page element.
Environments
Self-hosted and local testing
Pass explicit base URLs when testing a local or self-hosted backend.apiBaseURL resolves to /api/v1/checkout/. If you need full control, pass checkoutAPIURL with the complete endpoint URL.
Browser SDK options
PHP SDK
Use the PHP SDK in backend applications that need to create checkout sessions, start M-Pesa STK pushes, collect PesaLink payments, send money, manage wallets, or create and retrieve refunds.Install
Configure
sandbox to true:
Checkout
M-Pesa STK Push
Send Money
Wallets
Refunds
Next steps
Checkout
Create a checkout session and render hosted payment UI.
Send Money
Send funds to M-Pesa, PesaLink bank accounts, and KulmiPay wallets.
