Purpose
Purchases and Pro Access enforce Firestruct's commercial access model. Free users can connect projects, inspect read-only data, use Settings, and use Support. Pro access unlocks write, destructive, export/import, upload, deploy, script, and saved-workflow capabilities.
Entitlements
The app supports:
- Pro monthly
- Pro yearly
- lifetime purchase
- restore purchase
Gated Capabilities
Current Pro feature gates include:
- Auth import/export
- Auth writes
- Auth scripts
- Firestore export
- Firestore import
- Firestore writes
- saved Firestore queries
- saved Firestore scripts
- Firestore scripts
- Firestore transfer
- Index Advisor sync
- migration apply
- Push send
- Push token scripts
- seed apply
- seed template files
- Storage writes
- Workspace deploy
- Workspace link persistence
Paywall Behavior
When a gated action is requested without entitlement, the app should present the paywall before work begins. The paywall must not enqueue tasks or mutate local/external state until purchase or restore succeeds.
The paywall should name the requested capability so users understand why it appeared. For example, exporting Auth users, applying a seed, uploading Storage objects, or running a Firestore script should each connect the purchase prompt to the action the user selected.
Restore purchase must be easy to find and should update entitlement state before the blocked action resumes. If restore fails, the app should leave the original operation unstarted and show an actionable StoreKit or network error.
Safety
Pro access does not bypass project read-only mode or production confirmation. Entitlement, read-only, and confirmation checks are separate guardrails.
Source Anchors
Sources/FirestructApp/Features/Purchases/Model/ProAccessState.swiftSources/FirestructApp/Features/Purchases/Services/AppModel+Purchases.swiftSources/FirestructApp/Features/Purchases/Services/StoreKitPurchaseService.swiftSources/FirestructApp/Features/Purchases/UI/PaywallView.swift