Practical examples for Computer Agents Functions.
Functions are lightweight backend endpoints that export a default handler:
export default async function handler(request, context) {
return Response.json({ ok: true });
}Computer Agents wraps the handler in a managed HTTP runtime. The handler receives:
request: a standard WebRequestcontext.computerAgents: connected project resource metadatacontext.env: runtime environment variables
When a Function needs connected databases, secrets, auth modules, or agent runtimes, import the runtime helpers from the official SDK:
import { getSecretValue } from 'computer-agents/runtime/server';Each example that uses runtime helpers includes computer-agents in its package.json, so Computer Agents installs the SDK during deployment.
| Example | What it shows |
|---|---|
hello-world |
The smallest deployable function. |
database-contact-form |
Validate a form submission and write it into a connected Computer Agents database. |
secure-webhook |
Verify a signed webhook with a secret stored in a connected Secrets vault. |
agent-run-api |
Start a connected Agent Runtime from an API endpoint and return the run id. |
- Create or open a Computer Agents project.
- Create a Function resource.
- Upload one example folder as the function source.
- Connect the resources required by that example.
- Deploy the function.
Each example includes its own setup notes.