Timed JS on Zipper
Edge Functions
Edge Functions run your JS in a timed Node vm on Zipper. Use them to rewrite a response, sit in front of origin, or run on a schedule. This is not Cloudflare Workers and not a GPU. This is a Cloudflare Cloudflare Workers alternative included on every Zipper plan.
Cloudflare analogue: Cloudflare Workers
What it is
Edge Functions run your JS in a timed Node vm on Zipper. Use them to rewrite a response, sit in front of origin, or run on a schedule. This is not Cloudflare Workers and not a GPU.
Cloudflare analogue: Cloudflare Workers. SLA 99.9% · p99 18ms. Admins publish functions. Operators may pause cron.
- ▸Timed Node vm
- ▸Cron + scheduled()
- ▸Zipper env bindings
- ▸Watchtower log drain
How it works
Each function is a timed Node vm on Zipper. CPU is capped per request (default 30ms). This is not a V8 isolate farm.
Cron triggers run via POST /api/v1/functions/drain (Bearer ZIPPER_CRON_DRAIN_SECRET) or opportunistically on edge traffic. Use scheduled(event) or fetch(request).
env bindings expose zone metadata (ZONE_HOST, GATE_BASE, *_LIVE flags). console.log drains into The Watchtower when log drain is on.
PATCH /api/v1/functions/:id updates source, cron, entrypoint, or enabled without republishing under a new name.
Use cases
Concrete ways teams use this service on day one.
A/B header rewrite
Send 10% of traffic a new HTML shell.
- Publish edge-gateway with entrypoint functions/gateway.ts. Read the cookie, rewrite the response.
Nightly purge
Clear /preview/* every night.
- Publish a function with cron `15 2 * * *` and a scheduled() handler that calls the purge API.
- Cron drain: curl -X POST /api/v1/functions/drain -H "Authorization: Bearer $ZIPPER_CRON_DRAIN_SECRET".
Inbound mail hook
Run JS when mail arrives.
- Route inbound mail to function://my-handler. The function receives from, to, subject, preview in the POST body.
Set it up in the dashboard
Dashboard → Services → Edge Functions. Name, entrypoint, optional cron, source.
API
Control-plane: GET|POST|DELETE /api/v1/functions. Send Authorization: Bearer tz_live_YOUR_TOKEN.
Creates count against the plan quota. A 402 plan_limit means you are at the cap — upgrade or delete an unused resource.
Publish a function
curl -sS -X POST https://tinyzipper.com/api/v1/functions \
-H "Authorization: Bearer tz_live_YOUR_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"name":"edge-gateway","entrypoint":"functions/gateway.ts"}'Invoke by id
curl -sS -X POST https://tinyzipper.com/api/v1/functions/FUNCTION_ID/invoke \
-H "Authorization: Bearer tz_live_YOUR_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"ping":true}'Scheduled handler
export default {
async scheduled(event) {
console.log('cron tick', event.scheduledTime);
return { status: 200, body: 'ok' };
},
};List the same resource in JavaScript
const res = await fetch("https://tinyzipper.com/api/v1/functions", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.ZIPPER_TOKEN}`,
"Content-Type": "application/json"
}
});
const json = await res.json();
if (!res.ok) throw new Error(json.error ?? res.statusText);
console.log(json);Tips
Fan-out slow work to Job Queues. Do not wait on third-party HTTP inside the vm if you can enqueue.
compatibilityDate 2025-12-01 disables env bindings and scheduled(); use 2026-08-16 for the full surface.
- ▸Node vm
- ▸Global Server
Runbook
Keep CPU under budget. Fan-out scheduled work through Job Queues. Drain logs to The Watchtower. Not V8 isolates.
Next: Site Hosting · All docs · Create a free account