Modern, type-safe TypeScript SDK for the AllDebrid API.
This monorepo contains:
- @adbjs/sdk - Core TypeScript SDK for AllDebrid API
- @adbjs/cli - Command-line interface (coming soon)
npm install @adbjs/sdkimport { AllDebridClient, AuthenticationError, LinkError } from '@adbjs/sdk'
const client = new AllDebridClient({
apiKey: 'your-api-key',
})
try {
// Get user information
const user = await client.user.getInfo()
console.log(user.username)
// Unlock a link
const unlocked = await client.link.unlock('https://example.com/file.zip')
console.log(unlocked.link)
} catch (error) {
if (error instanceof AuthenticationError) {
console.error('Invalid API key:', error.message)
} else if (error instanceof LinkError) {
console.error('Link error:', error.message, error.code)
} else {
console.error('Unexpected error:', error)
}
}See the @adbjs/sdk README for full documentation.
- 🎯 Type-safe - Full TypeScript support with types generated from OpenAPI spec
- 🚀 Modern - Built with latest tooling (wretch, vitest, pnpm)
- 📦 Tree-shakeable - ESM + CJS, import only what you need
- 🔄 Auto-retry - Built-in retry logic with configurable attempts
- 🎨 Developer-friendly - Intuitive API with JSDoc comments
- 🔥 Complete API coverage - All AllDebrid API endpoints implemented
- ⚡ Minimal footprint - Only one runtime dependency (wretch)
- 🛡️ Typed error handling - Specific error classes for better error management
This project uses:
- pnpm - Fast, efficient package manager
- TypeScript - Strict mode with exactOptionalPropertyTypes
- tsup - Fast, zero-config bundler
- Vitest - Fast, modern test runner
- hey-api/openapi-ts - OpenAPI type generation
# Install dependencies
pnpm install
# Generate types from AllDebrid OpenAPI spec
pnpm --filter @adbjs/sdk generate
# Build all packages
pnpm build
# Run tests
pnpm testalldebrid-ts/
├── packages/
│ ├── sdk/ # Core TypeScript SDK
│ │ ├── src/
│ │ │ ├── client.ts # Main client class
│ │ │ ├── resources/ # API resources (user, link, magnet, host)
│ │ │ ├── types.ts # Core types
│ │ │ ├── errors.ts # Error classes
│ │ │ └── generated/ # Auto-generated types from OpenAPI
│ │ └── tests/ # Test files
│ └── cli/ # CLI (coming soon)
└── pnpm-workspace.yaml
MIT