Skip to main content

Streaming and asynchronous jobs

As in the rest of the framework SDKs, there are two layers: upload progress (own from the store, via XMLHttpRequest) and streaming/jobs of the API (inherited from the base client MarkpdfClient).

Upload progress with the store

status goes through "idle" → "uploading" → "converting" → "success"|"error". progress only makes sense during "uploading".

Streaming Markdown with the base client

Streaming from a SvelteKit endpoint (+server.ts)

src/routes/api/convert/stream/+server.ts

Jobs due to saturation (202)

The store (createConvertStore) does not automatically poll jobs queued by /convert — if API responds 202, that case remains $convertStore.error. For explicit handling, use the base client directly:
See Jobs due to saturation of SDK base for manual poll with autoPoll: false.
Results for completed jobs expire in approximately 1 hour. If you save a jobId and receive 404 when querying it with getJob, resend the original conversion.