Storage ClientAPI Reference

API Reference

Complete API reference for @visulima/storage-client

API Reference

Complete API reference for the @visulima/storage-client package. This page documents every exported hook, primitive, type, and utility across all framework integrations.

Core Exports

The core module is available via the root import path @visulima/storage-client and provides framework-agnostic utilities, adapters, and types.

createUploader

Creates a low-level event-driven file uploader instance using XMLHttpRequest with multipart/form-data.

import { createUploader } from "@visulima/storage-client";

const uploader = createUploader({
    endpoint: "/api/upload/multipart",
    metadata: { category: "photos" },
});

Options: UploaderOptions

PropertyTypeRequiredDescription
endpointstringYesUpload endpoint URL
metadataRecord<string, string>NoAdditional metadata to include with the upload
retrybooleanNoEnable automatic retry on failure
maxRetriesnumberNoMaximum number of retry attempts

Returns: Uploader

MethodSignatureDescription
add(file: File, batchId?: string) => stringAdds a file to the upload queue. Returns item ID.
addBatch(files: File[]) => string[]Adds multiple files as a batch. Returns item IDs.
getItem(id: string) => UploadItem | undefinedGets an item by ID
getItems() => UploadItem[]Gets all items
getBatch(batchId: string) => BatchState | undefinedGets batch state by batch ID
getBatches() => BatchState[]Gets all batches
getBatchItems(batchId: string) => UploadItem[]Gets all items in a batch
abortItem(id: string) => voidAborts a specific upload
abortBatch(batchId: string) => voidAborts all uploads in a batch
abort() => voidAborts all uploads
clear() => voidClears all items and aborts active uploads
retryItem(id: string) => voidRetries a failed upload item
retryBatch(batchId: string) => voidRetries all failed items in a batch
on(event: UploaderEventType, handler: UploaderEventHandler) => voidSubscribes to uploader events
off(event: UploaderEventType, handler: UploaderEventHandler) => voidUnsubscribes from uploader events

createMultipartAdapter

Creates a multipart upload adapter wrapping the Uploader with a Promise-based API.

import { createMultipartAdapter } from "@visulima/storage-client";

const adapter = createMultipartAdapter({
    endpoint: "/api/upload/multipart",
});

const result = await adapter.upload(file);

Options: MultipartAdapterOptions

PropertyTypeRequiredDescription
endpointstringYesUpload endpoint URL
metadataRecord<string, string>NoAdditional metadata
retrybooleanNoEnable automatic retry
maxRetriesnumberNoMaximum retry attempts

Returns: MultipartAdapter

MethodSignatureDescription
upload(file: File) => Promise<UploadResult>Uploads a file and returns the result
uploadBatch(files: File[]) => string[]Uploads multiple files as a batch, returns item IDs
abort() => voidAborts all uploads
abortBatch(batchId: string) => voidAborts a batch of uploads
abortItem(id: string) => voidAborts a specific upload item
clear() => voidClears all uploads
uploaderUploaderThe underlying uploader instance

createTusAdapter

Creates a TUS (resumable upload) adapter with pause/resume and chunked upload support.

import { createTusAdapter } from "@visulima/storage-client";

const adapter = createTusAdapter({
    endpoint: "/api/upload/tus",
    chunkSize: 1024 * 1024, // 1MB
});

const result = await adapter.upload(file);

Options: TusAdapterOptions

PropertyTypeRequiredDefaultDescription
endpointstringYes-TUS upload endpoint URL
chunkSizenumberNo1048576 (1MB)Chunk size for TUS uploads
metadataRecord<string, string>No{}Additional metadata
retrybooleanNotrueEnable automatic retry
maxRetriesnumberNo3Maximum retry attempts

Returns: TusAdapter

