app/account/orders/page.tsx
// Server component: list the signed-in customer's orders
import { sdk } from "@/lib/mercemur-sdk"
export default async function Orders() {
const { orders } = await sdk.store.order.list({
fields: "id,display_id,total,created_at,items.*",
limit: 10,
})
return orders.map((order) => <OrderRow key={order.id} order={order} />)
}
One SDK, end to end
A typed SDK for every surface, storefront, admin, and server-to-server.
@mercemur/js-sdk ships TypeScript types generated from the same OpenAPI specs the backend enforces, so request shapes, response fields, and error codes all match what the server actually does. Autocomplete everything, fail at compile time, not in prod.
- Works in Node, Edge runtimes, and the browser
- Per-tenant publishable keys for safe client-side use
- Built-in retry with exponential backoff
- Streams supported for bulk imports and long-running jobs