Build any front end,
run commerce on APIs
Build your storefront with React and TypeScript. Products, orders and payments call the Sayren API, and you deploy the site to Sayren or host it yourself.
$ npx sayren pull
Pulled → today-closet (42 files)
$ npx sayren deploy
Working tree uploaded — 3 files
Building version v12
✓ VERIFY 1.2s
✓ TYPECHECK 6.8s
✓ BUILD 14.5s
Build succeeded — v12
Published — v12 → https://today-closet.sayren.co
$ npx sayren status
Published v12 (CLI)
API · SDK
Two commerce APIs.
Storefront API
Call product, cart, checkout, payment and customer sign-in APIs from the browser.
@sayren/storefront-sdkAdmin API
Call product creation, order processing, refund and coupon APIs from your server.
@sayren/store-sdk
const sdk = createStorefrontClient({ baseUrl, storeCode });
const products = await sdk.catalog.searchProducts({
keyword: "knit",
});Webhooks
Send order events to external systems.
Order, payment, shipping, claim, inventory and inquiry events go to the URLs you register. Each resource carries a sequence number so you can keep events in order.
| Event | Sequence | Result |
|---|---|---|
ORDER.PAID | sequence 1 | 200 |
ORDER.DISPATCHED | sequence 2 | 200 |
ORDER.DELIVERED | sequence 3 | 200 |
CLAIM.RETURN_REQUESTED | sequence 1 | Retry |
Hosting
Choose how to deploy.
Sayren hosting
No servers to run. Publish and your HTTPS URL goes live right away.
- Preview URLs
- Custom domain
- Version history
- Roll back to a previous version
npx sayren pull npx sayren deploy npx sayren statusSelf-hosting
Download your storefront code and deploy it anywhere. The API calls stay the same.
- Download code
- Use npm packages
- Your own CI · CDN
You can restrict payment return URLs to your registered domains.