Does FileSlim provide a hosted PDF compression REST API?
No. FileSlim ships @fileslim/compress, a client-side JavaScript SDK that runs in the user's browser using WebAssembly. There is no REST endpoint to call and no per-request fee — you bundle the SDK into your app and compression happens on the user's device.
Why use a client-side SDK instead of a REST API?
Three reasons: (1) Privacy — PDFs never leave the user's device, which matters for legal, medical and financial documents. (2) Cost — there are no per-call fees, no bandwidth costs and no rate limits. (3) Latency — no round-trip to a server, so compression starts immediately.
How do I install the SDK?
Run `npm install @fileslim/compress` (or the yarn/pnpm/bun equivalent). The package is MIT-licensed and works in any modern browser-based JavaScript runtime — React, Vue, Svelte, vanilla JS or Electron.
What PDF compression options does the SDK expose?
Built-in presets: 'quick-share' (aggressive), 'balanced' (recommended), 'high-quality' (print-friendly). You can also pass a target size in bytes and the SDK iteratively downsamples embedded images to hit it.
Can I integrate the SDK into a Node.js backend?
The SDK is browser-first because it relies on WebAssembly compiled for browser runtimes and Web Workers. For Node servers, run the SDK inside a headless Chrome instance (Puppeteer/Playwright) or use a serverless function with a Wasm-compatible runtime — but the canonical use case is in-browser compression.
How does the SDK compare to Adobe PDF Services API on pricing?
Adobe PDF Services charges per transaction (around $0.05 per compression call at standard rates). FileSlim's SDK is free and runs on the client, so cost scales with zero — useful for high-volume consumer products where API fees would be prohibitive.
What's the bundle size of @fileslim/compress?
Around 350 KB gzipped for the core PDF compression path. WebAssembly modules are lazy-loaded on first use, so the initial JS payload is smaller. We recommend dynamic import() to defer the SDK until the user actually compresses something.
Does the SDK support batch compression?
Yes. The SDK exposes a batch() helper that uses a Web Worker pool sized to hardwareConcurrency - 1, so multiple PDFs compress in parallel without blocking the UI.
What formats does the SDK support besides PDF?
JPEG, PNG, WebP, AVIF for images and PDF for documents. Office formats (DOCX, PPTX, XLSX) are supported in FileSlim's web app but not currently in the SDK — the SDK roadmap includes DOCX support.
Is the SDK production-ready?
Yes. It powers fileslim.com, which processes user files daily without server-side infrastructure. The library is MIT-licensed and published as @fileslim/compress on npm. Source on GitHub.