Open the book
aspect is width divided by height of the first page. sizes are the only image sizes you may ask for (the long edge, in pixels). readOnly is true for a 30-day pass or the all-access pass. kind is pass or lifetime, and accessUntil is when this reader’s access ends (null for a lifetime purchase). A copy kept on the device for offline reading must be deleted at accessUntil. The first call for a book can take a few seconds while the server fetches it.
Get one page
n counts from 1. w is one of sizes; any other value is refused, not rounded. The body is a JPEG (Content-Type: image/jpeg, Cache-Control: private, no-store). The page carries a footer with the reader’s email, the store and a short access id, and the email is repeated faintly across the page. This works for PDFs of any size. Fetch pages with the Authorization header (for example with fetch and an object URL), because an <img src> cannot send it, and do not offer a save button.
Offline reading and installing a book
The platform themes let a reader save a book on their device: every page picture at one size goes into IndexedDB, keyed to the book. To do the same in your own theme:- Save pages with the page endpoint above, once each. A full save uses one view per page of a renter’s daily budget.
- Store
kindandaccessUntilwith the copy. Delete the copy whenaccessUntilpasses, when the reader signs out, and when an online call answersno_access. - Re-check online at least every 3 days, and refuse to open the copy offline past that, or when the device clock is earlier than the latest time you have recorded.
- To let a book open offline, register the platform’s worker for the library:
navigator.serviceWorker.register("/book-sw.js", { scope: "/library" }). It keeps the page shell only (network first) and never caches API calls. - To make a book installable as its own app, point the page’s
<link rel="manifest">at/book-manifest.json?product={productId}while the book is open (andapple-touch-iconat/book-icon.png?product={productId}&size=180). The app opens at/library?read={productId}.
Errors
Errors are JSON. Reading a title never uses up the daily download allowance.
A picture someone can see can still be captured, for example with a screenshot. This removes the file, the link and the save button, and marks every page with who is reading.