MethodSignatureDescription
upload(file: File) => Promise<UploadResult>Uploads a file using TUS protocol
pause() => voidPauses the current upload
resume() => Promise<void>Resumes a paused upload
abort() => voidAborts the current upload
clear() => voidClears all uploads
getOffset() => numberGets current upload offset
isPaused() => booleanWhether upload is paused
setOnStart(callback?) => voidSets start callback
setOnProgress(callback?) => voidSets progress callback (progress, offset)
setOnFinish(callback?) => voidSets finish callback
setOnError(callback?) => voidSets error callback

createChunkedRestAdapter

Creates a chunked REST upload adapter that uploads files in chunks using PATCH requests with pause/resume support.

import { createChunkedRestAdapter } from "@visulima/storage-client";

const adapter = createChunkedRestAdapter({
    endpoint: "/api/upload/chunked-rest",
    chunkSize: 5 * 1024 * 1024, // 5MB
});

const result = await adapter.upload(file);

Options: ChunkedRestAdapterOptions

PropertyTypeRequiredDefaultDescription
endpointstringYes-Chunked REST upload endpoint URL
chunkSizenumberNo5242880 (5MB)Chunk size in bytes
metadataRecord<string, string>No{}Additional metadata
retrybooleanNotrueEnable automatic retry
maxRetriesnumberNo3Maximum retry attempts

Returns: ChunkedRestAdapter

MethodSignatureDescription
upload(file: File) => Promise<UploadResult>Uploads a file in chunks
pause() => voidPauses the upload
resume() => Promise<void>Resumes a paused upload
abort() => voidAborts current upload
clear() => voidClears upload state
getOffset() => Promise<number>Gets current upload offset
isPaused() => booleanWhether upload is paused
setOnStart(callback?) => voidSets start callback
setOnProgress(callback?) => voidSets progress callback (progress, offset)
setOnFinish(callback?) => voidSets finish callback
setOnError(callback?) => voidSets error callback

Utility Functions

import { buildUrl, fetchFile, fetchJson, fetchHead, deleteRequest, putFile, patchChunk, parseApiError, extractFileMetaFromHeaders } from "@visulima/storage-client";
FunctionSignatureDescription
buildUrl(baseUrl, path, params?) => stringBuilds URL with query parameters
fetchFile(url) => Promise<Blob>Fetches a file as Blob with error handling
fetchJson<T>(url) => Promise<T>Fetches JSON with error handling
fetchHead(url) => Promise<Headers>Fetches metadata via HEAD request
deleteRequest(url) => Promise<void>Sends DELETE request with error handling
putFile(url, file, onProgress?) => Promise<{...}>PUT request with progress tracking
patchChunk(url, chunk, offset, checksum?) => Promise<{...}>PATCH request for chunk uploads
parseApiError(response) => Promise<Error>Parses error response from API
extractFileMetaFromHeaders(id, headers) => FileMetaExtracts file metadata from response headers

storageQueryKeys

Query key factory for TanStack Query integration. Provides consistent cache key generation across all hooks.

import { storageQueryKeys } from "@visulima/storage-client";

// Base key
storageQueryKeys.all; // ["storage"]

// File keys
storageQueryKeys.files.all(endpoint);
storageQueryKeys.files.detail(endpoint, id, transformParams?);
storageQueryKeys.files.list(endpoint, { limit?, page? });
storageQueryKeys.files.meta(endpoint, id);
storageQueryKeys.files.head(endpoint, id);

// Transform keys
storageQueryKeys.transform.all(endpoint);
storageQueryKeys.transform.file(endpoint, id, transformParams);
storageQueryKeys.transform.metadata(endpoint);

Types

FileMeta

File metadata returned from the server.

interface FileMeta {
    id: string;
    name?: string;
    originalName?: string;
    contentType?: string;
    size?: number;
    bytesWritten?: number;
    createdAt?: string;
    metadata?: Record<string, unknown>;
    status?: "completed" | "part" | "deleted" | "created";
}

UploadResult

Result returned after a successful file upload. Extends FileMeta.

interface UploadResult extends FileMeta {
    filename?: string;
    offset?: number;
    url?: string;
}

