Native Shell
Native Shell:AI 生成的 UI,在你的应用中原生呈现,覆盖每个平台。iOS、Android、macOS、Windows 与 Linux 上的应用、GPUI 应用与网页在运行时加载已签名、沙箱隔离的 TSX 模块并绘制 th
AI 翻译
个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
在项目文件夹中运行 /nomorevibe verify,即可验证所有权并自行管理介绍。
一分钟完成验证制作者的介绍仅有上面的一句话。 更多详情请阅读仓库 README。 仓库 README ↗
正在加载完整 README。
查看完整 README ↗Type-safe open-source TypeScript monorepo for integrating bKash payments into web applications, mobile apps, and serverless environments.
Disclaimer: This is an unofficial community project and is NOT affiliated with, endorsed by, or sponsored by bKash Limited. "bKash" is a registered trademark of bKash Limited.
| Package | Version | Description | Readme |
|---|---|---|---|
bkash-server | 0.1.0 | Fetch-based backend SDK with token mutex, order resolution guard, and Web-standard HTTP handler. | Server Documentation |
bkash-client | 0.1.0 | Headless client SDK with bindings for React, React Native, Vue 3, Svelte, and Angular. | Client Documentation |
Headless-First (AUD-10):
In 0.1.x, bkash-client is strictly headless. We provide state machines, hooks, and lifecycle management without opinionated CSS stylesheets, pre-packaged themes, or modal dialogs. Developers retain 100% control over their checkout UI and brand styling. Styled components and theme presets are planned for future releases.
Server-Enforced Order Security:
Payment amount, currency, and invoice numbers must NEVER originate from untrusted client-side payloads. bkash-server mandates a server-side resolveOrder(req, body) callback that inspects session data or databases before initiating any transaction.
Lockout Prevention: bKash rate-limits token requests (reported as low as 2 grant-token calls per hour; confirm for your account). The server core implements proactive 50-minute rotation, single-flight in-memory deduplication, and atomic Redis locks to guarantee that multiple servers or worker processes never exhaust token quotas.
Multi-Runtime Compatibility:
The core server entry (bkash-server) has zero Node.js built-in dependencies (fs, crypto, http). It is intended to run on Node.js >=18 and other fetch-based runtimes; only Node.js is exercised in CI today (Workers, Edge, Deno and Bun are NOT TESTED). Specialized Node features (such as AWS SNS X.509 RSA signature verification) reside in subpath imports (bkash-server/webhook).
import express from "express";
import { BkashServer } from "bkash-server";
import { createExpressHandler } from "bkash-server/frameworks";
const app = express();
const bkash = new BkashServer({
apiVersion: "v1.2.0-beta", // Required: 'v1.2.0-beta' (stable) or 'v2' (experimental)
appKey: process.env.BKASH_APP_KEY!,
appSecret: process.env.BKASH_APP_SECRET!,
username: process.env.BKASH_USERNAME!,
password: process.env.BKASH_PASSWORD!,
baseUrl: process.env.BKASH_BASE_URL!, // e.g. https://tokenized.sandbox.bka.sh
});
// Mount /create, /callback, and /status endpoints
app.use(
"/api/bkash",
createExpressHandler(bkash, {
resolveOrder: async (req, body) => ({
amount: 1550,
currency: "BDT",
invoiceNumber: "INV_1001",
}),
}),
);
app.listen(3000, () => console.log("Listening on port 3000"));
| Feature | Status | Evidence |
|---|---|---|
| Tokenized Checkout v1.2.0-beta | Beta | automated tests against a local mock; live sandbox create+query run on 2026-10-27 (execute needs a customer PIN and is NOT TESTED live) |
| Tokenized Checkout v2 | Experimental | automated tests against a strict mock of the documented paths and fields; NOT TESTED against the live v2 sandbox |
| Token cache, refresh and lock | Beta | automated tests (concurrency, lease expiry); real Redis tests run in CI |
| Amount and invoice verification | Beta | automated tests |
| Timeout and 2062 reconciliation | Beta | automated tests against a mock |
| Web-standard HTTP handler | Beta | automated tests: tampering, allowlist, error mapping |
| Documented error-code table | Stable | automated tests compare the table with the published codes |
| Agreements (tokenized, v2) | Experimental | automated tests against a strict mock; NOT TESTED live. Not available with apiVersion v1.2.0-beta. |
| Refund and refund status | Experimental | automated tests; NOT TESTED live |
| Search transaction | Beta | automated tests |
| IPN / webhook (AWS SNS) verification | Experimental | automated tests with generated keys; NOT TESTED with a real bKash notification |
| Auth & Capture | Planned | Specification not public |
| Direct Charge / Linked Apps | Planned | Specification not public |
| Dynamic Charging | Planned | Specification not public |
| Disbursement, B2B and M2M payouts | Planned | Specification not public |
| React hook and button | Beta | automated tests (React Testing Library) |
| Vue 3 composable | Beta | automated tests (Vue Test Utils) |
| Svelte store | Beta | automated tests |
| Angular service | Beta | automated tests |
| React Native WebView checkout | Experimental | automated tests (React Native Testing Library); NOT TESTED on a device |
0.1.x, <BkashCheckout /> for React Native does not automatically hook into Android's native hardware BackHandler. If the user presses the device back button during a payment, applications must intercept the back action via React Navigation or custom back listeners to prompt confirmation before dismissal. Built-in Android BackHandler integration is scheduled for the Beta release.bkash-server/webhook is marked EXPERIMENTAL pending live verification against production AWS SNS notification payloads delivered by bKash.BkashFeatureNotSupportedError if called in 0.1.x.# Install workspace dependencies
pnpm install
# Run entire test suite across monorepo
pnpm test
# Build all packages (ESM + CJS + DTS)
pnpm build
# Typecheck workspace
pnpm typecheck
MIT © Open Source & Contributors
| Express adapter | Beta | tests inside real Express (with and without a body parser): server price used, browser callbackUrl ignored, unknown routes 404 |
| Next.js route handler | Beta | tests: route handler answers /create with the web-standard Request and Response |
| Fastify, Hono and Koa adapters | Beta | tests inside real Fastify, Hono and Koa |
| Remix, SvelteKit and Astro adapters | Beta | tests with the web-standard Request and Response these frameworks pass |
| Local bKash simulator package | Planned | - |