Skip to content

Deployment overview

SAPA 0.1.0 is an Effect-native library with an official Cloudflare reference deployment in this repository. There is no hosted SAPA SaaS, and installing the npm package alone does not create a server.

ModelStatus in 0.1.xWhat you receive
Pure definitions and validation from @byfungsi/sapaSupportedBrowser-safe Schemas and resource-free Effect programs
Embedded durable workflowsFramework contractRequires host-supplied concrete capability Layers
Cloudflare reference deployment from sourceOfficial referenceWorker, D1, Queues, Workflows, R2, Access, assets, providers, and email
Hosted SAPA serviceNot availableNo SAPA-operated multi-tenant endpoint exists
Complete merchant-facing HTTP APINot availableProduction contracts and authentication are not yet defined
Other infrastructure targetsCustomImplement and verify every required capability contract
flowchart LR
  accTitle: Embedded SAPA deployment model
  accDescr: A merchant application imports the SAPA package and owns a composition root that provides storage and external provider capabilities to an Effect runtime.
  App["Merchant application"] -->|"imports"| Package["@byfungsi/sapa"]
  App --> Composition["Merchant-owned composition root"]
  Package --> Composition
  Composition --> Runtime["Effect runtime with concrete Layers"]
  Runtime --> Storage["Authoritative storage"]
  Runtime --> Providers["Payments, email, crypto, and downloads"]

Pure offer construction and validation need no infrastructure. Durable checkout, payments, subscriptions, access, metering, seats, credits, downloads, and licensing require the capability Layers inferred by Sapa.layer or a configured Sapa constructor.

The repository’s Cloudflare composition is currently single-installation-oriented: one stable SAPA_INSTALLATION_ID identifies the installation for its lifetime.

Do not treat the dashboard as a public API

Section titled “Do not treat the dashboard as a public API”

The reference Worker exposes operator reads protected by Cloudflare Access, a signed customer-action checkout route, and extensive sandbox-only automation routes. It does not expose a complete production merchant API for offer registration, general checkout creation, usage recording, seats, credits, licensing, or access checks. Do not couple an application to /api/admin/* or /api/sandbox/* as if they were public commerce contracts.

Continue with self-hosting, the Cloudflare reference deployment, or runtime composition.