Skip to main content
We provide separate SDK packages per chain. Pick the one that matches your payment method.

Installation

Peer dependencies:
Works with any Solana wallet adapter (Phantom, Solflare, Ledger, etc.)

Basic Usage

Import and use the SDK in your React component:

Environment Types

The SDK supports three environments:
Always use testnet or devnet for development. Only use mainnet for production with real tokens.

Core Methods

The SDK provides a couple of methods (we’ll add more as we see fit, in the future):

estimateStorageCost

Calculate upload costs before committing

createDeposit

Upload files and create onchain deposit

getSolPrice

Get real-time SOL/USD exchange rate

getUserUploadHistory

Fetch all uploads for a wallet address

renewStorageDuration

Extend storage duration for existing uploads

Type Safety

The SDK is type-safe. Import types as needed:

Configuration

Network Selection

The environment parameter determines which Solana network to use:
  • devnet: Local development
  • testnet: Public testing with test SOL
  • mainnet: Production with real SOL

Custom RPC URL (Optional)

By default, the SDK uses public Solana RPC endpoints. For production applications, you should use your own RPC provider (like Helius or QuickNode) to avoid rate limits:
Security Note: If you’re using a paid RPC provider, don’t expose your API key in frontend code! Instead, create a proxy endpoint on your backend that forwards RPC requests to your provider.
For backend/server-side usage:

Common Patterns

Checking Balance Before Upload

Toast Notifications

Email Notifications (Optional)

Vite Configuration

If using Vite, you’ll need Node.js polyfills for the browser:
Then update your vite.config.ts:
This prevents ReferenceError: process is not defined and provides necessary Node.js polyfills for Solana Web3.js to work in the browser.

Next Steps

Upload Files

Learn how to upload files and create deposits

View History

Fetch and display upload history

Renew Storage

Extend storage duration

Core Concepts

Understand how it works

Support

GitHub Issues

Report bugs or request features

SOL Package

View on npm

FIL Package

View on npm