{"_id":"@adbjs/sdk","_rev":"7-7072e192f6b1fc477bea9e9aea7508c9","name":"@adbjs/sdk","dist-tags":{"latest":"2.1.1"},"versions":{"0.1.1":{"name":"@adbjs/sdk","version":"0.1.1","keywords":["alldebrid","debrid","api","sdk","typescript","download","premium","torrent","magnet"],"author":{"name":"Trisard"},"license":"MIT","_id":"@adbjs/sdk@0.1.1","maintainers":[{"name":"trisard","email":"trisardhack@gmail.com"}],"homepage":"https://github.com/Trisard/alldebrid-ts#readme","bugs":{"url":"https://github.com/Trisard/alldebrid-ts/issues"},"dist":{"shasum":"914f799e9a6ed444494a4d59bb35e66a6aadce92","tarball":"https://registry.npmjs.org/@adbjs/sdk/-/sdk-0.1.1.tgz","fileCount":8,"integrity":"sha512-VbF7+tOShcRC1Y+CgmpPtkAYaJ7xtuZ6a1Kz7xucBR0M1rfWSik4hBIR7IdYd0NOW/q1YFIvD85TN8dN7n+OzA==","signatures":[{"sig":"MEUCIBNlG67RW1UJC8nccRYJSVLWKA7JbTal+I4/RwdgErNwAiEAlylVf6kAfoC181V7TQgITRiUFRfxpn9qzCLrJ1+5MTs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":209803},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20.0.0"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"5f11cac4c207dfb12ad0e0f7e242739f8452a9ff","scripts":{"dev":"tsup --watch","test":"vitest","build":"tsup","generate":"node scripts/generate-types.js","typecheck":"tsc --noEmit"},"_npmUser":{"name":"trisard","email":"trisardhack@gmail.com"},"repository":{"url":"git+https://github.com/Trisard/alldebrid-ts.git","type":"git"},"_npmVersion":"10.9.3","description":"Modern TypeScript SDK for AllDebrid API","directories":{},"_nodeVersion":"22.19.0","dependencies":{"wretch":"^3.0.3"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.8","valibot":"^0.42.1","typescript":"^5.7.2","@types/node":"^24.10.1","@hey-api/openapi-ts":"^0.55.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.1.1_1764382992387_0.9506292849771627","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"@adbjs/sdk","version":"1.0.0","keywords":["alldebrid","debrid","api","sdk","typescript","download","premium","torrent","magnet"],"author":{"name":"Trisard"},"license":"MIT","_id":"@adbjs/sdk@1.0.0","maintainers":[{"name":"trisard","email":"trisardhack@gmail.com"}],"homepage":"https://github.com/Trisard/alldebrid-ts#readme","bugs":{"url":"https://github.com/Trisard/alldebrid-ts/issues"},"dist":{"shasum":"91e91f2e7cf198b73cd8c417b3d17ee944e42623","tarball":"https://registry.npmjs.org/@adbjs/sdk/-/sdk-1.0.0.tgz","fileCount":8,"integrity":"sha512-muivTOBF4SGW8a7ePgwAw3ruEhQnIZfiPQnLU8pcVxWpDg6F60SS93QVUINTYSb4I9kXeI8Jsatnzp2KVkTKJg==","signatures":[{"sig":"MEUCIGtNxfUBeIPU6Z+MB4gssCelYs4mZQNFbHDkj0NIE+SFAiEA3FLY7mCK/HestqlZhCxjbSkuF3thzkMSFloJoW2DXZQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":285834},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20.0.0"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"e5a597b931f15f298b06fdae954ce3a560554770","scripts":{"dev":"tsup --watch","test":"vitest","build":"tsup","generate":"node scripts/generate-types.js","typecheck":"tsc --noEmit"},"_npmUser":{"name":"trisard","email":"trisardhack@gmail.com"},"repository":{"url":"git+https://github.com/Trisard/alldebrid-ts.git","type":"git"},"_npmVersion":"11.6.2","description":"Modern TypeScript SDK for AllDebrid API","directories":{},"_nodeVersion":"24.12.0","dependencies":{"wretch":"^3.0.3"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.8","valibot":"^0.42.1","typescript":"^5.7.2","@types/node":"^24.10.1","@hey-api/openapi-ts":"^0.55.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.0.0_1767816853636_0.5303338601704672","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@adbjs/sdk","version":"2.0.0","keywords":["alldebrid","debrid","api","sdk","typescript","download","premium","torrent","magnet"],"author":{"name":"Trisard"},"license":"MIT","_id":"@adbjs/sdk@2.0.0","maintainers":[{"name":"trisard","email":"trisardhack@gmail.com"}],"homepage":"https://github.com/Trisard/alldebrid-ts#readme","bugs":{"url":"https://github.com/Trisard/alldebrid-ts/issues"},"dist":{"shasum":"ec0b9aa2febaee51dd04d381021f38a62e7f8112","tarball":"https://registry.npmjs.org/@adbjs/sdk/-/sdk-2.0.0.tgz","fileCount":8,"integrity":"sha512-1I1vGv8u7jpghzkBi0oqtAcM07lLw69fTZ7b1Uf/ilMxBb1ZbpNwaSwExpryqVV3L0n2lC44wjWnQr09maCxwQ==","signatures":[{"sig":"MEYCIQDrB+2QAVpaHyGpm1VkEXRk1SDV3rVq5bGvcMp2st+4qAIhAK02hmv1O31wgdzP/Wq8CFV+FKzJnoJu2rtws6gm8dfS","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":297312},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20.0.0"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"a2e8b1641def1c25dc281888480445d74e3feb50","scripts":{"dev":"tsup --watch","test":"vitest","build":"tsup","generate":"node scripts/generate-types.js","typecheck":"tsc --noEmit"},"_npmUser":{"name":"trisard","email":"trisardhack@gmail.com"},"repository":{"url":"git+https://github.com/Trisard/alldebrid-ts.git","type":"git"},"_npmVersion":"11.6.2","description":"Modern TypeScript SDK for AllDebrid API","directories":{},"_nodeVersion":"24.12.0","dependencies":{"wretch":"^3.0.3"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.8","valibot":"^0.42.1","typescript":"^5.7.2","@types/node":"^24.10.1","@hey-api/openapi-ts":"^0.55.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.0.0_1767902881270_0.40163376495559033","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"name":"@adbjs/sdk","version":"2.0.1","keywords":["alldebrid","debrid","api","sdk","typescript","download","premium","torrent","magnet"],"author":{"name":"Trisard"},"license":"MIT","_id":"@adbjs/sdk@2.0.1","maintainers":[{"name":"trisard","email":"trisardhack@gmail.com"}],"homepage":"https://github.com/Trisard/alldebrid-ts#readme","bugs":{"url":"https://github.com/Trisard/alldebrid-ts/issues"},"dist":{"shasum":"3f913c1be79f7537e76c9f55d22814955fa29d1d","tarball":"https://registry.npmjs.org/@adbjs/sdk/-/sdk-2.0.1.tgz","fileCount":8,"integrity":"sha512-q6A70aM3PJ+upChE0dPd0uUjKI0M3z7WMKib0VmIJdU8Vp+FTBQxyq++Y7YIEK1i4jjvr2zykhPIcR4UAKBpoQ==","signatures":[{"sig":"MEUCICoisq0UCb0hN4qoxNd8rM29J4H0mki2PPj6zbY6ShoRAiEAglcf/wzSlavn/LlCu6rhv48y1m4fukFwoHW8JArKcDA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":296877},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20.0.0"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"0ac412e3aee74a6219dfa694b4dd8307cf64e3fc","scripts":{"dev":"tsup --watch","test":"vitest","build":"tsup","generate":"node scripts/generate-types.js","typecheck":"tsc --noEmit"},"_npmUser":{"name":"trisard","email":"trisardhack@gmail.com"},"repository":{"url":"git+https://github.com/Trisard/alldebrid-ts.git","type":"git"},"_npmVersion":"11.6.2","description":"Modern TypeScript SDK for AllDebrid API","directories":{},"_nodeVersion":"24.12.0","dependencies":{"wretch":"^3.0.3"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.8","valibot":"^0.42.1","typescript":"^5.7.2","@types/node":"^24.10.1","@hey-api/openapi-ts":"^0.55.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.0.1_1768562574554_0.057216353796589514","host":"s3://npm-registry-packages-npm-production"}},"2.0.2":{"name":"@adbjs/sdk","version":"2.0.2","keywords":["alldebrid","debrid","api","sdk","typescript","download","premium","torrent","magnet"],"author":{"name":"Trisard"},"license":"MIT","_id":"@adbjs/sdk@2.0.2","maintainers":[{"name":"trisard","email":"trisardhack@gmail.com"}],"homepage":"https://github.com/Trisard/alldebrid-ts#readme","bugs":{"url":"https://github.com/Trisard/alldebrid-ts/issues"},"dist":{"shasum":"e609c25fac9e5859faeada56d214bc3aaf35a288","tarball":"https://registry.npmjs.org/@adbjs/sdk/-/sdk-2.0.2.tgz","fileCount":8,"integrity":"sha512-hsBIdR9ZLZ1k9KsyGJOhAjVD+/pj7Ym5TwS0dzN4RpqSmaAqQ1iz0rwwvbVeFwuWXK2Far3Co431rFJcN+cnbg==","signatures":[{"sig":"MEUCIQCcZOus8w9KnctDcpLbN78c7/1GlsCtTL+G5KQZBw3w2wIgFVgUnb24+qVPvuryjzv6n4E8kGbgR0BYV9fvuzwGsX4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":296917},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20.0.0"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"11da615381d17e24ef41b84887c078aa2ffc3532","scripts":{"dev":"tsup --watch","test":"vitest","build":"tsup","generate":"node scripts/generate-types.js","typecheck":"tsc --noEmit"},"_npmUser":{"name":"trisard","email":"trisardhack@gmail.com"},"repository":{"url":"git+https://github.com/Trisard/alldebrid-ts.git","type":"git"},"_npmVersion":"11.6.2","description":"Modern TypeScript SDK for AllDebrid API","directories":{},"_nodeVersion":"24.12.0","dependencies":{"wretch":"^3.0.3"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.8","valibot":"^0.42.1","typescript":"^5.7.2","@types/node":"^24.10.1","@hey-api/openapi-ts":"^0.55.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.0.2_1768565387228_0.25434861941541254","host":"s3://npm-registry-packages-npm-production"}},"2.1.0":{"name":"@adbjs/sdk","version":"2.1.0","keywords":["alldebrid","debrid","api","sdk","typescript","download","premium","torrent","magnet"],"author":{"name":"Trisard"},"license":"MIT","_id":"@adbjs/sdk@2.1.0","maintainers":[{"name":"trisard","email":"trisardhack@gmail.com"}],"homepage":"https://github.com/Trisard/alldebrid-ts#readme","bugs":{"url":"https://github.com/Trisard/alldebrid-ts/issues"},"dist":{"shasum":"b841bea03f832c6bf076df8fa1ab47ea0db6634a","tarball":"https://registry.npmjs.org/@adbjs/sdk/-/sdk-2.1.0.tgz","fileCount":6,"integrity":"sha512-4ZYwRA9TP+gOQ8ZlsyocsxJzaIW1xPBpxOutb32WaOW9ze5vF/xZAG6q6WmqHPgzKp2QzwwUE6VKGfSMDrCwJQ==","signatures":[{"sig":"MEYCIQC2iFjMlb0HxBHIPZyveAiON41kZJyF5LBQ2KCrrUQ5MAIhAOajLp/yVNwXv7al1kZFovg60MKY05OOBwemW9Q6qddb","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":137328},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20.0.0"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"8a51bee540963121a55241cdbabffb5ede99f7b5","scripts":{"dev":"bun run build --watch","test":"bun test","build":"bun run build:esm && bun run build:cjs && bun run build:types","generate":"bun run scripts/generate-types.js","build:cjs":"bun build ./src/index.ts --outfile ./dist/index.cjs --target node","build:esm":"bun build ./src/index.ts --outdir ./dist --target node","typecheck":"tsc --noEmit","build:types":"dts-bundle-generator -o dist/index.d.ts src/index.ts && cp dist/index.d.ts dist/index.d.cts"},"_npmUser":{"name":"trisard","email":"trisardhack@gmail.com"},"repository":{"url":"git+https://github.com/Trisard/alldebrid-ts.git","type":"git"},"_npmVersion":"11.6.2","description":"Modern TypeScript SDK for AllDebrid API","directories":{},"_nodeVersion":"24.12.0","dependencies":{"wretch":"^3.0.3"},"_hasShrinkwrap":false,"devDependencies":{"valibot":"^0.42.1","typescript":"^5.7.2","@types/node":"^24.10.1","@hey-api/openapi-ts":"^0.55.0","dts-bundle-generator":"^9.5.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.1.0_1769120153160_0.23608419807421233","host":"s3://npm-registry-packages-npm-production"}},"2.1.1":{"name":"@adbjs/sdk","type":"module","version":"2.1.1","description":"Modern TypeScript SDK for AllDebrid API","author":{"name":"Trisard"},"license":"MIT","keywords":["alldebrid","debrid","api","sdk","typescript","download","premium","torrent","magnet"],"repository":{"type":"git","url":"git+https://github.com/Trisard/alldebrid-ts.git"},"homepage":"https://github.com/Trisard/alldebrid-ts#readme","bugs":{"url":"https://github.com/Trisard/alldebrid-ts/issues"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","engines":{"node":">=20.0.0"},"scripts":{"build":"bun run build:esm && bun run build:cjs && bun run build:types","build:esm":"bun build ./src/index.ts --outdir ./dist --target node","build:cjs":"bun build ./src/index.ts --outfile ./dist/index.cjs --target node","build:types":"dts-bundle-generator -o dist/index.d.ts src/index.ts && cp dist/index.d.ts dist/index.d.cts","dev":"bun run build --watch","test":"bun test","typecheck":"tsc --noEmit","generate":"bun run scripts/generate-types.js"},"dependencies":{"wretch":"^3.0.3"},"devDependencies":{"@hey-api/openapi-ts":"^0.55.0","@types/node":"^24.10.1","dts-bundle-generator":"^9.5.1","typescript":"^5.7.2","valibot":"^0.42.1"},"gitHead":"248a648fa48481dc24931beed360662912977bc2","_id":"@adbjs/sdk@2.1.1","_nodeVersion":"24.12.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-vdTgJ61fd8WbgXIMKp4oA2qfjP/cI/yrF/JxTLzh0EffMwd9Ep5pRRF+XJoftRFxXq8rlRUskXfgh05cCUWxhQ==","shasum":"c899a5051d3b143e1f2de9be234c32dc9283f8a4","tarball":"https://registry.npmjs.org/@adbjs/sdk/-/sdk-2.1.1.tgz","fileCount":6,"unpackedSize":137754,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICEzJfDhhkBMnzsIUBDDiB/ZE1yHCOhJ0u4J5+IKR1XKAiAZAanwgRUoGUuJTocoPsWWdBbR3F0srd6UFVPKY0b7YA=="}]},"_npmUser":{"name":"trisard","email":"trisardhack@gmail.com"},"directories":{},"maintainers":[{"name":"trisard","email":"trisardhack@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_2.1.1_1769216241359_0.8818734217911883"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-29T02:23:12.318Z","modified":"2026-01-24T00:57:21.605Z","0.1.1":"2025-11-29T02:23:12.583Z","1.0.0":"2026-01-07T20:14:13.785Z","2.0.0":"2026-01-08T20:08:01.427Z","2.0.1":"2026-01-16T11:22:54.695Z","2.0.2":"2026-01-16T12:09:47.375Z","2.1.0":"2026-01-22T22:15:53.299Z","2.1.1":"2026-01-24T00:57:21.499Z"},"bugs":{"url":"https://github.com/Trisard/alldebrid-ts/issues"},"author":{"name":"Trisard"},"license":"MIT","homepage":"https://github.com/Trisard/alldebrid-ts#readme","keywords":["alldebrid","debrid","api","sdk","typescript","download","premium","torrent","magnet"],"repository":{"type":"git","url":"git+https://github.com/Trisard/alldebrid-ts.git"},"description":"Modern TypeScript SDK for AllDebrid API","maintainers":[{"name":"trisard","email":"trisardhack@gmail.com"}],"readme":"# @adbjs/sdk\n\nModern TypeScript SDK for the AllDebrid API v4.1.\n\n## ✨ Features\n\n- 🎯 **TypeScript-first** - Full type safety with auto-generated types from OpenAPI v4.1 spec\n- 🚀 **Modern** - Built with wretch, ESM + CJS support\n- 📦 **Tree-shakeable** - Import only what you need\n- 🔄 **Auto-retry** - Built-in retry logic with configurable options\n- 🛡️ **Type-safe errors** - Typed error classes for better error handling\n- 📝 **Fully documented** - JSDoc comments with examples\n- ⚡ **API v4.1 optimized** - Designed and optimized for AllDebrid API v4.1\n- 💡 **Minimal footprint** - Only one runtime dependency (wretch)\n\n## 📦 Installation\n\n```bash\nnpm install @adbjs/sdk\n# or\nbun add @adbjs/sdk\n# or\npnpm add @adbjs/sdk\n# or\nyarn add @adbjs/sdk\n```\n\n## 🚀 Quick Start\n\n```typescript\nimport { AllDebridClient } from '@adbjs/sdk'\n\n// Create a client\nconst client = new AllDebridClient({\n  apiKey: 'your-api-key-here',\n})\n\n// Get user info\nconst user = await client.user.getInfo()\nconsole.log(user.username, user.isPremium)\n\n// Unlock a link\nconst result = await client.link.unlock('https://example.com/file.zip')\nconsole.log('Direct link:', result.link)\n\n// Upload a magnet\nconst magnet = await client.magnet.upload('magnet:?xt=urn:btih:...')\nconsole.log('Magnet ID:', magnet.magnets[0].id)\n```\n\n## 📖 API Reference\n\n### Client Configuration\n\n```typescript\nconst client = new AllDebridClient({\n  apiKey: string          // Required: Your AllDebrid API key\n  agent?: string          // Optional: User agent (default: '@adbjs/sdk')\n  baseUrl?: string        // Optional: API base URL\n  timeout?: number        // Optional: Request timeout in ms (default: 30000)\n  retry?: boolean         // Optional: Enable auto-retry (default: true)\n  maxRetries?: number     // Optional: Max retry attempts (default: 3)\n})\n```\n\n### User Resource\n\n```typescript\n// Get user profile\nconst user = await client.user.getInfo()\n\n// Get available hosts for user\nconst hosts = await client.user.getHosts()\nconst hostsOnly = await client.user.getHosts(true) // Exclude streams/redirectors\n\n// Clear a notification\nawait client.user.clearNotification('NOTIF_CODE')\n\n// Saved Links Management\nconst savedLinks = await client.user.getLinks()\n\n// Save single link\nawait client.user.saveLink('https://example.com/file.zip')\n\n// Save multiple links at once (batch operation)\nawait client.user.saveLink(['https://example.com/file1.zip', 'https://example.com/file2.zip'])\n\n// Delete single link\nawait client.user.deleteLink('saved-link-id')\n\n// Delete multiple links at once (batch operation)\nawait client.user.deleteLink(['id1', 'id2', 'id3'])\n\n// History Management\nconst history = await client.user.getHistory()\nawait client.user.clearHistory()\n\n// Email Verification\nconst status = await client.user.getVerificationStatus('token')\nawait client.user.resendVerification('token')\n```\n\n### Link Resource\n\n```typescript\n// Get link information\nconst info = await client.link.infos('https://example.com/file.zip')\nconst multipleInfos = await client.link.infos([\n  'https://example.com/file1.zip',\n  'https://example.com/file2.zip',\n])\n\n// Get link information with password\nconst protectedInfo = await client.link.infos('https://example.com/file.zip', 'password123')\n\n// Extract from redirector\nconst links = await client.link.redirector('https://linkprotector.com/abc123')\n\n// Unlock a link\nconst result = await client.link.unlock('https://example.com/file.zip')\n\n// Unlock a password-protected link\nconst protectedResult = await client.link.unlock('https://example.com/file.zip', 'password123')\n\n// Get streaming options\nconst streams = await client.link.streaming('generated-id')\n\n// Check delayed link status\nconst delayed = await client.link.delayed('delayed-id')\n```\n\n### Magnet Resource\n\n```typescript\n// Upload magnets\nconst result = await client.magnet.upload('magnet:?xt=urn:btih:...')\nconst multiple = await client.magnet.upload(['magnet:?xt=urn:btih:...', 'magnet:?xt=urn:btih:...'])\n\n// Upload torrent file\nconst file = new File([buffer], 'torrent.torrent')\nconst uploaded = await client.magnet.uploadFile(file)\n\n// ===== Standard Mode: Get magnet status =====\n\n// Get status of a specific magnet by ID\nconst status = await client.magnet.status(123)\nconsole.log('Magnet status:', status.magnets[0]?.status)\n\n// Get list of all magnets\nconst allMagnets = await client.magnet.statusList()\n\n// Get list of magnets filtered by status\nconst activeMagnets = await client.magnet.statusList('active') // Downloading\nconst readyMagnets = await client.magnet.statusList('ready') // Completed\nconst expiredMagnets = await client.magnet.statusList('expired') // Expired\nconst errorMagnets = await client.magnet.statusList('error') // Failed\n\n// ===== Live Mode: Efficient polling with delta sync =====\n// Live mode only returns magnets that changed since the last request,\n// significantly reducing bandwidth usage. Perfect for real-time monitoring.\n\n// Initialize live mode with a random session ID\nconst session = Math.floor(Math.random() * 1000000)\nlet counter = 0\n\n// First call: Returns all magnets (full sync)\nconst firstCall = await client.magnet.statusLive({ session, counter })\nconsole.log('Full sync:', firstCall.magnets)\n\n// Update counter from response\ncounter = firstCall.counter // Important: Use the returned counter value\n\n// Subsequent calls: Only returns changed magnets (delta sync)\nconst secondCall = await client.magnet.statusLive({ session, counter })\nconsole.log('Delta sync (only changes):', secondCall.magnets)\n\n// Update counter for subsequent calls\ncounter = secondCall.counter\n\n// ===== Magnet management =====\n\n// Delete a magnet\nawait client.magnet.delete(123)\n\n// Restart a failed magnet\nawait client.magnet.restart(123)\n\n// Get download links for a completed magnet\nconst files = await client.magnet.files(123)\nfiles?.forEach((file) => {\n  console.log(file.filename, file.link)\n})\n\n// ===== Watch: Monitor magnet progress with automatic polling =====\n\n// Watch a magnet until it's ready\nawait client.magnet.watch(123, {\n  interval: 3000, // Check every 3 seconds\n  maxAttempts: 30, // Stop after 30 attempts (0 = infinite)\n  stopOnStatus: 'Ready', // Stop when magnet is ready\n  onUpdate: (status) => {\n    const magnet = status.magnets[0]\n    console.log(`Progress: ${magnet?.status} - ${magnet?.downloaded || 0}%`)\n  },\n})\n```\n\n### Host Resource\n\n```typescript\n// Get all supported hosts\nconst hosts = await client.host.list()\n\n// Get only file hosts (exclude streams/redirectors)\nconst hostsOnly = await client.host.list(true)\n\n// Get all supported domain names\nconst domains = await client.host.domains()\n\n// Get hosts by priority\nconst priority = await client.host.priority()\n```\n\n### Pin Resource\n\n```typescript\n// Generate a PIN for authentication\nconst pinData = await client.pin.generate()\nconsole.log('Visit:', pinData.user_url)\nconsole.log('PIN:', pinData.pin)\n\n// Check PIN status manually\nconst result = await client.pin.check(pinData.check, pinData.pin)\nif (result?.activated && result?.apikey) {\n  console.log('Authorized! API Key:', result.apikey)\n}\n\n// Wait for authorization with automatic polling\nconst apikey = await client.pin.waitForAuth(pinData.check, pinData.pin, {\n  timeout: 600000, // 10 minutes\n  interval: 3000, // Check every 3 seconds\n})\n```\n\n### Voucher Resource\n\n```typescript\n// Get reseller voucher balance\nconst balance = await client.voucher.getBalance()\nconsole.log('Remaining balance:', balance.balance, '€')\n\n// Retrieve existing vouchers from inventory\nconst allVouchers = await client.voucher.getVouchers()\nconsole.log('Vouchers:', allVouchers?.codes)\n\n// Retrieve specific quantity of vouchers\nconst fiveVouchers = await client.voucher.getVouchers(5)\n\n// Generate new vouchers (deducts from balance)\n// Generate 10 vouchers valid for 30 days\nconst newVouchers = await client.voucher.generateVouchers(10, 30)\nconsole.log('Generated vouchers:', newVouchers?.codes)\n```\n\n## 🛡️ Error Handling\n\nThe SDK provides typed error classes for better error handling:\n\n```typescript\nimport {\n  AllDebridError,\n  AuthenticationError,\n  LinkError,\n  MagnetError,\n  NetworkError,\n} from '@adbjs/sdk'\n\ntry {\n  await client.link.unlock(url)\n} catch (error) {\n  if (error instanceof AuthenticationError) {\n    console.error('Invalid API key')\n  } else if (error instanceof LinkError) {\n    console.error('Link error:', error.code, error.message)\n  } else if (error instanceof NetworkError) {\n    console.error('Network error:', error.statusCode)\n  }\n}\n```\n\n## 🎯 Type Safety\n\nAll responses are fully typed using types generated from the official AllDebrid API v4.1 OpenAPI specification:\n\n```typescript\nimport type { GetLinkUnlockResponse, GetMagnetStatusResponse, GetUserResponse } from '@adbjs/sdk'\n```\n\n## 🏗️ Development\n\n```bash\n# Install dependencies\nbun install\n\n# Generate types from OpenAPI spec\nbun run generate\n\n# Build\nbun run build\n\n# Run tests\nbun test\n\n# Type check\nbun run typecheck\n```\n\n## 📝 License\n\nMIT\n\n## 🔗 Related\n\n- [@adbjs/cli](https://www.npmjs.com/package/@adbjs/cli) - Command-line interface for AllDebrid\n- [AllDebrid API Documentation](https://docs.alldebrid.com/)\n- [GitHub Repository](https://github.com/Trisard/alldebrid-ts)\n","readmeFilename":"README.md"}