Installation โ
Sobj features a decoupled architecture made of a tiny core package and provider-specific adapters. This structure keeps your bundle light by only importing code for the backends you actually use.
๐ฆ Core Package โ
To begin, install the core sobj package in your project:
bash
pnpm add sobjOr using your preferred package manager:
bash
# npm
npm install sobj
# Yarn
yarn add sobj
# Bun
bun add sobj๐ Storage Adapters โ
Next, install the adapter corresponding to the storage provider you wish to use. Each provider has its own dedicated package.
| Provider | Package | Use Case |
|---|---|---|
| In-Memory | @sobj/memory | Testing, local development, mocking |
| AWS S3 | @sobj/s3 | Production Amazon Web Services storage |
| Cloudflare R2 | @sobj/r2 | Production Cloudflare storage |
| Backblaze B2 | @sobj/b2 | Production Backblaze cloud storage |
| MinIO | @sobj/minio | Self-hosted object storage |
For example, to install both the in-memory adapter and Cloudflare R2:
bash
pnpm add @sobj/memory @sobj/r2๐งช Verify Installation โ
Once packages are installed, verify the setup by importing the client factory and your chosen adapter:
ts
import { sobj } from 'sobj'
import { memory } from '@sobj/memory'
const storage = sobj(memory())Your environment is now configured. Proceed to the Quick start to run your first storage operations.