
Function Dev
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-codeInstalls 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- Integrations
- Journey
- Journey Agents
- Journey Ai
- Journey Auth
- Journey Deploy
- Journey Docs
- Journey Durable
- Journey Frontend
- Journey Functions
- Journey Idea
- Journey Plan
- Journey Preflight
- Journey Rag
- Journey Realtime
- Journey Rls
- Journey Schema
- Journey Storage
- Journey Submit
- Journey Substrate
- Journey Templates
- Migrations
- Payments
- Rag Dev