Official SDK for Node.js, browsers, and edge runtimes.

JavaScript SDK

npm

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-sdk

Requirements: 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); // FLH4001

Modules

npm

The package is published at npmjs.com/package/flasho-merchant-sdk.