edge-function

Scaffold Supabase Edge Functions with authentication, CORS, and Zod validation.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/120ventures/claude-skills --skill edge-function
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: edge-function
Source: https://github.com/120ventures/claude-skills/tree/main/edge-function
Command: npx skills add https://github.com/120ventures/claude-skills --skill edge-function

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Scaffold a new Supabase Edge Function with built-in authentication, CORS handling, Zod validation, and error management following 120 Ventures conventions

Core Features & Use Cases

  • Generates a ready-to-edit Supabase Edge Function skeleton at supabase/functions/$ARGUMENTS/index.ts with auth, CORS headers, and Zod validation.
  • Enforces security and architectural conventions: one function per operation, always authenticate, validate inputs, safe error messages, restricted CORS, server-side only DB access, and parameterized queries.
  • Provides a template structure and example code to accelerate building new endpoints.

Quick Start

Provide a function name when prompted and run the scaffold to generate a new edge function following the conventions.

Frequently Asked Questions about edge-function

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I scaffold a Supabase Edge Function with authentication and CORS handling?

To scaffold a Supabase Edge Function with authentication and CORS, generate a skeleton at supabase/functions/$ARGUMENTS/index.ts. This enforces one function per operation, always authenticates, validates inputs with Zod, and restricts CORS via environment variables.

What is the best way to validate input in Supabase Edge Functions?

The best way to validate input in Supabase Edge Functions is using Zod schema validation within the scaffolded template. This ensures all incoming requests are strictly validated before processing, preventing invalid data from reaching your server-side database operations.

How do I prevent data leakage in Supabase serverless functions?

To prevent data leakage in Supabase serverless functions, enforce server-side only database access and return safe error messages. The scaffolded Edge Function template applies parameterized queries to stop injection attacks and restricts exposed information.

Does the Supabase Edge Function scaffold support restricted CORS via environment variables?

Yes, the Supabase Edge Function scaffold supports restricted CORS via environment variables. It generates a template structure with built-in CORS headers, ensuring cross-origin requests are safely managed according to your specific environmental configuration.

Why should I use one function per operation in Supabase Edge Functions?

Using one function per operation in Supabase Edge Functions maintains a consistent structure across endpoints and enforces architectural conventions. This standardized approach simplifies authentication, input validation, and error management for secure serverless deployments.

Can I use Zod validation with Supabase Edge Functions for input parsing?

Yes, you can use Zod validation with Supabase Edge Functions for input parsing. The scaffolded template integrates Zod to validate incoming request payloads, ensuring that only properly formatted data reaches your server-side database access layer.