UploadMethod

type UploadMethod = "auto" | "multipart" | "tus" | "chunked-rest";

UploadItem

State of an individual upload item tracked by the uploader.

interface UploadItem {
    id: string;
    file: File;
    status: "pending" | "uploading" | "completed" | "error" | "aborted";
    completed: number;   // Progress percentage (0-100)
    loaded: number;      // Bytes uploaded so far
    size: number;        // Total file size in bytes
    error?: string;
    batchId?: string;
    retryCount?: number;
    url?: string;
    uploadResponse?: { data?: unknown; response?: string };
}

BatchState

State of a batch upload.

interface BatchState {
    id: string;
    itemIds: string[];
    status: "pending" | "uploading" | "completed" | "error" | "cancelled";
    progress: number;       // Aggregate progress (0-100)
    totalCount: number;
    completedCount: number;
    errorCount: number;
}

UploaderEventType

type UploaderEventType =
    | "ITEM_START" | "ITEM_PROGRESS" | "ITEM_FINISH" | "ITEM_ERROR" | "ITEM_ABORT"
    | "BATCH_START" | "BATCH_PROGRESS" | "BATCH_FINISH" | "BATCH_ERROR"
    | "BATCH_CANCELLED" | "BATCH_FINALIZE" | "BATCH_COMPLETE";

ApiError

interface ApiError {
    error: {
        code: string;
        message: string;
        name?: string;
    };
}

FileHeadMetadata

Metadata returned from HEAD requests.

interface FileHeadMetadata {
    contentLength?: number;
    contentType?: string;
    etag?: string;
    lastModified?: string;
    uploadOffset?: number;
    uploadComplete?: boolean;
    uploadExpires?: string;
    chunkedUpload?: boolean;
    receivedChunks?: number[];
}

FileListResponse

Response from file list queries.

interface FileListResponse {
    data: FileMeta[];
    meta?: {
        page?: number;
        perPage?: number;
        total?: number;
        firstPage?: number;
        lastPage?: number;
        firstPageUrl?: string;
        lastPageUrl?: string;
        nextPageUrl?: string | undefined;
        previousPageUrl?: string | undefined;
    };
}

TransformOptions

Options for file transformation (images, etc.).

interface TransformOptions {
    width?: number;
    height?: number;
    quality?: number;         // 0-100
    format?: string;          // "jpeg", "png", "webp", etc.
    fit?: "cover" | "contain" | "fill" | "inside" | "outside";
    [key: string]: string | number | boolean | undefined;
}

TransformMetadata

Available transformation capabilities.

interface TransformMetadata {
    formats?: string[];
    parameters?: string[];
}

BatchDeleteResult

interface BatchDeleteResult {
    successful?: number;
    failed?: number;
}

React Hooks

All React hooks are imported from @visulima/storage-client/react. They require @tanstack/react-query and a QueryClientProvider to be set up in your component tree.

Upload Hooks

useUpload

Unified upload hook with automatic method selection based on provided endpoints and file size.

const {
    upload,       // (file: File) => Promise<UploadResult>
    abort,        // () => void
    reset,        // () => void
    progress,     // number (0-100)
    isUploading,  // boolean
    isPaused,     // boolean | undefined
    error,        // Error | undefined
    result,       // UploadResult | undefined
    currentMethod,// UploadMethod
    offset,       // number | undefined
    pause,        // (() => void) | undefined
    resume,       // (() => Promise<void>) | undefined
} = useUpload(options);

Options: UseUploadOptions

