Skip to content

Quickstart

Create an API key from your dashboard or via the API. Keys are prefixed with tdp_ and shown once at creation.

Vaults are containers for your files. Every account starts with a default vault, but you can create more.

import { TuskyClient } from '@tuskydp/sdk';
const tusky = new TuskyClient({ apiKey: 'tdp_your_key' });
const vault = await tusky.vaults.create({
name: 'My Project',
visibility: 'public',
});

The SDK handles the 3-step upload (presign, PUT, confirm) in a single call.

import { readFile } from 'fs/promises';
const data = await readFile('./photo.jpg');
const file = await tusky.files.upload({
name: 'photo.jpg',
mimeType: 'image/jpeg',
vaultId: vault.id,
data,
});
console.log(file.id, file.status); // "hot"
const { downloadUrl } = await tusky.files.getDownloadUrl(file.id);
const response = await fetch(downloadUrl);
const bytes = await response.arrayBuffer();

Your file is now in the hot cache and immediately available. In the background, Tusky’s worker will sync it to the Walrus network. Once synced, the file status changes to synced. You can track this via webhooks or polling.