function-dev

Solid

Use when developing, deploying, or debugging Butterbase serverless functions, or when the user needs to add backend logic like webhooks, scheduled jobs, or custom API endpoints

API & Backend 424 stars 40 forks Updated today MIT

Install

View on GitHub

Quality Score: 88/100

Stars 20%
88
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# 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: ```typescript 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. **Correct:** ```typescript return new Response(JSON.stringify({ message: "ok" }), { status: 200, headers: { "Content-Type": "application/json" } }); ``` **Wrong (will fail):** ```typescript return { status: 200, body: "ok" }; // NOT a Response object! ``` --- ## 2. Trigger Types ### HTTP Trigger Invoke the function via an HTTP request. ```json { "trigger": {...

Details

Author
butterbase-ai
Repository
butterbase-ai/butterbase-skills
Created
1 months ago
Last Updated
today
Language
N/A
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Featured

trigger-dev

Trigger.dev expert for background jobs, AI workflows, and reliable async execution with excellent developer experience and TypeScript-first design.

39,350 Updated today
sickn33
DevOps & Infrastructure Solid

azure-functions

Build serverless applications with Azure Functions. Create HTTP triggers, queue processors, timer functions, and durable orchestrations. Use for event-driven computing, API backends, and serverless microservices on Azure.

364 Updated today
majiayu000
API & Backend Listed

backend

Designs, builds, and reviews backend systems: APIs, databases, server-side logic, authentication, file handling, webhooks, and microservices. Triggers when the user asks to build an API, design a database schema, write server-side code, set up authentication, handle file uploads, build webhooks, design microservices, optimize queries, or work with Node.js, Python, Go, Java, or any server-side technology. Also triggers proactively when reviewing backend code for performance, scalability, or correctness issues — including N+1 queries, missing indexes, connection pool exhaustion, and missing pagination. Key capabilities: layered architecture patterns (routes/controllers/services/repositories), REST design with correct HTTP status codes, UUID-based public IDs with created_at/updated_at timestamps, JWT auth with short-lived access tokens + httpOnly refresh cookies, bcrypt password hashing at cost factor 12+, centralized error handling, structured JSON logging, parameterized queries only, and background job pattern

0 Updated today
Tekkiiiii
AI & Automation Solid

journey-functions

Use as the functions build stage of the Butterbase journey. Implements the Functions section of 02-plan.md by delegating to function-dev for each function. Calls deploy_function per function; smokes each with invoke_function. Skipped if the plan has no functions.

424 Updated today
butterbase-ai
Web & Frontend Solid

fullstack-dev

Full-stack backend architecture and frontend-backend integration guide. TRIGGER when: building a full-stack app, creating REST API with frontend, scaffolding backend service, building todo app, building CRUD app, building real-time app, building chat app, Express + React, Next.js API, Node.js backend, Python backend, Go backend, designing service layers, implementing error handling, managing config/auth, setting up API clients, implementing auth flows, handling file uploads, adding real-time features (SSE/WebSocket), hardening for production. DO NOT TRIGGER when: pure frontend UI work, pure CSS/styling, database schema only.

496 Updated 1 months ago
vibeeval