Overview
Functions run server-side code without managing servers. They’re ideal for custom business logic, webhooks, scheduled tasks, and API integrations that go beyond CRUD operations.Technology Stack
Core Components
- Deno Runtime — Secure, isolated JavaScript/TypeScript execution
- HTTP Router — Each function is an HTTP endpoint
- Secret Manager — Inject environment variables securely
- JWT Middleware — Optional authentication for functions
How It Works
- Write a function handler in JavaScript/TypeScript
- Deploy via the dashboard or MCP
- Function is available at
/api/functions/{function-name} - Supports all HTTP methods (GET, POST, PUT, PATCH, DELETE)
Function Example
Authentication Flow
Functions can optionally validate JWT tokens:- Client sends request with
Authorization: Bearer <token> - Yboard validates the JWT
- User context is injected into the request
- Function can access user ID and claims
Performance Characteristics
Execution Limits
Optimization Strategies
- Keep functions focused on a single task
- Use streaming responses for large outputs
- Cache expensive computations
- Minimize cold starts by keeping functions small
Best Practices
- Keep functions small — One function per task
- Use secrets for API keys — never hardcode credentials
- Handle errors gracefully — Return appropriate HTTP status codes
- Use TypeScript for type safety
- Test locally before deploying