100kb-sdk
v1.1.5
Published
Official B2B WebAssembly Client-Side Image & PDF Optimization SDK. 100% Zero-Upload, Browser GPU/RAM Execution, 0ms Backend Latency.
Maintainers
Readme
100kb-sdk ⚡
Official B2B WebAssembly Client-Side Image, PDF & Biometric Media Optimization SDK
100kb-sdk is a zero-latency, client-side WebAssembly library for React, Next.js, Vue, Angular, Svelte, and TypeScript applications. It compresses user-uploaded images (JPEG, PNG, WebP, HEIC) and PDF documents to exact target file sizes (e.g. 50KB, 100KB, 200KB) 100% inside the user's browser GPU/RAM before uploading to AWS S3, Cloudflare R2, or Supabase Storage.
📦 Installation
npm install 100kb-sdk
# or
yarn add 100kb-sdk
# or
pnpm add 100kb-sdk🚀 Complete 18-Tool SDK Function Exports
Every tool on 100kb.in has a dedicated, tree-shakeable named export function:
import {
// Image Optimization
compressImage, // 1. Compress Image to Target KB (JPEG, PNG, WebP)
compressSignature, // 2. Signature & Thumb Impression Optimizer (<20KB Limit)
increaseImageSize, // 3. Inflate Image File Size in KB
convertPngToJpg, // 4. Convert PNG to JPG Format
convertJpgToPng, // 5. Convert JPG to PNG Format
resizeImage, // 6. Crop & Resize Dimensions (Circle, Square, Scale)
// PDF Document Engines
compressPDF, // 7. Vector Stream PDF Compression
mergePDFs, // 8. Combine Multiple PDFs
splitPDF, // 9. Extract & Split PDF Pages
jpgToPdf, // 10. Convert Image Scans to PDF Document
pdfToWord, // 11. Extract PDF Document to Word (.docx)
pdfToJpg, // 12. Export PDF Pages as JPEGs
unlockPDF, // 13. Remove PDF Password Restrictions
// AI & Biometrics
removeBackground, // 14. Studio Neural AI Background Removal
createPassportPhoto, // 15. Biometric Passport & Visa Photo (ICAO 70% Head Ratio)
removeWatermark, // 16. Digital Stamp & Date Artifact Cleaner
joinPhotoSignature, // 17. Passport Photo & Signature Joiner
convertHeicToJpg, // 18. Apple HEIC to Standard JPG Converter
// Multi-Worker Batching
compressBatch // 19. Multi-Worker Parallel Queue
} from '100kb-sdk';💡 Quick Start Example (React / Next.js)
import { compressImage, compressPDF, createPassportPhoto, removeBackground } from '100kb-sdk';
// 1. Compress Image to 100KB ceiling in <20ms
const { blob: imageBlob, sizeBytes } = await compressImage(file, {
targetKB: 100,
mimeType: 'image/jpeg'
});
// 2. Vector-Preserving PDF Compression
const { blob: pdfBlob } = await compressPDF(pdfFile, { targetKB: 200 });
// 3. ICAO Biometric Passport Photo Cropper (70% Head Ratio)
const { blob: passportBlob } = await createPassportPhoto(photoFile, {
country: 'us-visa',
targetKB: 50
});
// 4. Studio AI Background Removal
const { blob: transparentPng } = await removeBackground(photoFile);⚡ 1-Line AWS S3 / Cloudflare R2 Pre-Upload Hook
Save 85%+ on your cloud storage and bandwidth bills by compressing images on the user's device before upload:
import { createS3UploadHandler } from '100kb-sdk';
// Wrap your upload handler: Automatically compresses files to <100KB
const preCompress = createS3UploadHandler({ targetKB: 100 });
async function handleFileUpload(file: File) {
const optimizedBlob = await preCompress(file);
// Upload optimizedBlob to AWS S3 / Cloudflare R2 / Supabase
await uploadToS3(optimizedBlob);
}🌐 Direct HTML Script / Web Component (<100kb-uploader>)
For WordPress, Shopify, Webflow, or static HTML forms with zero npm setup:
<!-- 1-Line Script Insertion -->
<script src="https://www.100kb.in/widget.js" defer></script>
<!-- Drop-in Web Component Tag -->
<100kb-uploader
target-kb="100"
format="jpeg"
auto-compress="true"
label="Upload ID Document (Max 100KB)">
</100kb-uploader>🛡️ Key Enterprise Benefits
- 0ms Cloud Server Latency: Runs 100% in browser WebAssembly & HTML5 Canvas GPU.
- Saves 85% on AWS S3 & Cloudflare R2: Shrinks 15MB raw photos down to 100KB before hitting cloud storage.
- 100% GDPR & HIPAA Compliant: Confidential user documents and photos never touch third-party servers.
- Zero-Config Developer Free Tier: Unlimited local WASM operations free for open-source & community projects.
- Automated Commercial Licensing: Pass
apiKey: 'YOUR_KEY'to unlock 100% unbranded white-label mode.
📖 Documentation & Developer Portal
Visit the full interactive documentation, live WASM sandbox, and multi-framework guides at:
👉 https://www.100kb.in/en/developer
📄 License
MIT © 100KB Tools