PropertyTypeDefaultDescription
endpointMultipartstring-Multipart upload endpoint URL
endpointTusstring-TUS upload endpoint URL
endpointChunkedReststring-Chunked REST upload endpoint URL
methodUploadMethodauto-detectedUpload method to use
chunkSizenumber1MB (TUS) / 5MB (chunked)Chunk size
tusThresholdnumber10485760 (10MB)File size threshold for auto-selecting TUS
metadataRecord<string, string>-Additional metadata
retryboolean-Enable automatic retry (TUS/chunked only)
maxRetriesnumber-Maximum retry attempts (TUS/chunked only)
onStart() => void-Called when upload starts
onProgress(progress: number) => void-Called when progress updates
onSuccess(file: UploadResult) => void-Called on success
onError(error: Error) => void-Called on failure
onPause() => void-Called when paused (TUS/chunked only)
onResume() => void-Called when resumed (TUS/chunked only)

useMultipartUpload

Hook for traditional multipart/form-data uploads.

const { upload, progress, isUploading, error, result, reset } = useMultipartUpload({
    endpoint: "/api/upload/multipart",
});

Options: UseMultipartUploadOptions

PropertyTypeRequiredDescription
endpointstringYesUpload endpoint URL
metadataRecord<string, string>NoAdditional metadata
onStart() => voidNoCalled when upload starts
onProgress(progress: number) => voidNoCalled when progress updates
onSuccess(file: UploadResult) => voidNoCalled on success
onError(error: Error) => voidNoCalled on failure

useTusUpload

Hook for TUS resumable uploads with pause/resume support.

const { upload, pause, resume, abort, progress, isUploading, isPaused, offset, error, result, reset } = useTusUpload({
    endpoint: "/api/upload/tus",
});

Options: UseTusUploadOptions

PropertyTypeRequiredDefaultDescription
endpointstringYes-TUS upload endpoint URL
chunkSizenumberNo1048576 (1MB)Chunk size
metadataRecord<string, string>No-Additional metadata
retrybooleanNo-Enable automatic retry
maxRetriesnumberNo-Maximum retry attempts
onStart() => voidNo-Called when upload starts
onProgress(progress: number) => voidNo-Called when progress updates
onSuccess(file: UploadResult) => voidNo-Called on success
onError(error: Error) => voidNo-Called on failure
onPause() => voidNo-Called when paused
onResume() => voidNo-Called when resumed

useChunkedRestUpload

Hook for client-side chunked REST uploads with pause/resume support.

const { upload, pause, resume, abort, progress, isUploading, isPaused, offset, error, result, reset } = useChunkedRestUpload({
    endpoint: "/api/upload/chunked-rest",
    chunkSize: 5 * 1024 * 1024,
});

Options: UseChunkedRestUploadOptions

PropertyTypeRequiredDefaultDescription
endpointstringYes-Chunked REST upload endpoint URL
chunkSizenumberNo5242880 (5MB)Chunk size
metadataRecord<string, string>No-Additional metadata
retrybooleanNo-Enable automatic retry
maxRetriesnumberNo-Maximum retry attempts
onStart() => voidNo-Called when upload starts
onProgress(progress: number, offset: number) => voidNo-Called when progress updates
onSuccess(file: UploadResult) => voidNo-Called on success
onError(error: Error) => voidNo-Called on failure
onPause() => voidNo-Called when paused
onResume() => voidNo-Called when resumed

useBatchUpload

Hook for uploading multiple files simultaneously as a batch.

const { uploadBatch, abortBatch, progress, isUploading, items, completedCount, errorCount, error, reset } = useBatchUpload({
    endpoint: "/api/upload/multipart",
});

Options: UseBatchUploadOptions

PropertyTypeRequiredDescription
endpointstringYesUpload endpoint URL
metadataRecord<string, string>NoAdditional metadata
onStart(batchId: string) => voidNoCalled when batch starts
onProgress(progress: number, batchId: string) => voidNoCalled when progress updates
onSuccess(results: UploadResult[], batchId: string) => voidNoCalled on success
onError(error: Error, batchId: string) => voidNoCalled on failure

Returns: UseBatchUploadReturn

PropertyTypeDescription
uploadBatch(files: File[]) => string[]Uploads files as a batch, returns item IDs
abortBatch(batchId: string) => voidAborts a specific batch
itemsUploadItem[]All upload items in current batch
progressnumberCurrent batch progress (0-100)
isUploadingbooleanWhether a batch is uploading
completedCountnumberNumber of completed items
errorCountnumberNumber of failed items
errorError | undefinedLast batch error
reset() => voidReset batch state

