Edge Functions

The Edge Functions component copies the Supabase serverless functions from your source project to your target project.

What Is an Edge Function?

Edge Functions are serverless functions deployed on the Supabase infrastructure. They are written in TypeScript/Deno and run at the network edge. Examples:

  • Custom API endpoints
  • Webhook processing
  • Server-side business logic
  • Third-party integrations

What Is Copied

For each Edge Function:

  • Source code — the main TypeScript file and its dependencies
  • Name of the function
  • Deployment configuration

How It Works

  1. Twins downloads the code of each Edge Function from the source project via the Supabase API
  2. Twins deploys the code to the target project

Key Considerations

SituationBehavior
Edge Function with the same name on the targetReplaced with the source version
Environment variables (secrets)Not copied — you must reconfigure them manually on the target
External dependenciesIncluded in the downloaded code

Important: Edge Function secrets and environment variables are not cloned. If your functions use API keys, tokens, or other secrets, you must configure them manually on the target project via the Supabase dashboard or CLI.

When to Use It

  • Full project migration to a new Supabase project
  • Duplicating a project for a client or environment
  • Synchronizing functions between production and staging

When Not to Use It

  • If your Edge Functions are deployed via CI/CD — your pipeline handles this
  • If the source and target functions need to be different

Next Steps