This teaches Claude how to write serverless functions for Butterbase's Deno runtime. You'll use it when you need backend logic like webhooks, scheduled jobs, or authenticated API endpoints. The guide is thorough on the critical stuff: the handler always returns a Web API Response object (not a plain JSON object, which will fail), database queries go through a parameterized RLS-aware client, and there are three trigger types (HTTP with configurable auth, cron with timezone support, and websocket events). It includes real examples for common patterns like webhook signature validation, nightly cleanup jobs, and external API proxying with environment variables. Good reference if you're building anything beyond a static frontend.

GitHub stars
532
last updated
Jun 11, 2026

Install

$ npx -y skills add butterbase-ai/butterbase-skills --skill function-dev --agent claude-code

Installs into .claude/skills of the current project.

Files

Serverless Function Development on Butterbase

Guide for developing and deploying serverless functions on Butterbase's Deno runtime. Covers handler signatures, trigger types, database access, environment variables, and testing.


1. Handler Signature

Every function exports a single handler function with this signature:

export async function handler(
  request: Request,
  context: {
    db: PostgresClient,                                  // RLS-aware DB client
    env: Record<string, string>,                         // env vars set on the function
    user: { id: string } | null,                         // present for HTTP+auth:required; null for cron
    waitUntil: (p: Promise<unknown>) => void,            // background work after Response (≤30s)
    idempotency: {
      claim: (key: string, opts?: { scope?: string; ttlSeconds?: number }) => Promise<boolean>
    }                                                    // atomic dedup for webhook retries
  }
): Promise<Response>

CRITICAL: The handler MUST return new Response() (Web API standard). Do NOT return plain objects.

Sponsors

Details

Repository
github.com/butterbase-ai/butterbase-skills
Category
Cloud & Infrastructure
License
MIT
First seen
Jun 11, 2026

More from butterbase-ai/butterbase-skills

All 39
1countbot-ai avatarweb-designcountbot-ai/countbot网页设计与部署。生成精美的单页 HTML 网页(报告、落地页、数据可视化等),支持一键部署到 Cloudflare Pages。使用 Tailwind CSS + Chart.js + Font Awesome 技术栈。当用户要求制作网页、生成报告页面、创建落地页、数据可视化展示、部署网页到线上时使用。0skills.sh installs
2daffy0208 avatarSupabase Developerdaffy0208/ai-dev-standardsBuild full-stack applications with Supabase (PostgreSQL, Auth, Storage, Real-time, Edge Functions). Use when implementing authentication, database design with R0skills.sh installs
3davila7 avatarSecurity Scanning Toolsdavila7/claude-code-templatesThis skill should be used when the user asks to "perform vulnerability scanning", "scan networks for open ports", "assess web application security", "scan wirel0skills.sh installs
4Dexploarer avatarapi-gateway-configuratorDexploarer/hyper-forgeConfigure and manage API gateways including Kong, Tyk, AWS API Gateway, and Apigee. Activates when users need help setting up API gateways, rate limiting, authe0skills.sh installs
5dotnet avatarexp-test-maintainabilitydotnet/skillsDetects duplicate boilerplate, copy-paste tests, and structural maintainability issues across .NET test suites. Use when the user asks to reduce repetition, con0skills.sh installs
6hypnguyen1209 avatarred-team-opshypnguyen1209/offensive-claudeFull red team engagement — initial access, persistence, privilege escalation, defense evasion, C2 infrastructure, EDR bypass, living-off-the-land0skills.sh installs