rate-limit-edge-function

Implement rate limiting for Supabase Edge Functions using RPC calls.

Updated May 30, 2026
One-click install
npx skills add https://github.com/buitrankimlong/thongtincty --skill rate-limit-edge-function
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rate-limit-edge-function
Source: https://github.com/buitrankimlong/thongtincty/tree/main/.claude/skills/rate-limit-edge-function
Command: npx skills add https://github.com/buitrankimlong/thongtincty --skill rate-limit-edge-function

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill adds rate limiting to sensitive Edge Functions, protecting them from abuse by repeated calls.

Core Features & Use Cases

  • Rate Limiting: Implement rate limiting on Edge Functions to prevent abuse and ensure fair usage.
  • Customizable Limits: Configure rate limits based on the function's specific requirements and usage patterns.
  • Use Case: Protect email senders, PDF generators, and admin action endpoints by setting appropriate rate limits to prevent spam and unauthorized access.

Quick Start

Set up rate limiting for your 'send-email' Edge Function with a limit of 5 requests per minute per user.

Frequently Asked Questions about rate-limit-edge-function

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

FAQPage Schema
How do I implement rate limiting for Supabase Edge Functions?

Implement rate limiting for Supabase Edge Functions by using a rate_limit_counters table and a check_and_increment_rate_limit RPC to track and restrict request frequency. This protects sensitive functions from abuse and ensures fair usage.

What's the best way to prevent abuse on my Supabase email sender Edge Function?

The best way to prevent abuse on an email sender Edge Function is to apply rate limiting using a dedicated counter table and RPC, setting a specific request limit like 5 requests per minute per user to block spam.

Does this rate limiting approach support custom request limits for different Edge Functions?

Yes, this approach supports customizable limits. You can configure rate limits based on each function's specific requirements and usage patterns, allowing you to set different thresholds for endpoints like PDF generators and email senders.

How does the check_and_increment_rate_limit RPC work with the rate_limit_counters table?

The check_and_increment_rate_limit RPC works with the rate_limit_counters table by checking the current request count for a user and incrementing it. If the count exceeds the configured limit, the system handles the rate limit violation.

When do I need rate limiting on my Supabase Edge Functions?

You need rate limiting on Supabase Edge Functions when protecting sensitive endpoints like PDF generators or admin actions from repeated calls. It prevents unauthorized access, stops spam, and ensures fair resource usage across users.