bailee-sdk-suite
v0.2.1
Published
Bailee Web SDK + pay service + merchant demo (local end-to-end)
Readme
Bailee SDK Suite (local demo)
Merchant flow:
- Web SDK (
initBailee): merchant backend creates a session (sessionIdonly in the redirect). - Browser opens the pay service
/checkoutpage (orbaileeapp:///sdk-productdirectly ifpayBaseUrlis a custom scheme). - Mobile app loads product / line-item details for that
sessionId(no web payment UI in the SDK).
Packages
packages/web-sdk:initBailee— mount button,createSession, redirect / open apppackages/pay-service: Express — session store +/checkoutlanding (deep link into app)packages/merchant-demo: sample merchant site +/api/bailee/create-sessionproxy
Build
From this directory:
npm install
npm run buildThis compiles only @bailee/web-sdk (outputs packages/web-sdk/dist/). Other packages are no-op build scripts for workspaces.
npm run build:all— runsbuildin every workspace (web-sdk + no-ops).
Run locally
Terminal 1:
npm run dev:payTerminal 2:
npm run dev:merchant- Merchant demo:
http://localhost:4100 - Pay service:
http://localhost:4200
Required env (merchant → Bailee API)
For packages/merchant-demo to create sessions in the Bailee backend, configure its server (see packages/merchant-demo/src/server.mjs).
Notes
- Do not put sensitive cart data in the deep link — only
sessionId. - Default app deep link target is
baileeapp:///sdk-product?sessionId=...(see pay-serviceAPP_DEEP_LINKand mobileapp/sdk-product.tsx). sessionIdshould be short-lived and unguessable.
