Use Cases
Explore common scenarios supported by the Object Storage Blueprint:File Hosting
Bill customers based on total storage usage and upload volume.
Backup Services
Track backup data uploads and charge per GB stored.
Media CDN
Monitor media uploads and bill for storage and bandwidth.
Document Management
Track document uploads per customer for usage-based pricing.
Perfect for billing based on storage uploads, file hosting, CDN usage, or backup services.
Quick Start
Track object storage uploads with bytes consumed:1
Install the SDK
2
Get Your API Keys
- Dodo Payments API Key: Get it from Dodo Payments Dashboard
- Storage Provider API Key: From AWS S3, Google Cloud Storage, Azure, etc.
3
Create a Meter
Create a meter in your Dodo Payments Dashboard:
- Event Name:
object_storage_upload
(or your preferred name) - Aggregation Type:
sum
to track total bytes uploaded - Over Property:
bytes
to bill based on storage size
4
Track Storage Usage
Configuration
Ingestion Configuration
Your Dodo Payments API key from the dashboard.
Environment mode:
test_mode
or live_mode
.Event name that matches your meter configuration.
Track Object Storage Options
The customer ID for billing attribution.
Number of bytes uploaded. Required for byte-based billing.
Optional metadata about the upload like bucket name, content type, etc.
Best Practices
Track Before or After Upload: You can track the event before or after the actual upload depending on your error handling strategy.
Handle Upload Failures: Only track successful uploads to avoid billing for failed operations.