File Input Hooks

useFileInput

Hook for file input handling with drag and drop support.

const { files, inputRef, handleFileChange, handleDrop, handleDragOver, handleDragLeave, openFileDialog, reset } = useFileInput({
    multiple: true,
    accept: "image/*",
});

Options: UseFileInputOptions

PropertyTypeDescription
acceptstringAccept file types (e.g., "image/*", ".pdf")
multiplebooleanWhether to allow multiple file selection
onFilesSelected(files: File[]) => voidCallback when files are selected

Returns: UseFileInputReturn

PropertyTypeDescription
filesFile[]Currently selected files
inputRefReact.RefObject<HTMLInputElement>Ref for the file input element
handleFileChange(event) => voidHandler for input change events
handleDrop(event) => voidHandler for drop events
handleDragOver(event) => voidHandler for drag over events
handleDragLeave(event) => voidHandler for drag leave events
openFileDialog() => voidOpens file dialog programmatically
reset() => voidResets selected files

usePasteUpload

Hook for handling clipboard paste uploads.

const { handlePaste, pastedFiles, reset } = usePasteUpload({
    filter: (file) => file.type.startsWith("image/"),
    onFilesPasted: (files) => console.log("Pasted:", files),
});

Options: UsePasteUploadOptions

PropertyTypeDescription
filter(file: File) => booleanFilter function to accept/reject files
onFilesPasted(files: File[]) => voidCallback when files are pasted

Returns: UsePasteUploadReturn

PropertyTypeDescription
handlePaste(event) => voidHandler for paste events
pastedFilesFile[]Files that were pasted
reset() => voidResets pasted files

File Operation Hooks (Queries)

useGetFile

Fetches/downloads a file by ID using TanStack Query. Supports optional transformation parameters.

const { data, isLoading, error, meta, refetch } = useGetFile({
    endpoint: "/api/files",
    id: "file-123",
});

Options: UseGetFileOptions

PropertyTypeRequiredDescription
endpointstringYesBase endpoint URL
idstringYesFile ID to fetch
enabledbooleanNoWhether to enable the query (default: true)
transformRecord<string, string | number | boolean>NoTransformation parameters
onSuccess(data: Blob, meta?) => voidNoSuccess callback
onError(error: Error) => voidNoError callback

Returns: UseGetFileReturn

PropertyTypeDescription
dataBlob | undefinedFile data as Blob
metaFileMeta | undefinedFile metadata from response headers
isLoadingbooleanWhether request is in progress
errorError | undefinedLast request error
refetch() => voidRefetch the file

useGetFileList

Fetches a paginated list of files.

const { data, isLoading, error, refetch } = useGetFileList({
    endpoint: "/api/files",
    page: 1,
    limit: 20,
});

Options: UseGetFileListOptions

PropertyTypeRequiredDescription
endpointstringYesBase endpoint URL
pagenumberNoPage number
limitnumberNoMaximum elements to retrieve
enabledbooleanNoWhether to enable the query (default: true)
onSuccess(data: FileListResponse) => voidNoSuccess callback
onError(error: Error) => voidNoError callback

useGetFileMeta

Fetches file metadata by ID.

const { data, isLoading, error, refetch } = useGetFileMeta({
    endpoint: "/api/files",
    id: "file-123",
});

Options: UseGetFileMetaOptions

PropertyTypeRequiredDescription
endpointstringYesBase endpoint URL
idstringYesFile ID
enabledbooleanNoWhether to enable the query (default: true)
onSuccess(meta: FileMeta) => voidNoSuccess callback
onError(error: Error) => voidNoError callback

useHeadFile

Fetches file metadata via HEAD request. Useful for checking upload status without downloading.

