Supabase Automation Toolkit avatar
Supabase Automation Toolkit

Pricing

from $0.10 / 1,000 results

Go to Apify Store
Supabase Automation Toolkit

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

Mohamed Ali DHIBA

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

0

Monthly active users

5 days ago

Last modified

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.

Apify Store License: MIT TypeScript


โœจ 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

1. Get Your Supabase Credentials

From your Supabase Dashboard:

# Project Settings > API
SUPABASE_URL=https://xxx.supabase.co
SUPABASE_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 TypePrice
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,status
1,user1@example.com,2025-01-01,active
2,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 script
const { 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: Crontab
0 2 * * * node backup-script.js
# After: Apify Schedule
Schedule Actor run daily at 2 AM

๐Ÿค Support & Community


๐ŸŽ“ Tutorials

Tutorial 1: Daily User Export

  1. Create Actor run
  2. Configure task: export_data
  3. Set schedule: Daily 2 AM
  4. Connect to Google Sheets (optional)

Tutorial 2: Cleanup Old Data

  1. Test with dryRun: true
  2. Review what would be deleted
  3. Run with dryRun: false
  4. Schedule monthly

Tutorial 3: Automated Backups

  1. Select tables to backup
  2. Choose format (JSON/CSV)
  3. Enable compression
  4. 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


Built by Ali Dhiba with โค๏ธ for the automation community

Automate your Supabase workflows and save hours every week ๐Ÿš€