On this page
  1. Good Worker starting points
  2. Runtime rules
  3. Deployment boundaries stay visible
  4. Cloudflare queue bindings

Workers

Use Playstack's Web-standard domain contracts and edge adapters in Cloudflare Workers and other constrained runtimes.

Many Playstack domain packages target Web platform primitives so they can run in Node.js and Workers without separate business logic. Worker compatibility is tested per package; Node framework adapters and provider SDK assumptions remain outside the Worker bundle.

Start with the Workers guide to compose Web Crypto and a native streaming response inside a fetch handler.

Good Worker starting points

CapabilityPackageWorker boundary
Shared errors, results, time, and operation context@playstack/coreDependency-free contracts.
Encryption, digests, signatures, and tokens@playstack/cryptoInjects globalThis.crypto; key configuration remains application-owned.
Validation@playstack/validationPortable schemas and HTTP validation errors.
Domain events@playstack/eventsIn-process bridge with application-owned durable delivery.
Authentication and accounts@playstack/auth, @playstack/accountsPortable services with injected persistence and request handling.
Rate limiting@playstack/rate-limitAtomic store contract with a Durable Object adapter.
Feeds and sitemaps@playstack/feedsNative streams, Response, and structural R2 storage.
Audit@playstack/auditAppend-only chains with application-owned storage.

Check each package reference before importing infrastructure or framework adapters. A portable core package may be Worker-compatible while one of its database or NestJS bindings is intentionally Node-only.

Runtime rules

  • Prefer Web Request, Response, ReadableStream, and crypto.subtle at the boundary.
  • Construct services once at module scope when their dependencies are safe to reuse across requests.
  • Derive request-specific operation context inside fetch and pass it into domain commands.
  • Keep secrets in Worker bindings and parse them into narrow package configuration at composition time.
  • Use Durable Objects, queues, R2, or another service through explicit structural adapters.
  • Use ctx.waitUntil() only for observational work that is safe outside the response transaction.

Deployment boundaries stay visible

Playstack does not hide Cloudflare bindings behind ambient globals. The Worker entry receives env and decides which binding satisfies each package contract. Native clients or bindings remain exposed where an application needs provider-specific capabilities.

Cloudflare queue bindings

Use @playstack/queues/cloudflare for typed producers and Worker batch handlers. Cloudflare Queues documents individual acknowledgements, bounded JSON batches, durable quarantine and explicit unsupported operations. It does not replace arbitrary ingestion payloads automatically or install a Nest worker.

Localization also runs through the portable policy/catalog boundary; choose an ICU runtime compatible with the selected Worker deployment.

Go

Playstack Pro tag
OriginsPricingBlogNewsletterChangelogStatusRoadmap
ContributorsCommunityIn Use ShowcaseCase StudiesPartnersSponsors
FAQsSupportContact

© 2026 Playstack. All rights reserved.

With OSS
Terms of ServicePrivacy PolicyCookie PolicyImprint

By

Commune Software