const { data, isLoading, error, refetch } = useHeadFile({
    endpoint: "/api/files",
    id: "file-123",
});

Options: UseHeadFileOptions

PropertyTypeRequiredDescription
endpointstringYesBase endpoint URL
idstringYesFile ID
enabledbooleanNoWhether to enable the query (default: true)
onSuccess(meta: FileHeadMetadata) => voidNoSuccess callback
onError(error: Error) => voidNoError callback

File Operation Hooks (Mutations)

useDeleteFile

Deletes a file by ID. Automatically invalidates related TanStack Query caches.

const { deleteFile, isLoading, error, reset } = useDeleteFile({
    endpoint: "/api/files",
});

await deleteFile("file-123");

Options: UseDeleteFileOptions

PropertyTypeRequiredDescription
endpointstringYesBase endpoint URL
onSuccess() => voidNoSuccess callback
onError(error: Error) => voidNoError callback

useBatchDeleteFiles

Deletes multiple files by IDs. Automatically invalidates caches.

const { batchDeleteFiles, isLoading, error, reset } = useBatchDeleteFiles({
    endpoint: "/api/files",
});

const result = await batchDeleteFiles(["file-1", "file-2"]);
// result: { successful?: number, failed?: number }

Options: UseBatchDeleteFilesOptions

PropertyTypeRequiredDescription
endpointstringYesBase endpoint URL
onSuccess(result: BatchDeleteResult) => voidNoSuccess callback
onError(error: Error) => voidNoError callback

usePutFile

Creates or updates a file via PUT request with progress tracking.

const { putFile, progress, isLoading, error, data, reset } = usePutFile({
    endpoint: "/api/files",
});

await putFile("file-123", file);

Options: UsePutFileOptions

PropertyTypeRequiredDescription
endpointstringYesBase endpoint URL
onProgress(progress: number) => voidNoProgress callback
onSuccess(result: UploadResult) => voidNoSuccess callback
onError(error: Error) => voidNoError callback

usePatchChunk

Uploads individual chunks for chunked uploads via PATCH request.

const { patchChunk, isLoading, error, data, reset } = usePatchChunk({
    endpoint: "/api/upload/chunked-rest",
});

await patchChunk("file-123", chunkBlob, offset, checksum);

Options: UsePatchChunkOptions

PropertyTypeRequiredDescription
endpointstringYesBase endpoint URL
onSuccess(result: UploadResult) => voidNoSuccess callback
onError(error: Error) => voidNoError callback

Transform Hooks

useTransformFile

Fetches a transformed file (e.g., resized image) using TanStack Query.

const { data, isLoading, error, meta, refetch } = useTransformFile({
    endpoint: "/api/files",
    id: "file-123",
    transform: { width: 800, height: 600, quality: 85 },
});

Options: UseTransformFileOptions

PropertyTypeRequiredDescription
endpointstringYesBase endpoint URL
idstringYesFile ID
transformTransformOptionsYesTransformation parameters
enabledbooleanNoWhether to enable the query
onSuccess(data: Blob, meta?) => voidNoSuccess callback
onError(error: Error) => voidNoError callback

useTransformMetadata

Fetches available transformation options from the server.

const { data, isLoading, error, refetch } = useTransformMetadata({
    endpoint: "/api/files",
});
// data: { formats?: string[], parameters?: string[] }

Abort Hooks

useAbortAll

const { abortAll } = useAbortAll({ endpoint: "/api/upload/multipart" });

useAbortBatch

const { abortBatch } = useAbortBatch({ endpoint: "/api/upload/multipart" });
abortBatch("batch-123");

useAbortItem

const { abortItem } = useAbortItem({ endpoint: "/api/upload/multipart" });
abortItem("item-123");

Retry Hooks

useRetry

const { retryItem } = useRetry({ endpoint: "/api/upload/multipart" });
retryItem("item-123");

useBatchRetry

const { retryBatch } = useBatchRetry({ endpoint: "/api/upload/multipart" });
retryBatch("batch-123");

