@mutwave/js
v1.0.0
Published
DEPRECATED — Mutwave is now a headless server-to-server payment-provider API with no customer login/session. This package is a stub that only fetches GET /app/public-config (app branding, feature flags, push web config); call the REST API directly with yo
Readme
@mutwave/js
Deprecated as of v1.0.0. Mutwave is no longer a customer-facing banking platform with its own login/session — the backend has been rewritten around a headless, server-to-server payment-provider API. Your own backend now charges customers, creates accounts, and moves money for your end users directly via plain REST calls authenticated with your app's secret key, never a customer session. Almost everything this package used to do (login, signup, chat, cards, loans, VTU, transfers, QR payments, realtime balance updates, push) depended on that customer session and no longer works — the routes it called are gone from the backend entirely.
This package is kept installable, as a stub, only so an existing install doesn't hard-break mid-deploy. The only thing it still does is fetch
GET /app/public-config(see below). For everything else — including charging a customer through any payment provider — call the new REST API directly from your own backend, or use@mutwave/express/mutwave/phpif you're on Node or PHP.
Install
npm install @mutwave/jsNo other packages are installed alongside it any more — this is now a plain, dependency-free fetch wrapper.
What's left: getPublicConfig()
This is the one Mutwave endpoint that's still safe to call with your app's
publishable key, straight from the browser, with no session of any
kind — GET /app/public-config. It returns your app's branding (name,
image, color theme), feature flags, and the Firebase web config for push
(safe to expose client-side).
import { mutwave } from "@mutwave/js";
const client = mutwave.client({
apiKey: "pk_live_...", // your app's publishable key — Settings → API Keys
});
const config = await client.getPublicConfig();
// { app: { name, image, colorTheme }, features, push: { enabled, apiKey, projectId, appId, senderId, vapidKey, sounds } }mutwave.client({ apiKey, baseUrl? })—apiKeyis your app's publishable key (Settings → API Keys).baseUrlonly needs overriding for a self-hosted/local backend.client.getPublicConfig()— fetched once and cached for the lifetime of the client instance.- Errors are thrown as
MutwaveApiError(message,status, and sometimescode).
Charging a customer, and everything else: call the REST API from your own backend
There is no more customer login, no session cookie, and no browser-safe way
to charge a customer, create accounts, move money, or read a specific
customer's data — all of that requires your app's secret key, which
must never reach a browser bundle. Your own backend calls these directly
(plain fetch/HTTP, or the @mutwave/express/mutwave/php SDKs — no
browser SDK needed):
POST /account/charge/{flutterwave,paystack,opay,monnify,bachs,squad}— charge a customer through any provider; returns acheckoutUrlyour backend hands back to this frontend to redirect the customer to.POST /account/create-account— create an end-user account server-side.POST /account/debit,/account/transfer,/account/transfer/external,/account/pay/wallet— move money.GET /account/profile,GET /account/transactions,GET /account/banks,GET /account/resolve-account— reads.PATCH /account/change-passcode,PATCH /account/profile,PATCH /account/notifications,PATCH /account/notifications/sound,PATCH /account/privacy,POST/DELETE /account/push-token,POST /account/profile-image— account management.
All of the above require Authorization: Bearer <secretKey>. See your
Mutwave dashboard's API reference for exact request/response shapes.
Notes
- Errors thrown from
client.getPublicConfig()areMutwaveApiError(message,status, and sometimescode). - If you were previously using this package's auth, account, transactions, transfer, initiateTransfer, vtu, chat, ticketChat, push, realtime, loan, card, or qrPayment modules — those modules have been removed from this package entirely; the backend routes they called no longer exist.
License
Private — Mutwave internal use.
