SleekSky Developers

Runtime

What your app receives

Binding Type Meaning
APP_ID text This instance's id. Set only on the platform.
CONSOLE_URL text The console, e.g. https://apps.sleeksky.com. Where people sign in: build it as `${CONSOLE_URL}/auth`, since running on its own it has a path.
SKY service binding Your app's line to the platform, on every app: the Platform API and platform services, with no key. Running on its own, your app's own stand-in (below).
PLATFORM_DOMAIN text e.g. sleeksky.app.
APP_SUBDOMAIN text The instance's address is <subdomain>.<platform domain>.
APP_PRODUCT text The SKU it was set up from.
params text Each params entry, valued by the variant.
resources, platform_bindings, secrets, vars as declared From the approved manifest.

Requests and addresses

  • Every request arrives through the platform's dispatch Worker. Your app has no address of its own.
  • Hostnames: <subdomain>.<platform domain>, <subdomain>--<label>.<platform domain> if you use sub-addresses, and verified custom domains. Your app routes its own hostnames; the platform only picks the instance.
  • Reserved paths: /_health and /_sky/*.
  • Each request carries x-sleeksite-geo: URI-encoded JSON { country, region, city, latitude, longitude } (request.cf doesn't reach apps).
  • CPU and subrequests per request depend on the customer's plan. Long work belongs in a Durable Object or ctx.waitUntil.

Edge cache

Apps whose manifest has "edge_cache": true can have responses served from the platform's edge, without your Worker running. It's opt-in per response: nothing is cached unless you ask for it.

cachednot cached, or bypasspublic, s-maxage=NVisitorPlatform edgeCached responseYour WorkerEdge cacheVisitor

To cache a response, send Cache-Control: public, s-maxage=<seconds> (up to 7 days). The platform stores it only if the status is 200, 301, 308 or 404; there's no Set-Cookie, private or no-store; Vary names nothing but Accept-Encoding; and it's under 5 MB. Browsers get your Cache-Control without s-maxage, so max-age and no-cache still decide what they do.

Requests that never use the cache: anything but GET or HEAD (a HEAD can be answered from the cache but never fills it); requests with Authorization or Range; requests with any cookie except common analytics ones (_ga, _gid, _fbp and similar); and paths under /_admin, /_api and /_sky. Signed-in people therefore always reach your app, as long as your session is a cookie.

The cache key is your app, its cache generation, the hostname, the path and the query string. Query parameters are sorted, so their order doesn't matter, and tracking tags (utm_*, fbclid, gclid, msclkid and similar) are dropped. Every other parameter stays in the key.

To clear it, call POST https://sky/api/app/cache/invalidate over env.SKY after anything that changes what visitors see (SleekSite calls it when a site is published). Your cached responses stop being used everywhere within about a minute; you don't list URLs.

Never cache anything that differs per visitor (a cart, an account page, a page showing who's signed in), or anything that must change sooner than your s-maxage unless you clear the cache when it does.

Every response to an app using the edge cache has x-sleeksky-cache: HIT, MISS or BYPASS, so you can check a URL with curl -s -o /dev/null -D - <url>. Platform staff see hit rates per app and can clear or turn off an app's cache.

Trust

POST your schedule's /_sky/… path (through the dispatch namespace)env.SKY.fetch("https://sky/api/app/…")No tokens: each side knows the other from how the call arrivesPlatform (controller)Your appPlatform (controller)Your app
  • Platform → app: the platform calls your Worker directly through the dispatch namespace, never over the internet. The dispatch Worker answers 404 to any outside request for /_sky/*, so trust whatever reaches it.
  • App → platform: the SKY binding tells the platform which app is calling. Your app can't change it. The public internet has no way in to these paths, and the outbound Worker refuses fetches to the console's host.

Endpoints your app serves

Endpoint When What it does
GET /_health always 200 {"ok":true,"version":"<release>"} once the app can serve (database reachable). Checked after every deploy; a failure rolls back.
each schedules[].path with schedules POST, on schedule: your scheduled work. Idempotent, within the plan's CPU limit.

The platform calls nothing else on your app. Owners, storage state, service changes and copies reach you through sign-in and init.

Running on its own

Your app must also run without the platform: npm run dev, or a deploy on someone's own Cloudflare account. It does that with the same code: @sleeksky/sky gives it a stand-in for SKY, an entrypoint in your own Worker that answers the same calls. Your app calls env.SKY the same way everywhere (Worker, Durable Objects, waitUntil), and never checks which one it has. New apps from npm create @sleeksky/app are set up this way.

// src/index.js
import { sky, skyInfo } from "@sleeksky/sky";        // sky(env, "/auth/token", { body }), skyInfo(env) = cached init
import { withSky } from "@sleeksky/sky/standalone";
import manifest from "../sleeksky.json";

export { Sky } from "@sleeksky/sky/standalone";       // the stand-in, as a named entrypoint
export default withSky(app, { schedules: manifest.schedules, name: manifest.name });
// wrangler.jsonc: the platform never reads it, and sets its own SKY
"services": [{ "binding": "SKY", "service": "<this worker's name>", "entrypoint": "Sky" }],
"triggers": { "crons": ["*/15 * * * *"] }
On the platform Running on its own
init from the platform app from APP_NAME (id local), services are the ones you have keys for, allowance: null, storage: "ok", managed: []
OpenRouter and DataForSEO with the platform's keys, metered The same endpoints, with your own keys (OPENROUTER_API_KEY, DATAFORSEO_LOGIN and DATAFORSEO_PASSWORD, or a keys function)
Sign-in at the console's /auth withSky serves /_sky/console/auth, which emails a sign-in link (RESEND_API_KEY, MAIL_FROM), signed with the SKY_SECRET secret. Owners are the emails in OWNER_EMAILS. With DEV_SIGNIN=1 on localhost, you're signed in straight away as an owner.
schedules called by the platform withSky runs them from the cron, aligned to the clock
/_sky/* refused from outside by the dispatch Worker Refused by withSky
Analytics read by the platform The same query rules, read with CF_ACCOUNT_ID and CF_ANALYTICS_TOKEN
Edge cache, custom domains None: cache/invalidate does nothing, domains answers 501

What differs for real (custom domains, billing) comes from init's managed, not from whether SKY is set.