In this guide, you’ll learn how to:
  • Let Rocket auto-detect when backend logic is needed.
  • Create and deploy Supabase Edge Functions directly from chat.
  • Add secrets securely during deployment.

Before you begin

You’ll need:
  • A Supabase account with an active project.
  • Your Supabase account connected to Rocket.

What are Supabase Edge Functions?

Edge Functions run on Supabase’s infrastructure and handle backend logic for your app.
Use them for secure server tasks such as sending emails, calling external APIs, generating PDFs, or processing data.
  • Run on the server, not the user’s device.
  • Can store and use secrets securely.
  • Can be called from your app’s UI or other backend processes.
Why use Edge Functions with Rocket?
Rocket writes the function code for you, prompts for required secrets, and deploys the function to Supabase directly from chat.

Create or detect a function in Rocket

Rocket automatically checks if backend logic is needed when you build features.
If a function is required and does not exist, Rocket will generate it and show a popup in chat.
You’ll see:
  • The function name and a preview of the code.
  • Fields for any required secrets.
  • A Push to Supabase button to deploy.
You can also create functions manually by asking in chat. For example:
“Create an Edge Function that sends a welcome email with Resend when a user signs up.”
Rocket will:
  • Generate the function code.
  • Prompt you to enter the Resend API key securely.
Resend API key popupResend API key popup

Rocket asking for the Resend API key when creating a welcome email function

  • Show you a Push to Supabase popup so you can deploy the function.
Rocket Edge Function popupRocket Edge Function popup

Rocket Edge Function popup with function preview, secrets field, and push button

No need to open your Supabase dashboard unless you want to view or manage functions manually.

View functions and secrets in Supabase

If you want to confirm that a function exists or review stored secrets, you can do it directly in the Supabase dashboard. View deployed functions:
Supabase Edge Functions listSupabase Edge Functions list

Supabase dashboard showing deployed Edge Functions

View secrets for functions:
Supabase secrets listSupabase secrets list

Supabase dashboard showing stored Edge Function secrets

Add secrets securely

When Rocket prompts for secrets:
  • Paste them into the secure input fields in the popup.
  • Secrets are stored in your Supabase project, not in Rocket.
  • You can rotate or update them later by asking Rocket to redeploy with the new values.

Call your function from the app

Once deployed, Rocket can wire your function into your app automatically.
You can also request specific triggers:
  • After a user action (for example, signup or button click).
  • From another backend process.
Ask Rocket to add a test button in your app so you can trigger the function safely during development.

Example: Send a welcome email

Prompt:
“Send a welcome email using Resend when a new user signs up.”
Rocket does:
  • Generates the Edge Function.
  • Requests the RESEND_API_KEY secret.
  • Shows a Push to Supabase popup so you can deploy the function.
  • Wires the signup event to call the function.

Troubleshooting

1. Function not found

What you’ll see:
Rocket or your app reports that the function does not exist.
How to fix it:
  1. Rocket will show an error popup with a Fix it button, not the standard Supabase push popup.
  2. Click Fix it. Rocket will inspect the problem and then either:
    • Repair the function code and show you a Push to Supabase popup.
    • Generate a script to push if the fix requires schema changes.
  3. If the function exists but is not working (for example, welcome emails are not being sent after signup), tell Rocket the exact problem. For example:
    “When users sign up, they are not receiving the welcome email. Please fix this.”
Rocket will check the function, apply changes, and then either show you a Push to Supabase popup or generate a script to push, depending on what is needed.

2. Push to Supabase failed

What you’ll see:
An error appears when you click Push to Supabase.
How to fix it:
  1. Read the error message in the popup.
  2. If there is a Fix it button, click it. Rocket will inspect the error and then either:
    • Repair the function code and show you a new Push to Supabase popup.
  3. Push the updated function or script as prompted.

Backend logic, deployed in minutes

Your Rocket app now runs secure server logic with Supabase Edge Functions, all created and deployed from chat.
Need help?
Email us at support@rocket.new or join our Discord community.