Billing Features
Game Framework tracks 10 features across all plans. Features are either limit-based (with usage counts) or boolean (on/off).
Limit-Based Features
1. Max Packages
Type: Count-based limit
Tracks the total number of packages in a workspace .
| Plan | Limit |
|---|---|
| Free | 5 packages |
| Pro | 50 packages |
| Enterprise | Unlimited |
Enforced During: Package creation
Usage Example:
// Before creating a package
if err := billingService.EnforceFeature(ctx, workspaceID, billing.FeatureKeyMaxPackages); err != nil {
return errs.PaymentRequired("package limit exceeded")
}2. Max Storage
Type: Size-based limit (bytes)
Tracks total artifact storage consumed.
| Plan | Limit |
|---|---|
| Free | 10GB (10,737,418,240 bytes) |
| Pro | 100GB (107,374,182,400 bytes) |
| Enterprise | 1TB (1,099,511,627,776 bytes) |
Enforced During: Artifact upload
Can be Extended: Yes, with storage addons ($20 per 100GB/month)
3. Max Downloads
Type: Count-based limit (monthly)
Tracks monthly package downloads.
| Plan | Limit |
|---|---|
| Free | 1,000/month |
| Pro | 100,000/month |
| Enterprise | Unlimited |
Enforced During: Artifact streaming/download
Resets: Monthly on subscription anniversary
4. Max Versions
Type: Count-based limit (per package)
Tracks versions per package.
| Plan | Limit |
|---|---|
| Free | 10 versions/package |
| Pro | 100 versions/package |
| Enterprise | Unlimited |
Enforced During: Version creation
5. Max Bandwidth
Type: Size-based limit (bytes, monthly)
Tracks monthly data transfer.
| Plan | Limit |
|---|---|
| Free | 50GB/month |
| Pro | 1TB/month |
| Enterprise | 10TB/month |
Enforced During: Downloads (tracked after completion)
Resets: Monthly on subscription anniversary
Can be Extended: Yes, with bandwidth addons ($10 per 100GB/month)
Boolean Features
6. API Access
Type: Boolean (on/off)
Enables API key creation and programmatic access.
| Plan | Available |
|---|---|
| Free | ✗ |
| Pro | ✓ |
| Enterprise | ✓ |
Enables:
- API key creation
- Programmatic package publishing
- CI/CD integration
- Automated workflows
7. Advanced Analytics
Type: Boolean (on/off)
Enables detailed download statistics, geo-distribution, and trend analysis.
| Plan | Available |
|---|---|
| Free | ✗ |
| Pro | ✓ |
| Enterprise | ✓ |
Provides:
- Download trends over time
- Geographic distribution
- Version popularity
- Custom date ranges
- Export capabilities
8. CDN Distribution
Type: Boolean (on/off)
Enables global CDN delivery for faster downloads worldwide.
| Plan | Available |
|---|---|
| Free | ✗ |
| Pro | ✗ |
| Enterprise | ✓ |
Benefits:
- Global edge locations
- Faster download speeds
- Reduced latency
- Better reliability
9. Priority Support
Type: Boolean (on/off)
Faster response times and dedicated support channel.
| Plan | Available | SLA |
|---|---|---|
| Free | ✗ | Community |
| Pro | ✗ | 48 hours |
| Enterprise | ✓ | 4 hours |
Includes:
- Dedicated support channel
- Faster response times
- Phone support
- Dedicated account manager
10. Team Features
Type: Boolean (on/off)
Enables multi-user collaboration with roles and permissions.
| Plan | Available |
|---|---|
| Free | ✗ |
| Pro | ✓ |
| Enterprise | ✓ |
Enables:
- Multiple workspace members
- Role-based permissions
- Member invitations
- Audit logging
Feature Enforcement
All features use hard-block enforcement - operations are prevented when limits are exceeded.
Enforcement Example
func (h *PackageHandler) Create(c forge.Context) error {
workspaceID := getWorkspaceID(c)
// Enforce package limit
if err := h.billing.EnforceFeature(ctx, workspaceID, billing.FeatureKeyMaxPackages); err != nil {
return errs.PaymentRequired("package limit exceeded - upgrade to create more packages")
}
// Create package...
}Error Response
When a limit is exceeded:
{
"error": {
"code": "FEATURE_LIMIT_EXCEEDED",
"message": "Package limit exceeded - upgrade to create more packages",
"details": {
"feature": "max_packages",
"current_usage": 5,
"limit": 5,
"plan": "free",
"upgrade_url": "/billing/plans"
}
}
}Clients receive a 402 Payment Required status code when limits are exceeded, allowing them to show upgrade prompts to users.
Checking Feature Access
Check Access Status
GET /v1/workspaces/:workspaceId/billing/featuresResponse:
{
"features": [
{
"key": "max_packages",
"type": "limit",
"limit": 5,
"current_usage": 3,
"can_proceed": true,
"warning_threshold": 4,
"warning_msg": null
},
{
"key": "api_access",
"type": "boolean",
"enabled": false,
"can_proceed": false
}
]
}Get Specific Feature
GET /v1/workspaces/:workspaceId/billing/features/max_packagesUsage Tracking
Usage is tracked automatically:
- Packages: Counted on creation/deletion
- Storage: Calculated from artifact sizes
- Downloads: Incremented on each download
- Versions: Counted per package
- Bandwidth: Tracked after successful downloads
View usage summary:
GET /v1/workspaces/:workspaceId/billing/usage