Supabase Automation Toolkit
Pricing
from $0.10 / 1,000 results
Supabase Automation Toolkit
Save hours with Supabase automation. Export, cleanup, backup with simple JSON tasks. Schedule daily reports, remove inactive users, free up storage automatically.
Pricing
from $0.10 / 1,000 results
Rating
0.0
(0)
Developer

Mohamed Ali DHIBA
Actor stats
0
Bookmarked
1
Total users
0
Monthly active users
5 days ago
Last modified
Categories
Share
๐ Supabase Automation Toolkit
Powerful automation tools for Supabase - Automate database operations, user management, storage cleanup, and data exports with a simple, pay-per-use Actor.
โจ Features
- ๐ Data Export: Export tables to CSV, JSON, or Excel formats
- ๐ Advanced Queries: Filter, sort, and aggregate your data
- ๐ฅ User Management: Bulk user operations (cleanup, export, updates)
- ๐๏ธ Storage Cleanup: Delete old files, unused assets, batch operations
- ๐ฆ Automated Backups: Schedule regular database backups
- ๐ Analytics Reports: Generate custom reports from your data
- โฐ Scheduled Runs: Set up recurring automation tasks
- ๐ Secure: Uses your Supabase credentials with RLS support
๐ฏ Use Cases
1. ๐ Daily Data Exports
Export your users table to CSV every night for analytics:
{"task": "export_data","table": "users","format": "csv","filters": {"created_at": "last_24_hours"}}
2. ๐๏ธ Clean Up Old Data
Remove inactive users automatically:
{"task": "cleanup_users","inactiveDays": 90,"confirmDelete": true}
3. ๐ฆ Backup Database
Create daily backups of critical tables:
{"task": "backup_tables","tables": ["users", "orders", "products"],"destination": "storage"}
4. ๐ Generate Reports
Create weekly analytics reports:
{"task": "generate_report","reportType": "user_growth","period": "last_7_days"}
5. ๐งน Storage Maintenance
Clean up unused files older than 30 days:
{"task": "cleanup_storage","bucket": "avatars","olderThanDays": 30}
๐ Quick Start
Prerequisites
- A Supabase project (Create one free)
- Apify account (Sign up free)
1. Get Your Supabase Credentials
From your Supabase Dashboard:
# Project Settings > APISUPABASE_URL=https://xxx.supabase.coSUPABASE_KEY=your-anon-or-service-role-key
Note: Use service role key for admin operations (user management, bypassing RLS).
๐ Available Tasks
๐๏ธ Data Tasks
export_data
Export table data to various formats (CSV, JSON, Excel).
Input:
{"task": "export_data","supabaseUrl": "https://xxx.supabase.co","supabaseKey": "your-key","table": "users","format": "csv","columns": ["id", "email", "created_at"],"filters": {"created_at": "last_7_days","status": "active"},"limit": 10000}
Output: Dataset with exported records
query_data
Execute custom queries with advanced filtering.
Input:
{"task": "query_data","supabaseUrl": "https://xxx.supabase.co","supabaseKey": "your-key","table": "orders","select": "*, users(email)","filters": [{ "column": "total", "operator": "gt", "value": 100 },{ "column": "status", "operator": "eq", "value": "completed" }],"orderBy": "created_at","orderDirection": "desc"}
๐ฅ User Management Tasks
export_users
Export all users with their metadata.
Input:
{"task": "export_users","supabaseUrl": "https://xxx.supabase.co","supabaseKey": "your-service-role-key","format": "csv","includeMetadata": true}
cleanup_users
Remove inactive or unverified users.
Input:
{"task": "cleanup_users","supabaseUrl": "https://xxx.supabase.co","supabaseKey": "your-service-role-key","criteria": "unverified","olderThanDays": 30,"dryRun": true}
Note: Set dryRun: false to actually delete users.
๐ฆ Storage Tasks
cleanup_storage
Delete old or unused files from storage buckets.
Input:
{"task": "cleanup_storage","supabaseUrl": "https://xxx.supabase.co","supabaseKey": "your-key","bucket": "avatars","olderThanDays": 90,"pattern": "*.tmp","dryRun": true}
list_storage
List all files in a bucket with metadata.
Input:
{"task": "list_storage","supabaseUrl": "https://xxx.supabase.co","supabaseKey": "your-key","bucket": "documents","path": "2024/","includeMetadata": true}
๐ Schema Tasks
analyze_schema
Get complete database schema information.
Input:
{"task": "analyze_schema","supabaseUrl": "https://xxx.supabase.co","supabaseKey": "your-key","includeSizes": true,"includeIndexes": true}
table_stats
Get statistics for specific tables.
Input:
{"task": "table_stats","supabaseUrl": "https://xxx.supabase.co","supabaseKey": "your-key","tables": ["users", "orders", "products"]}
๐ฆ Backup Tasks
backup_database
Create full or partial database backups.
Input:
{"task": "backup_database","supabaseUrl": "https://xxx.supabase.co","supabaseKey": "your-key","tables": ["users", "orders"],"format": "json","compress": true}
๐ฐ Pricing
Simple pay-per-use pricing:
| Operation Type | Price |
|---|---|
| Data Export (per 1000 rows) | $0.01 |
| User Management (per operation) | $0.05 |
| Storage Cleanup (per 1000 files) | $0.02 |
| Backup (per table) | $0.10 |
| Schema Analysis | $0.01 |
Example costs:
- Export 10,000 users = $0.10
- Daily backups (3 tables) = $0.30
- Clean 5,000 old files = $0.10
- Monthly automation โ $5-20
๐ง Advanced Configuration
Scheduling Runs
Set up recurring automation in Apify Console:
{"schedule": {"cron": "0 2 * * *","timezone": "UTC"},"task": "export_data","table": "users","format": "csv"}
Common schedules:
- Daily at 2 AM:
0 2 * * * - Every hour:
0 * * * * - Weekly (Monday 9 AM):
0 9 * * 1 - Monthly (1st day):
0 0 1 * *
Output Options
Save to Dataset:
{"outputTo": "dataset"}
Save to Key-Value Store:
{"outputTo": "kvstore","key": "backup-2025-01-01"}
Webhook Notification:
{"webhook": "https://your-app.com/webhook","notifyOnComplete": true}
๐ก๏ธ Security Best Practices
1. Use Service Role Key for Admin Tasks
{"supabaseKey": "your-service-role-key"}
2. Enable Dry Run First
{"task": "cleanup_users","dryRun": true}
3. Set Up Alerts
- Monitor failed runs
- Track unusual activity
- Set spending limits
4. Use Read-Only Keys When Possible
For exports and analytics, use anon key with RLS policies.
๐ Output Examples
CSV Export
id,email,created_at,status1,user1@example.com,2025-01-01,active2,user2@example.com,2025-01-02,active
JSON Export
{"success": true,"recordsExported": 150,"table": "users","executedAt": "2025-01-01T10:00:00Z","data": [...]}
Analytics Report
{"reportType": "user_growth","period": "last_7_days","metrics": {"newUsers": 45,"activeUsers": 320,"churnRate": 2.3}}
๐ Troubleshooting
Common Issues
1. "Permission denied"
- Use service role key for admin operations
- Check RLS policies on tables
2. "Table not found"
- Verify table name spelling
- Check schema (default is
public)
3. "Rate limit exceeded"
- Reduce batch size
- Add delays between operations
4. "Connection timeout"
- Check Supabase project status
- Verify network connectivity
๐ Migration from Other Tools
From Manual Scripts
// Before: Manual scriptconst { data } = await supabase.from('users').select('*');fs.writeFileSync('users.csv', convertToCSV(data));// After: Apify Actor{"task": "export_data","table": "users","format": "csv"}
From Cron Jobs
# Before: Crontab0 2 * * * node backup-script.js# After: Apify ScheduleSchedule Actor run daily at 2 AM
๐ค Support & Community
- ๐ง Email: support@your-domain.com
- ๐ฌ Discord: Join Apify Community
- ๐ Issues: Report bugs via Apify Console
- ๐ Docs: Full Documentation
๐ Tutorials
Tutorial 1: Daily User Export
- Create Actor run
- Configure task:
export_data - Set schedule: Daily 2 AM
- Connect to Google Sheets (optional)
Tutorial 2: Cleanup Old Data
- Test with
dryRun: true - Review what would be deleted
- Run with
dryRun: false - Schedule monthly
Tutorial 3: Automated Backups
- Select tables to backup
- Choose format (JSON/CSV)
- Enable compression
- Schedule weekly runs
๐ Changelog
Version 1.0.0 (2025-01-01)
- โจ Initial release
- ๐ Data export (CSV, JSON, Excel)
- ๐ฅ User management automation
- ๐๏ธ Storage cleanup tools
- ๐ฆ Database backup features
- ๐ Schema analysis
- โฐ Schedule support
๐ License
MIT License - see LICENSE file for details.
๐ Show Your Support
If this Actor helps you, please:
- โญ Star on Apify Store
- ๐ฃ Share with your network
- ๐ฌ Leave feedback and suggestions
- ๐ Report issues to help us improve
๐ Built With
- Apify SDK - Actor framework
- Supabase JS - Database client
- TypeScript - Type safety
Built by Ali Dhiba with โค๏ธ for the automation community
Automate your Supabase workflows and save hours every week ๐