Edge Functions

2 min read

Edge functions are server-side code that runs securely in the cloud for emails, payments, and third-party APIs.

Who can do this: Owners, Admins, and Editors can create, deploy, and manage Edge Functions. See Roles and Permissions for details.

What are Edge Functions?

Edge functions are server-side code that runs securely in the cloud, close to your users. They let you add functionality that can’t run in a browser – like sending emails, processing payments, connecting to third-party APIs with secret keys, or running scheduled tasks.

Think of them as your website’s “backend helpers” that handle sensitive operations securely.

Common Use Cases

Edge functions are perfect for:

  • Sending emails – Welcome emails, notifications, contact form submissions
  • Payment processing – Securely handle Stripe, PayPal, or other payment providers
  • Third-party integrations – Connect to APIs that require secret keys
  • Data processing – Transform or validate data before storing
  • Webhooks – Receive and process events from external services

Creating Edge Functions

You don’t need to write code manually. Simply describe what you need to the AI:

Example prompts:

  • “Send a welcome email when someone signs up”
  • “Create a function to process Stripe payments”
  • “Add a webhook to receive updates from Shopify”

The AI will create, configure, and deploy the edge function for you.

Managing Secrets

Edge functions often need API keys or secrets (like email service credentials). When you create a function that requires secrets:

  1. The AI will ask you for the necessary API keys
  2. You’ll be prompted to add them securely to your project settings
  3. Secrets are encrypted and never exposed in your code

Debugging with Logs

You can view real-time logs from your deployed edge functions in your project settings.

Accessing Logs

  1. Open your project settings (gear icon)
  2. Navigate to Settings → Logs
  3. View logs from all your edge functions

Filtering Logs

You can filter logs to find what you need:

  • Search – Find specific messages or errors
  • Time range – View logs from the last hour, day, or custom period
  • Severity – Filter by log level (error, warning, info)

Example Log Output

2026-02-26 14:32:01 [INFO] Function started: send-welcome-email
2026-02-26 14:32:02 [INFO] Email sent successfully to [email protected]
2026-02-26 14:32:02 [INFO] Function completed in 245ms
2026-02-26 14:35:12 [ERROR] Function failed: process-payment
2026-02-26 14:35:12 [ERROR] Stripe API error: Invalid API key

Common Debugging Scenarios

SymptomWhat to Check
Function not runningCheck if the function is deployed
“Unauthorized” errorsVerify your secrets are configured
Timeout errorsFunction may be doing too much – simplify
Missing dataCheck that input parameters are correct

Related Articles

Last updated: August 2, 2026

Was this article helpful?