Start Building

Contents

shdwDrive SDK

shdwDrive CLI

shdwDrive SDK

shdwDrive SDK is a typeScript SDK for interacting with ShdwDrive, providing simple and efficient methods for file operations on the decentralized storage platform.

Installation

Local Development

Features

  • 📤 File uploads (supports both small and large files)

  • 📥 File deletion

  • 📋 File listing

  • 📊 Bucket usage statistics

  • 🗂️ Folder creation and management

  • 🔐 Secure message signing

  • ⚡ Progress tracking for uploads

  • 🔄 Multipart upload support for large files

Quick Start

Usage Examples

Upload a File

Create a Folder

Delete a Folder

List Files

Delete a File

API Reference

ShdwDriveSDK

Constructor Options

Methods

  • uploadFile(bucket: string, file: File, options?: FileUploadOptions)

  • deleteFile(bucket: string, fileUrl: string)

  • listFiles(bucket: string)

  • getBucketUsage(bucket: string)

  • createFolder(bucket: string, folderName: string)

  • deleteFolder(bucket: string, folderUrl: string)

shdwDrive CLI

A command-line interface for interacting with shdwDrive storage.

Features

  • 📤 File uploads (supports both small and large files)

  • 📁 Folder support (create, delete, and manage files in folders)

  • 📥 File and folder deletion

  • 📋 File listing

  • 📊 Bucket usage statistics

  • 🔐 Secure message signing

  • 🔄 Multipart upload support for large files

Installation

You can install the CLI globally using npm:

Or use it directly from the repository:

Configuration

The CLI uses environment variables for configuration:

Usage

Upload a file

Delete a file

Create a folder

List files in a bucket

Check bucket storage usage

Command Options

Upload Options

  • -k, --keypair - Path to your Solana keypair file

  • -b, --bucket - Your bucket identifier

  • -f, --file - Path to the file you want to upload

  • -F, --folder - (Optional) Folder path within the bucket

Delete Options

  • -k, --keypair - Path to your Solana keypair file

  • -b, --bucket - Your bucket identifier

  • -f, --file - URL or path of the file to delete

Create Folder Options

  • -k, --keypair - Path to your Solana keypair file

  • -b, --bucket - Your bucket identifier

  • -n, --name - Name/path of the folder to create

Delete Folder Options

  • -k, --keypair - Path to your Solana keypair file

  • -b, --bucket - Your bucket identifier

  • -p, --path - Path of the folder to delete

Development

  1. Clone the repository:

  1. Install dependencies:

  1. Build the project:

  1. Link the CLI locally:

Last updated