Swarmz

Edge Functions

Server-side code that runs close to your users

Edge functions handle work that can't happen in the browser — API routes, webhook receivers, scheduled jobs, and anything that needs secret keys.

Edge functions list

Creating a function

Describe what it should do:

Create an edge function that sends a welcome email
when a new user signs up, using Resend.

The agent writes the function, deploys it, and wires it up to the auth trigger.

Common uses

Use caseExample
API routesProcess form submissions, handle payments
WebhooksReceive events from Stripe, GitHub, or other services
Scheduled jobsNightly cleanup, weekly reports, notification digests
Server-side logicCall APIs that require secret keys

Environment variables

Store API keys and secrets as environment variables. They're available inside edge functions but never exposed to the browser or included in the frontend bundle.

Environment variables settings

On this page