Advanced

Overview

Extend Nuxt Upload Kit with custom plugins and storage adapters.

Extending Nuxt Upload Kit

Nuxt Upload Kit is designed to be extensible. You can create custom plugins for validation and file processing, or build your own storage adapters for different cloud providers.

Extension Types

TypePurposeFactory Function
Processing PluginsValidate and transform filesdefineProcessingPlugin
Storage AdaptersUpload to custom storage providersdefineStorageAdapter

Processing Plugins

Processing plugins hook into the file lifecycle to validate, transform, or enhance files before and after upload.

Common use cases:

  • Custom validation rules (filename patterns, content checks)
  • Image transformations (watermarks, filters, cropping)
  • File format conversions
  • Metadata extraction

Learn how to create custom plugins →

Storage Adapters

Storage adapters handle the actual upload, download, and deletion of files from remote storage providers.

Common use cases:

  • Custom cloud storage providers
  • Self-hosted storage solutions
  • Multi-cloud setups
  • Custom authentication flows

Learn how to create custom storage adapters →

Plugin Context

Both plugin types receive a context object with access to:

interface PluginContext {
  // Current files in the uploader
  files: UploadFile[]

  // Upload manager options
  options: UploadOptions

  // Emit custom events (auto-prefixed with plugin ID)
  emit: (event: string, payload: any) => void
}

Storage adapters also receive:

interface StorageContext extends PluginContext {
  // Report upload progress (0-100)
  onProgress: (percentage: number) => void
}

Best Practices

  1. Use descriptive IDs - Plugin IDs prefix events and errors
  2. Handle errors gracefully - Return original file if processing fails
  3. Skip when appropriate - Check file type/source before processing
  4. Emit progress events - Keep users informed of long operations
  5. Clean up resources - Revoke object URLs, close connections
  6. Document options - Use JSDoc for option descriptions
Copyright © 2026