Skip to content
extraorbital
Documentation ExtraOrbital
Browse documentation

Data & storage

B2 storage

Add a Backblaze B2 file bucket to your project.

Run in your project folder
npx extraorbital add b2

Free-plan files are hidden after 30 days and deleted 10 days later.

  1. 01 / Run the commandGet the service
  2. 02 / Read your .envUse its credentials
  3. 03 / Connect your appCall the SDK or API

Limits

LimitFree · PrototypePaid
StorageYour allowanceUsage billed
RequestsFreeFree
Bandwidth3× storage, then $0.01 / GB3× storage, then $0.01 / GB
File retentionHidden 30 days after upload, deleted 10 days laterKept until you delete it
BackupsNoneCharged as storage
Inactive resource30 days after last usePersistent

Free allowances are shared across the account. Provider limits still apply on paid plans.

Use it

storage.ts
import { S3Client, PutObjectCommand } from "@aws-sdk/client-s3";

const b2 = new S3Client({
  region: process.env.B2_REGION,
  endpoint: process.env.B2_ENDPOINT,
  forcePathStyle: true,
  credentials: {
    accessKeyId: process.env.B2_ACCESS_KEY_ID!,
    secretAccessKey: process.env.B2_SECRET_ACCESS_KEY!,
  },
});

await b2.send(
  new PutObjectCommand({ Bucket: process.env.B2_BUCKET, Key: "report.json", Body: data }),
);

Environment variables

The CLI writes these to .env or an existing .env.local.

VariablePurpose
B2_BUCKETBucket name
B2_ENDPOINTS3-compatible endpoint
B2_REGIONRegion determined by the provider account
B2_ACCESS_KEY_IDBucket access key
B2_SECRET_ACCESS_KEYPrivate signing secret

Specifics

Options

Terminal
npx extraorbital add b2 [--slug <name>] [--public]
FlagDefaultDescription
--slugdefaultA second, fully separate bucket in the same project
--publicoffObjects are publicly readable

The account determines the region. B2_REGION reports it; there is no region option.

Options apply at creation. Reusing a slug does not change the bucket. Use a new slug for a different configuration.

Access

Credentials are limited to this bucket. --public makes objects readable without authentication. Use a new slug for a different configuration; repeating add reuses the existing bucket.

File retention

Free-plan files are hidden 30 days after upload, then deleted 10 days later by a Backblaze lifecycle rule.

Hidden files cannot be read or listed. Upgrading during the 10-day window restores access; deleted files cannot be restored.

Upgrading removes future expiry within an hour.

The supplied key manages objects, not bucket configuration. You cannot change the lifecycle rule.

File expiry applies even when a bucket is active. The separate inactivity policy deletes resources unused for 30 days.

Pricing

UsagePaid rate
Storage$0.00695 / GB-mo
RequestsFree
Bandwidth3× storage, then $0.01 / GB

See pricing for team subscription fees, allowances, and billing terms. Plans and billing ↗

Storage is sampled daily. Egress is tracked at account level, not per bucket. Usage appears after each UTC day closes.