Menu
Agent demoPlaygroundExamplesDocsFirst widgetAPI referenceWhy bundles

SVELTE EDGE

HTTP API reference

REFERENCE

HTTP API reference

API

HTTP API reference

The API is intentionally small: compile source, create bundles, and read bundles back by hash.

Limits

  • Source body: 256 KiB
  • Props query for SSR: 32 KiB
  • Svelte compiler: 5.55.5
  • Bundle URL persistence requires SVELTE_EDGE_CACHE

POST /bundles

Use this when you want a preview plus addressable outputs.

curl -sX POST https://svelte-edge.coy.workers.dev/bundles \
  -H "content-type: text/plain" \
  --data '<h1>Hello edge</h1>'

Response shape:

{
  "id": "a0d436a1c36e",
  "sourceHash": "a0d436...",
  "svelte": "5.55.5",
  "cache": { "client": "miss", "server": "miss" },
  "bundles": {
    "client": ".../client.js",
    "server": ".../server.js",
    "css": ".../style.css",
    "preview": ".../preview.html",
    "manifest": ".../manifest.json"
  },
  "sizes": { "clientJs": 281, "serverJs": 150, "css": 0 },
  "timings": { "clientCompileMs": 0, "serverCompileMs": 0 }
}

POST /compile?mode=client|server

Use this when you only need one compile output.

curl -sX POST 'https://svelte-edge.coy.workers.dev/compile?mode=client' \
  -H "content-type: text/plain" \
  --data '<button>hello</button>'

GET /bundles/<hash>/<file>

Read a generated bundle. Valid files:

  • client.js — browser component module
  • server.js — SSR compiler output
  • style.css — scoped CSS
  • preview.html — standalone iframe document
  • manifest.json — metadata

POST /render

Experimental SSR path. Useful for testing server output, but not the main embed path.

curl -sX POST 'https://svelte-edge.coy.workers.dev/render?format=html' \
  -H "content-type: text/plain" \
  --data '<h1>Hello SSR</h1>'