{"_id":"@convert-me-pls/sdk","name":"@convert-me-pls/sdk","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@convert-me-pls/sdk","version":"1.0.0","description":"Official JavaScript/TypeScript SDK for the ConvertMePls file conversion API.","type":"module","main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/Convert-Me-Pls/convertmepls-sdk.git"},"homepage":"https://convertmepls.com/en/docs/sdk","bugs":{"url":"https://github.com/Convert-Me-Pls/convertmepls-sdk/issues"},"scripts":{"build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit","test":"node --import tsx --test test/*.test.ts","prepublishOnly":"npm run build"},"keywords":["convertmepls","file-conversion","image","video","audio","ffmpeg"],"license":"MIT","devDependencies":{"@types/node":"^22.15.3","tsx":"^4.19.4","typescript":"^5.8.3"},"gitHead":"722129368bfadce2dd9f8f6ad80cbc5b125b7759","_id":"@convert-me-pls/sdk@1.0.0","_nodeVersion":"26.0.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-twDiToP6bkIQAPBKSXNzAfgnifX5JAEO+P5L6PBsvYZwaEUTb+65jbG4c2dvF8vvVQ1xJk7FDQMwwl8wPEClKg==","shasum":"ed9e30b3b3786fe8628689d355a556666e8f3247","tarball":"https://registry.npmjs.org/@convert-me-pls/sdk/-/sdk-1.0.0.tgz","fileCount":5,"unpackedSize":14954,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDUTJ0ucT4GE+yEQbJjxa8cV02iyYP0R9y9FpIwxOUvnwIgDCCc9YJlIuPsDo7+JWgFrVzuI90m1jmwflVHjdEGf/c="}]},"_npmUser":{"name":"thinklikeajew","email":"thedankiestmeme77@gmail.com"},"directories":{},"maintainers":[{"name":"thinklikeajew","email":"thedankiestmeme77@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_1.0.0_1781641179977_0.5629955211243058"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-16T20:19:39.798Z","1.0.0":"2026-06-16T20:19:40.111Z","modified":"2026-06-16T20:19:40.370Z"},"maintainers":[{"name":"thinklikeajew","email":"thedankiestmeme77@gmail.com"}],"description":"Official JavaScript/TypeScript SDK for the ConvertMePls file conversion API.","homepage":"https://convertmepls.com/en/docs/sdk","keywords":["convertmepls","file-conversion","image","video","audio","ffmpeg"],"repository":{"type":"git","url":"git+https://github.com/Convert-Me-Pls/convertmepls-sdk.git"},"bugs":{"url":"https://github.com/Convert-Me-Pls/convertmepls-sdk/issues"},"license":"MIT","readme":"# @convert-me-pls/sdk\n\nOfficial JavaScript / TypeScript SDK for the [Convert Me Pls](https://convertmepls.com) file-conversion API. Convert and compress images, video, and audio (68 formats, ~1,500 conversion pairs) with one call. Zero dependencies — works in Node 18+ and the browser (uses global `fetch`).\n\n## Install\n\n```bash\nnpm install @convert-me-pls/sdk\n```\n\n## Quick start\n\n```ts\nimport { ConvertMePls } from '@convert-me-pls/sdk';\n\nconst cmp = new ConvertMePls({ apiKey: 'gck_live_…' }); // create a key in your dashboard\n\n// Convert one file (uploads, runs, waits, returns the finished job)\nconst fileBytes = new Uint8Array(/* … */);\nconst job = await cmp.convert(fileBytes, { filename: 'cat.png', target: 'webp', options: { quality: 82 } });\nconsole.log(job.downloadUrl);\n\n// Download the result\nconst out = await cmp.download(job.downloadUrl!);\n```\n\nEach API conversion costs **1 credit**. The anonymous web converter at convertmepls.com is free; the API is metered.\n\n## Common operations\n\n```ts\n// Discover formats + valid targets\nconst { formats, pairs } = await cmp.formats();\nconst targets = await cmp.targetsFor('png'); // ['webp', 'avif', 'jpeg', …]\n\n// Batch — each file to its own target, uploaded and awaited together\nconst jobs = await cmp.convertBatch([\n  { data: pngBytes, filename: 'a.png', target: 'webp' },\n  { data: movBytes, filename: 'b.mov', target: 'mp3' }\n]);\n\n// Manual flow (your own polling)\nconst { inputKey, uploadUrl } = await cmp.createUpload('a.png', 'image/png', pngBytes.length);\n// PUT the bytes to uploadUrl with the same content-type…\nconst { jobId } = await cmp.createConversion(inputKey, 'png', 'webp', { quality: 80 });\nconst done = await cmp.waitForConversion(jobId);\n```\n\n## Configuration\n\n```ts\nnew ConvertMePls({\n  apiKey: 'gck_live_…',                 // optional for free/anonymous use; required for the metered API\n  baseUrl: 'https://api.convertmepls.com', // default\n  fetch: customFetch                     // optional: inject a fetch implementation\n});\n```\n\nConversion `options`: `quality`, `width`, `height`, `crf`, `bitrate` (passed through to the engine where applicable).\n\n## Errors\n\nFailed requests throw `ConvertMePlsError` with a `.status` (HTTP code). A `402` means you're out of credits.\n\n## Links\n\n- Docs: https://convertmepls.com/en/docs\n- API reference: https://convertmepls.com/en/docs/conversions\n\nMIT licensed.\n","readmeFilename":"README.md","_rev":"1-d4b05025a13c74a76f4cedf0ee45db3e"}