Skip to main content
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 infrastructure and handle secure backend logic for your app.
They’re ideal for tasks like sending emails, calling APIs, generating PDFs, or processing data.
  • Execute on the server, not the user’s device.
  • Can store and use secrets securely.
  • Can be triggered from your UI or backend processes.
Why use Edge Functions with Rocket?
Rocket writes the function code, prompts you for secrets, and deploys to Supabase—all from chat.

Create or detect a function in Rocket

Rocket auto-checks if backend logic is needed when you build features.
If a function is required and doesn’t exist, Rocket generates it and opens a chat popup.
You’ll see:
  • The function name and a code preview.
  • Input fields for any required secrets.
  • A Push to Supabase button to deploy.
You can also ask Rocket to create a function manually. For example:
“Create an Edge Function that sends a welcome email with Resend when a user signs up.”
Rocket will:
  • Write the function code.
  • Prompt for the RESEND_API_KEY.
Popup showing secure input field for Resend API key during function creation.Popup showing secure input field for Resend API key during function creation.

Resend secret prompt during Edge Function creation

  • Show a Push to Supabase popup so you can deploy the function.
Edge Function deployment popup with code preview, secret fields, and deploy button.Edge Function deployment popup with code preview, secret fields, and deploy button.

Deploy Edge Function from Rocket

No need to open the Supabase dashboard unless you want to review or manage functions manually.

View functions and secrets in Supabase

To review deployed functions or confirm stored secrets, use the Supabase dashboard. View deployed functions:
Supabase dashboard showing a list of deployed Edge Functions.Supabase dashboard showing a list of deployed Edge Functions.

Supabase: list of deployed Edge Functions

View stored secrets:
Supabase dashboard displaying secrets linked to Edge Functions.Supabase dashboard displaying secrets linked to Edge Functions.

Supabase: stored secrets for Edge Functions

Add secrets securely

When Rocket asks for secrets:
  • Paste them into the secure input fields provided.
  • The secrets are saved in Supabase, not Rocket.
  • You can update or rotate them later by asking Rocket to redeploy.

Call your function from the app

Once deployed, Rocket can automatically wire your function into your app.
You can also ask for specific triggers, such as:
  • After user actions like signups or button clicks.
  • From other backend processes.
Want to test it first?
Ask Rocket to add a test button that triggers the function safely during development.

Example: Send a welcome email

Prompt:
“Send a welcome email using Resend when a new user signs up.”
Rocket will:
  • Generate the function.
  • Request the RESEND_API_KEY.
  • Show a Push to Supabase popup.
  • Connect the function to your signup flow.

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 shows an error popup with a Fix it button.
  2. Click Fix it. Rocket will check the issue and either:
    • Repair the function and show a Push to Supabase popup.
    • Generate a script to deploy if schema changes are needed.
  3. If the function exists but doesn’t behave as expected, describe the problem clearly in chat. For example:
    “When users sign up, they are not receiving the welcome email.”
    Rocket will inspect, apply changes, and prompt you to redeploy.

2. Push to Supabase failed

What you’ll see:
An error appears when you click Push to Supabase.
How to fix it:
  1. Review the error message shown in the popup.
  2. If a Fix it button is available, click it. Rocket will:
    • Fix the function.
    • Show a new Push to Supabase popup so you can retry.
  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.