P

Power Supabase Invoker

Streamline your workflow with this generate, typescript, types, supabase. Includes structured workflows, validation checks, and reusable patterns for database.

CommandClipticsdatabasev1.0.0MIT
0 views0 copies

Power Supabase Invoker

Execute advanced Supabase operations including edge function deployment, realtime channel management, and project configuration.

When to Use This Command

Run this command when you need to:

  • Deploy, test, or manage Supabase Edge Functions from the command line with environment configuration
  • Configure and monitor Supabase Realtime channels, broadcast events, or manage presence state
  • Update project-level settings like auth providers, storage policies, or custom SMTP configuration

Consider alternatives when:

  • You need to run SQL queries or manage table data (use smart-supabase-tool)
  • You need to audit security or RLS policies (use efficient-supabase-security-audit)

Quick Start

Configuration

name: power-supabase-invoker type: command category: database

Example Invocation

claude command:run power-supabase-invoker --action deploy-function --name process-webhook --project myapp-prod

Example Output

[Connect] Project: myapp-prod | Region: us-east-1

[Deploy] Edge Function: process-webhook
  Source: supabase/functions/process-webhook/index.ts
  Bundle size: 12.4 KB (limit: 2 MB)
  Environment vars: 3 injected (STRIPE_KEY, WEBHOOK_SECRET, API_URL)
  Deploying... OK (3.2s)
  Endpoint: https://myapp-prod.supabase.co/functions/v1/process-webhook

[Verify] Health check: 200 OK (142ms)
[Logs] Tailing function logs for 10s...
  [INFO] Function initialized successfully
  [INFO] Connected to database pool

Core Concepts

Supabase Invocation Overview

AspectDetails
FunctionsDeploy, invoke, test, and monitor Supabase Edge Functions (Deno runtime)
RealtimeManage channels, broadcast messages, track presence state
ConfigUpdate auth providers, storage policies, SMTP, and custom domains
MonitoringStream function logs, track invocation metrics, monitor error rates

Invocation Workflow

[Select Operation Type]
    /       |        \
[Functions] [Realtime] [Config]
    |       |        |
[Validate Inputs]
    |
[Execute via Supabase CLI/API]
    |
[Verify + Stream Logs]

Configuration

ParameterTypeDefaultDescription
actionstringrequiredOperation: deploy-function, invoke, realtime, config, or logs
namestringnoneFunction name, channel name, or config key to target
projectstringautoSupabase project reference (auto-detected from config)
env-filestring.envPath to environment variables file for function deployment
tailbooleanfalseStream logs continuously after deployment or invocation

Best Practices

  1. Test Functions Locally First - Use supabase functions serve to run Edge Functions locally before deploying. The command validates your function compiles, but logic errors only surface at runtime.

  2. Pin Environment Variables - Store function environment variables in a version-controlled .env.production file (with secrets excluded). This ensures consistent deployments across team members.

  3. Monitor After Every Deploy - Enable --tail after deploying a function to watch for initialization errors and cold start issues. The first invocation after deployment is when most problems surface.

  4. Use Realtime Channels Sparingly - Each active Realtime channel consumes server resources. Clean up unused channels and set appropriate presence timeouts to avoid resource exhaustion.

  5. Batch Configuration Changes - When updating multiple project settings, group them into a single invocation. Individual API calls for each setting increase latency and risk partial configuration states.

Common Issues

  1. Function Deploy Fails with Import Error - Edge Functions use Deno, not Node.js. Replace Node-specific imports (e.g., require()) with Deno-compatible ESM imports and URL-based dependencies.

  2. Realtime Channel Not Receiving Messages - Verify RLS policies on the target table allow the authenticated user to read. Realtime respects RLS, so policies that block SELECT also block subscriptions.

  3. Config Update Returns 403 - Project configuration changes require the management API token, not the service role key. Obtain the management token from the Supabase dashboard under Project Settings.

Community

Reviews

Write a review

No reviews yet. Be the first to review this template!

Similar Templates