Official SDK for Node.js, browsers, and edge runtimes.
JavaScript SDK
JavaScript / TypeScript SDK
Official package for Node.js, browsers, and edge runtimes
The flasho-merchant-sdk package wraps the Flasho Merchant API with a fully-typed TypeScript client. No manual fetch calls, no auth header management — just import and go.
Install
npm install flasho-merchant-sdkRequirements: Node.js 18+ (uses native fetch). Also works in browsers and edge runtimes.
Quick start
import { FlashoClient } from 'flasho-merchant-sdk';
const flasho = new FlashoClient({ apiKey: 'flsh_YOUR_KEY' });
// Load account, wallet, branches, and pricing in one call
const data = await flasho.account.bootstrap();
console.log(data.account.walletBalance); // "10.000"
// Get a price quote
const { quote } = await flasho.pricing.calculate({
fromLatitude: 29.3764,
fromLongitude: 47.9785,
toLatitude: 29.3117,
toLongitude: 48.0034,
});
console.log(`Fee: ${quote.price} KWD`);
// Book a delivery
const { delivery } = await flasho.deliveries.create({
customerName: 'Ahmed Ali',
customerNumber: '99887766',
pickupLatitude: 29.3764,
pickupLongitude: 47.9785,
deliveryLatitude: 29.3117,
deliveryLongitude: 48.0034,
});
console.log(delivery.orderNumber); // FLH4001Modules
flasho.account
Bootstrap, branches, wallet, and pricing.
flasho.deliveries
Create, list, track, and poll deliveries.
flasho.pricing
Get price quotes before booking.
flasho.auth
JWT login for mobile integrations.
npm
The package is published at npmjs.com/package/flasho-merchant-sdk.