API & Integration
Official SDKs
Planned official SDKs for integrating Dits into your applications, intended for JavaScript/TypeScript, Python, Go, and Rust.
Important
Planned — not yet available. The SDKs on this page do not exist yet. None of the packages (
@dits/sdk,dits-sdk, the Go module, or the Rust crate) are published, and there is no hosted api.dits.io service for them to talk to. Dits today is a local-first Rust CLI. The install commands, code samples, and feature tables below describe the intended design and may change. Do not depend on them yet.JavaScript/TypeScript SDK
Installation
npm install @dits/sdk
# or
yarn add @dits/sdk
# or
pnpm add @dits/sdkBasic Usage
import { DitsClient } from '@dits/sdk';
const client = new DitsClient({
baseURL: 'https://api.dits.io/v1',
token: process.env.DITS_TOKEN
});
// List repositories
const repos = await client.repositories.list();
// Upload a file
await client.files.upload('path/to/video.mp4', {
repository: 'my-project',
commit: 'Add raw footage'
});
// Download a file
const buffer = await client.files.download('abc123...', {
repository: 'my-project'
});Advanced Features
- Streaming uploads: Handle large files without loading into memory
- Progress callbacks: Monitor upload/download progress
- Webhook handling: Built-in webhook signature verification
- TypeScript support: Full type definitions included
SDK Comparison
| Feature | JavaScript | Python | Go | Rust |
|---|---|---|---|---|
| REST API | ||||
| File Upload/Download | ||||
| Streaming Support | ||||
| Webhook Handling | ||||
| Async/Await | ||||
| Progress Callbacks | ||||
| Type Safety | ||||
| Zero-Copy Operations | — | — | — | |
| Concurrent Operations |
Contributing to SDKs
All SDKs are open source and welcome contributions. Each SDK follows consistent patterns and includes comprehensive test suites.