Event Listener Hooks

All listener hooks accept endpoint and metadata options, plus an event-specific callback.

HookCallbackCallback Signature
useBatchStartListeneronBatchStart(batch: BatchState) => void
useBatchProgressListeneronBatchProgress(batch: BatchState) => void
useBatchFinishListeneronBatchFinish(batch: BatchState) => void
useBatchErrorListeneronBatchError(batch: BatchState) => void
useBatchCancelledListeneronBatchCancelled(batch: BatchState) => void
useBatchFinalizeListeneronBatchFinalize(batch: BatchState) => void
useRetryListeneronRetry(item: UploadItem) => void
useAllAbortListeneronAbortAll() => void

Solid Primitives

All Solid.js primitives are imported from @visulima/storage-client/solid. They require @tanstack/solid-query and a QueryClientProvider in your component tree.

Solid primitives follow the same API patterns as React hooks but use Solid's reactive primitives (Accessor, createSignal, createMemo) instead of React state. Return values that are reactive are wrapped as Accessor<T> (called as functions, e.g., progress() instead of progress).

Upload Primitives

PrimitiveDescription
createUploadUnified upload with automatic method selection
createMultipartUploadMultipart/form-data uploads
createTusUploadTUS resumable uploads with pause/resume
createChunkedRestUploadChunked REST uploads with pause/resume
createBatchUploadBatch upload for multiple files

File Input Primitives

PrimitiveDescription
createFileInputFile input with drag and drop support
createPasteUploadClipboard paste upload handling

File Operation Primitives

PrimitiveDescription
createGetFileFetch/download a file by ID
createGetFileListFetch paginated file list
createGetFileMetaFetch file metadata
createHeadFileHEAD request for file status
createDeleteFileDelete a file
createBatchDeleteFilesBatch delete files
createPutFileCreate/update a file via PUT
createPatchChunkUpload individual chunks

Transform Primitives

PrimitiveDescription
createTransformFileFetch transformed file
createTransformMetadataFetch transformation capabilities

Abort Primitives

PrimitiveDescription
createAbortAllAbort all uploads
createAbortBatchAbort a batch
createAbortItemAbort a specific item

Retry Primitives

PrimitiveDescription
createRetryRetry a failed item
createBatchRetryRetry failed items in a batch

Event Listener Primitives

PrimitiveDescription
createBatchStartListenerListen to batch start events
createBatchProgressListenerListen to batch progress events
createBatchFinishListenerListen to batch finish events
createBatchErrorListenerListen to batch error events
createBatchCancelledListenerListen to batch cancelled events
createBatchFinalizeListenerListen to batch finalize events
createRetryListenerListen to retry events
createAllAbortListenerListen to abort all events

Vue Composables

All Vue composables are imported from @visulima/storage-client/vue. They require @tanstack/vue-query and VueQueryPlugin to be installed. The API mirrors the React hooks using the same naming convention (useUpload, useTusUpload, etc.) with Vue's reactivity system (Ref instead of React state).


Svelte Stores

All Svelte stores are imported from @visulima/storage-client/svelte. They require @tanstack/svelte-query and follow Svelte store conventions. Function names use the create* prefix (e.g., createUpload, createTusUpload). Return values are Svelte stores accessed with the $ prefix in templates (e.g., $progress, $isUploading).

Support

Contribute to our work and keep us going

Community is the heart of open source. The success of our packages wouldn't be possible without the incredible contributions of users, testers, and developers who collaborate with us every day.Want to get involved? Here are some tips on how you can make a meaningful impact on our open source projects.

Ready to help us out?

Be sure to check out the package's contribution guidelines first. They'll walk you through the process on how to properly submit an issue or pull request to our repositories.

Submit a pull request

Found something to improve? Fork the repo, make your changes, and open a PR. We review every contribution and provide feedback to help you get merged.

Good first issues

Simple issues suited for people new to open source development, and often a good place to start working on a package.
View good first issues