# Server-side owned Store read example

`owned-read.mjs` is a framework-independent **server-only helper**, not a deployable authentication server. It accepts only four explicit customer-owned reads and never forwards arbitrary paths, caller URLs, employee JWTs or merchant keys. Customer sessions are separate from CRM accounts.

Before using it, your framework must authenticate its browser session, map it to the correct saved Store/customer token in server storage, enforce CSRF on login/logout and every write, and set Secure/HttpOnly/SameSite cookies if it uses cookies. Do not pass a raw cookie value or caller-supplied customer ID into this helper. Never log request headers or JSON containing identity/receipt proofs. Return the provided private/no-store headers and apply equivalent headers to errors.

```js
import { ownedStoreRead } from './owned-read.mjs';
// Both values come from your authenticated server-side session store.
const { body, headers } = await ownedStoreRead({
  slug: savedSession.storeSlug,
  customerSession: savedSession.customerToken,
  resource: 'orders', page: 0
});
// Send body privately, with headers. This example does not implement res/send.
```

This helper never automatically refreshes/retries a session or a write, never creates payment/checkout requests, and rejects redirects. An expired/revoked customer session must be handled as a sign-in requirement. Normal native API role/package/Store/customer ownership checks remain authoritative. Return pagination beyond page0 requires the documented retained `as_of` snapshot and is deliberately excluded from this minimal helper.
