Give your OpenClaw agent a serverless backend for REST APIs, webhooks, data storage, scheduled jobs, queue workers, and autonomous workflows.
OpenClaw agents run locally. That's great for privacy, but tricky when you need:
- REST APIs with automatic OpenAPI documentation
- Webhook endpoints that work when your Mac is asleep
- Persistent storage beyond local files
- Scheduled jobs that run 24/7
- Reliable integrations with Stripe, Shopify, GitHub
- Multi-step workflows that run autonomously with retries and state management
This skill gives your agent everything it needs to deploy and manage serverless backends.
Human does once:
npm install -g codehooks
coho login
coho create my-backend
coho add-admintokenGive the admin token to your agent.
Agent uses:
export CODEHOOKS_ADMIN_TOKEN="your-token-here"
coho deploy --admintoken $CODEHOOKS_ADMIN_TOKENYour agent now has a live webhook URL, database, and job runner. Codehooks has a free tier to get started, and paid plans have no extra charges for traffic or API calls.
Run this to get the complete development prompt:
coho promptThis outputs everything your agent needs to build with codehooks-js — routes, database operations, queues, jobs, workflows. Feed it into your agent's context.
macOS shortcut:
coho prompt | pbcopy- SKILL.md — The skill file for OpenClaw
- examples/ — Ready-to-use code templates
webhook-handler.js— Webhook with signature verificationdaily-job.js— Scheduled task examplequeue-worker.js— Async queue processingworkflow-automation.js— Multi-step autonomous workflows
All commands accept --admintoken $CODEHOOKS_ADMIN_TOKEN for non-interactive use. Full CLI reference
| Command | Description |
|---|---|
coho prompt |
Get full development context |
coho deploy |
Deploy code (5 seconds) |
coho info --examples |
Get endpoint URL with example API calls |
coho log -f |
Stream logs |
coho query -c <collection> -q 'field=value' |
Query database |
coho import -c <collection> --file data.json |
Import data |
coho export -c <collection> |
Export data |
import { app, Datastore } from 'codehooks-js';
import { verify } from 'webhook-verify';
// Allow webhook endpoint without JWT authentication
app.auth('/stripe-webhook', (req, res, next) => next());
app.post('/stripe-webhook', async (req, res) => {
// Verify signature using rawBody (essential for HMAC validation)
const isValid = verify('stripe', req.rawBody, req.headers, process.env.STRIPE_WEBHOOK_SECRET);
if (!isValid) {
return res.status(401).send('Invalid signature');
}
const conn = await Datastore.open();
await conn.insertOne('payments', {
event: req.body,
receivedAt: new Date().toISOString()
});
res.json({ received: true });
});
export default app.init();Workflows let your agent kick off multi-step processes that run independently:
// Agent starts a workflow
const { workflowId } = await fetch('/workflow/start', {
method: 'POST',
body: JSON.stringify({
data: taskData,
callbackUrl: 'https://my-agent/webhook' // Get notified on completion
})
}).then(r => r.json());
// Workflow runs autonomously with retries, state persistence, and error handling
// Agent gets notified via callback when doneSee examples/workflow-automation.js for a complete example.
- How to Give Your OpenClaw Agent a Backend — Blog post walkthrough
- Codehooks Documentation
- OpenAPI/Swagger Docs
- AI development prompt
- webhook-verify — Signature verification for Stripe, GitHub, Shopify, etc.
- More templates
- MCP Server
MIT
Your agent writes the code. Codehooks runs it.