diff --git a/content/(account)/api-keys.mdx b/content/(account)/api-keys.mdx index dfb59f91..dd6b2888 100644 --- a/content/(account)/api-keys.mdx +++ b/content/(account)/api-keys.mdx @@ -42,7 +42,7 @@ curl https://api.spacefast.com/v1/spaces \ -H "Authorization: Bearer sfa_xxxxxxxx" ``` -An `sfa_` key is 56 characters after the prefix. Spacefast stores only a hash of it, which is why nobody can read a key back to you, ever. +An `sfa_` key is 56 characters after the prefix. Spacefast stores only a hash of it, so nobody can show you the key again. ## Presets @@ -57,7 +57,7 @@ A preset is a named bundle of permissions. Pick the narrowest one that does the | `billing_viewer` | Billing viewer | Read team and billing information, nothing else | | `team_admin` | Team admin | Everything this team can do | -`space_publisher` and `ci_deploy` carry the same publish permissions. `space_admin` is the default when a request names no preset. It deliberately stops short of `team_admin`: it can never mint keys, manage members, or touch billing. +`space_publisher` and `ci_deploy` carry the same publish permissions. `space_admin` is the default when a request names no preset. Unlike `team_admin`, it can't create keys, manage members, or change billing. ## How permissions compile @@ -69,12 +69,12 @@ Your own browser session has no stored policy. Spacefast compiles one per team f |---|---| | `owner` | Every action (`*`) | | `admin` | Every action (`*`) | -| `member` | A fixed list: read, create, update, rename, and publish spaces; read, promote, and download versions; read domains; read, trigger, and create builds; read the team; read billing | +| `member` | A fixed list: read, create, update, rename, and publish spaces; read, promote, and download versions; read, attach, and verify domains; read, trigger, and create builds; read the team; read billing | Two rules follow from that: - **A key can never grant more than you have.** Minting a key whose policy exceeds your own is refused with `policy_exceeds_grantor`. A member cannot mint a key at all, because minting credentials is not on the member list. -- **A key follows your role, not a snapshot of it.** Keys that follow team membership pin the exact permissions they were granted, so redefining a preset later never quietly widens an existing key. +- **A key's ceiling is fixed when it's created.** A key that follows your team membership also tracks it: leaving a team ends the key's access to that team, and a role change there takes effect right away, while its access to your other teams continues. Redefining a preset later never widens or narrows an existing key. Keys created through the API can also be scoped to a single Space instead of the whole team, which narrows the policy to exactly that Space. diff --git a/content/(account)/authentication.mdx b/content/(account)/authentication.mdx index 841f1f49..6aa7fc61 100644 --- a/content/(account)/authentication.mdx +++ b/content/(account)/authentication.mdx @@ -5,7 +5,7 @@ sidebar: order: 1 --- -Creating a Spacefast account takes nothing but an email address and a six-digit code — no password required until you add one later. +To create a Spacefast account, you need an email address and the six-digit code sent to it. A password is optional, and you can add one later. ## Create an account @@ -71,7 +71,7 @@ There is no side door. Turn two-factor off, then set it up again for a fresh set Sensitive changes ask you to prove it's you again before they go through: setting or changing a password, connecting or disconnecting a provider, turning two-factor on or off, and adding, removing, or repointing account email addresses. -The screen is titled **Confirm it's you** and takes your password, an emailed code, or your authenticator code. One confirmation covers the next ten minutes. A sign-in from the last 24 hours counts as fresh already, so most of the time you never see it. +The screen is titled **Confirm it's you** and takes your password, an emailed code, or your authenticator code. One confirmation covers the next ten minutes, so several changes in a row ask only once. Signing in doesn't count as a confirmation. ## Sessions @@ -115,7 +115,7 @@ Sessions are separate from agent access. To cut off an agent or a CLI, use **Acc -Facts worth knowing about that credential: +About that credential: | Fact | Value | |---|---| @@ -124,9 +124,9 @@ Facts worth knowing about that credential: | What the CLI receives | A one-time API key, not a session | | Access lifetime | 30 days after approval | | Idle lifetime | 7 days without use | -| Where it is stored | The OS keychain on macOS and Linux, otherwise `~/.spacefast/auth.json` with `0600` permissions | +| Where it is stored | The macOS Keychain, or the Secret Service keyring on Linux when one is available. Otherwise `~/.spacefast/auth.json` with `0600` permissions | -Inside each team the credential can never do more than your own role allows there. Change your role and the same credential retunes itself on the next request. +Inside each team, the credential can't do more than your current role allows there. If your role changes, the new role applies from the credential's next request. `sf logout` deletes the local login and revokes the key when the CLI minted it. To kill it from the browser instead, revoke the connection under **Account settings → Connected apps**. diff --git a/content/(account)/billing.mdx b/content/(account)/billing.mdx index 21fe6260..ef1dee8a 100644 --- a/content/(account)/billing.mdx +++ b/content/(account)/billing.mdx @@ -5,13 +5,13 @@ sidebar: order: 3 --- -Prices, allowances and limits for every plan are on [Pricing & Limits](/pricing). This page covers managing a plan. +Manage your plan here. Prices, allowances, and limits for every plan are on [Pricing & Limits](/pricing). ## Upgrade, downgrade or cancel Open your team's **Settings → Billing** to change or cancel a plan. Only owners and admins can change billing. Choose **Open billing portal** for invoices and payment methods. -Upgrades apply immediately and prorate to the day. Downgrades apply at renewal. Cancellation stops renewal, with access continuing until the paid period ends. There are no refunds. Review the price and effective date before confirming. +Upgrades apply immediately and are prorated. Downgrades apply at renewal. Cancellation stops renewal, with access continuing until the paid period ends. There are no refunds. Review the price and effective date before confirming. ## Read the plan through the API @@ -26,7 +26,7 @@ Your Spaces keep serving through a grace period, but you cannot change anything. | Stage | How long | What visitors get | What you get | | --- | --- | --- | --- | | Past due | 7 days from the failed payment | Spaces serve normally | Reads work. Every write returns `402` with code `tenant_past_due` | -| Suspended | After the grace period ends | Every space serves `402` and the text `This space is paused.` | Reads work. Every write returns `403` with code `tenant_suspended` | +| Suspended | After the grace period ends | Every space serves `402` with a **This space is paused** page | Reads work. Every write returns `403` with code `tenant_suspended` | Settle the payment in the billing portal to restore access. API reads remain available in either state. diff --git a/content/(account)/pricing.mdx b/content/(account)/pricing.mdx index 8c751383..513499d5 100644 --- a/content/(account)/pricing.mdx +++ b/content/(account)/pricing.mdx @@ -37,7 +37,7 @@ The first two are real usage from the last 30 days. | When | Pauses | Keeps working | | --- | --- | --- | | Personal uses its $1 | New [builds](/ci) and [Workers](/functions) | Deployed Spaces: serving, compute, email | -| You reach your spending cap | New builds and Workers. Nothing above the cap is charged | Deployed Spaces | +| You reach your spending cap | New builds and Workers. Nothing above the cap is charged | Deployed Spaces, until usage reaches the serving-pause threshold, twice the cap unless you change it. Then they stop serving until you raise the cap or the month resets | | A Space hits one of its limits | That request gets a 429 ([rate limiting](/infrastructure/rate-limiting)), or that publish gets an [error](/errors) naming the limit | The rest of the Space | ## Domains @@ -64,7 +64,7 @@ Monthly, in US dollars, before tax. Plans and Boost bill at the start of the mon ### What if I upgrade or downgrade? -Upgrades apply right away, prorated to the day. Downgrades apply at renewal; anything over the new limits keeps serving but becomes read-only until it's back under. +Upgrades apply right away and are prorated. Downgrades apply at renewal; anything over the new limits keeps serving but becomes read-only until it's back under. ### Can prices change? @@ -72,7 +72,7 @@ We may change our fees going forward, in line with the [Terms of Service](https: ### Can I cap my spending? -Yes, on Go, Pro and Business. The cap starts at twice your plan price, with alerts at 50%, 75% and 100%. You're never charged above it, even if usage briefly runs past it. +Yes, on Go, Pro and Business. The cap starts at twice your plan price, with alerts at 50%, 80% and 100%. You're never charged above it, even if usage briefly runs past it. ### Do you have nonprofit or education pricing? diff --git a/content/(account)/usage.mdx b/content/(account)/usage.mdx index c44e74a9..24c68011 100644 --- a/content/(account)/usage.mdx +++ b/content/(account)/usage.mdx @@ -5,7 +5,7 @@ sidebar: order: 4 --- -Allowances, unit prices and what each meter counts are on [Pricing & Limits](/pricing). This page covers reading your current usage. +Check your current usage here. Allowances, unit prices, and what each meter counts are on [Pricing & Limits](/pricing). ## Read current usage @@ -23,11 +23,11 @@ Two endpoints return the numbers those pages draw. `GET /v1/teams/{teamId}/usage | --- | --- | --- | --- | | Spaces | `spaces` | Live spaces in the team | Blocks at the plan limit. `409` `quota_exceeded` | | Custom domains | `domains` | External domain groups against the plan quota | Blocks. `409` `domain_quota_exceeded` | -| Team members | `members` | Billable seats, live members plus pending invitations | Blocks at the plan limit. `409` `team_member_quota_exceeded` | +| Team members | `members` | Billable team members | Blocks at the plan limit. `409` `team_member_quota_exceeded` | | Storage | `storageBytes` | Disk your spaces occupy | Displayed only. Nothing blocks | -| Publishes | `deploysToday` | Publishes since the UTC day started, your pushes and CI builds pooled | Warns only. Publishing continues | +| Publishes | `buildsDeploysToday` | Publishes and builds since the UTC day started, pooled | Warns only. Publishing continues | -The response also carries `storageQuotaBytes`, `storageOverageBytes`, `deploysDaily`, and `meterStartedAt` so you can compute headroom and know when the metering day rolled over. +The response also carries `storageQuotaBytes`, `storageOverageBytes`, `buildsDeploysDaily`, and `buildsDeploysThisMonth`, so you can compute headroom. ### Current per-space measurements diff --git a/content/(concepts)/design-system.mdx b/content/(concepts)/design-system.mdx index 8af92263..c711eccf 100644 --- a/content/(concepts)/design-system.mdx +++ b/content/(concepts)/design-system.mdx @@ -20,7 +20,7 @@ You can also add the standards yourself in the dashboard. **Look & feel** holds Use **Brand files** to upload logos, images, fonts, and source documents. After uploading, edit **How to use** to tell your agent where and when a file belongs. A filename alone cannot do that job. -Each upload must be no larger than 25 MB. Files stay in the team's private Media Library. Accepted SVG files are sanitized on upload, so check the saved artwork. An agent must download needed files and put visitor-facing assets in the project's source; private file URLs do not belong in a live page. +Each upload can be up to 100 MB. Files stay in the team's private Media Library. Accepted SVG files are sanitized on upload, so check the saved artwork. An agent must download needed files and put visitor-facing assets in the project's source; private file URLs do not belong in a live page. ## Apply it to a project diff --git a/content/(concepts)/spaces.mdx b/content/(concepts)/spaces.mdx index 65bb3ab4..bf095c85 100644 --- a/content/(concepts)/spaces.mdx +++ b/content/(concepts)/spaces.mdx @@ -70,12 +70,13 @@ To move a Space to another team, run `sf spaces transfer --space docs`, o ## Sharing when you create one -A new team-owned Space starts at one of two presets. A Space published without an account has no owning team. Its space key and claim link open it until the claim window ends; see [Publish without an account](/anonymous-and-claim). +A new team-owned Space starts at one of three presets. A Space published without an account has no owning team. Its space key and claim link open it until the claim window ends; see [Publish without an account](/anonymous-and-claim). | Preset | Who can open the live Space | | --- | --- | | `private` | The owning team, plus anyone you add | | `public` | The owning team, plus anyone on the web | +| `parent_team` | The owning team, plus everyone in its parent team. Needs subteams, which are on Enterprise | The API still accepts `team` and treats it as `private`. @@ -133,7 +134,7 @@ What changes: - The old slug stays reserved for this Space. - Version URLs do not move. They were computed once and stored. -One thing blocks a rename. While `name` is set in your `sf.jsonc`, the API refuses to rename the Space — the file would win back the old name on the next publish. Remove the key or rename it in the file. See [Config file](/config-file). +One thing blocks a rename. While `name` is set in your `sf.jsonc`, the API refuses to rename the Space, because the next publish would set the old name again. Remove the key or rename it in the file. See [Config file](/config-file). ## Deleting and restoring diff --git a/content/(concepts)/teams.mdx b/content/(concepts)/teams.mdx index ce4d8ae2..f8eb61df 100644 --- a/content/(concepts)/teams.mdx +++ b/content/(concepts)/teams.mdx @@ -12,7 +12,7 @@ A team owns its Spaces, domains, API keys, and billing. Your role in that team c Personal and Go allow only the owner. Adding another member needs [Pro](/pricing). Members on Pro: {{plan-team-members-pro}}. - **Publish together.** Members can create Spaces, publish new versions, and roll back. The Space stays with the team when a member leaves. -- **Keep access in one place.** Invite someone to the team to give them access to team-owned work at their role. Remove them to take that access away across the team's Spaces. Set the default access for each new Space to `private` or `public`. +- **Keep access in one place.** Invite someone to the team to give them access to team-owned work at their role. Remove them to take that access away across the team's Spaces. Set the access each new Space starts with. - **Separate routine work from administration.** Members can publish, while owners and admins manage invitations, domains, and billing. The [role table](#roles) shows the full boundary. ## What a team is @@ -47,7 +47,8 @@ Three roles, and the one you hold in a team caps everything you do there, whethe | Read domains | Yes | Yes | Yes | | Read billing and usage | Yes | Yes | Yes | | Delete a Space or a version, export, import | Yes | Yes | No | -| Add, verify, or assign domains and DNS | Yes | Yes | No | +| Attach a domain to a Space and verify it | Yes | Yes | Yes | +| Detach or buy domains, change DNS | Yes | Yes | No | | Team variables and webhooks | Yes | Yes | No | | Transfer a Space to another team | Yes | Yes | No | | Change billing | Yes | Yes | No | @@ -107,8 +108,9 @@ To hand the team over, use **Team settings → Danger zone → Transfer ownershi |---|---| | `private` | Access for the owning team | | `public` | Access for the owning team, plus view access for anyone on the web | +| `parent_team` | Access for the owning team, plus view and comment access for everyone in its parent team. Needs subteams, which are on Enterprise | -The default is `private`. The API accepts `team` as a legacy spelling of `private`. From a terminal, `sf teams defaults` prints the current value and `sf teams defaults public` sets it. Per-Space access, share links, and passwords are covered in [Spacefast Share](/share). +The default is `private`. From a terminal, `sf teams defaults` prints the current value and `sf teams defaults public` sets it. Per-Space access, share links, and passwords are covered in [Spacefast Share](/share). ## Move a Space to another team diff --git a/content/(concepts)/versions.mdx b/content/(concepts)/versions.mdx index e54bcb1c..c1fad8c4 100644 --- a/content/(concepts)/versions.mdx +++ b/content/(concepts)/versions.mdx @@ -1,11 +1,11 @@ --- title: Versions and the live channel -description: Immutable versions, the live channel, promotion policies, and rollback to a retained ready version without rebuilding +description: Immutable versions, the live channel, promotion policies, and rollback to a retained ready version sidebar: order: 2 --- -A rollback doesn't rebuild anything. It repoints `live` at a retained, ready version; deleted or expired versions cannot be rollback targets. +A rollback points `live` back at a retained, ready version and doesn't rebuild it. By default it applies your current rewrites, which makes a new version from that version's files. Deleted or expired versions cannot be rollback targets. ## A version is a snapshot @@ -48,21 +48,21 @@ A channel has a promotion policy. On a manual channel an ordinary publish comes back with `activation.outcome` of `unpromoted` and `reason` `channel_promotion_manual`. Nothing failed. The version is ready and waiting for an explicit promote. ```bash -sf channels ls --space docs +sf channels list --space docs sf channels set live --promotion manual --space docs ``` ## Promote and roll back -Promoting points `live` at a ready version. That is the whole operation. No files move, nothing is rebuilt, and the previous version keeps its own URL. +Promoting points `live` at a ready version. A newer version goes live as saved. An older one is a rollback: by default it applies your current rewrites to that version's files, which makes a new version and puts that live. Pass `--no-refresh-rewrites` (API: `refreshRewrites: false`) to make the older version live exactly as saved. Either way, the previous version keeps its own URL. -Rolling back is the same operation aimed backwards. There is no separate rollback mechanism, and no rebuild happens either way. The dashboard says it plainly: **Takes effect in seconds. Nothing is rebuilt.** +Rolling back is the same operation, pointed at an older version. ```bash -sf versions ls --space docs +sf versions list --space docs sf rollback v12 --space docs sf promote v14 --space docs ``` @@ -119,7 +119,7 @@ All of them. Ready versions stay until you delete them, on every plan. To delete one: ```bash -sf versions rm v12 --space docs +sf versions delete v12 --space docs ``` A version the `live` channel points at cannot be deleted, and neither can one a branch hostname serves. Promote something else first. The refusal is `version_in_use` and names what is holding it. @@ -143,9 +143,9 @@ To browse rather than diff, [`listSpaceVersionFiles`](/api/reference/versions/li | Task | CLI | Dashboard | | --- | --- | --- | -| List versions | `sf versions ls` | **Versions** | +| List versions | `sf versions list` | **Versions** | | Inspect one | `sf versions inspect v12` | A version row, then the detail page | | Make one live | `sf promote v12` | **Make live** | | Go back | `sf rollback v12` | **Roll back to** on Overview | -| Delete one | `sf versions rm v12` | Version detail page | -| Change promotion policy | `sf channels set live --promotion manual` | Not in the dashboard | +| Delete one | `sf versions delete v12` | Version detail page | +| Change promotion policy | `sf channels set live --promotion manual` | **Publishing** on **Versions**: **Automatic** or **Manual** | diff --git a/content/(dynamic)/database.mdx b/content/(dynamic)/database.mdx index a77a1fc0..b8099b70 100644 --- a/content/(dynamic)/database.mdx +++ b/content/(dynamic)/database.mdx @@ -5,7 +5,7 @@ sidebar: order: 2 --- -There's no connection string for this database — your code reaches it through `ctx.db` or `env.DB`, or through a single-use SQL console when you need raw SQL. +This database has no connection string. Your code reaches it through `ctx.db` or `env.DB`, or through a single-use SQL console when you need raw SQL. :::note[Don't have a database yet?] For [Zero](/zero-runtime), start with `sf init --runtime zero`, or add the full [runtime block](/zero-runtime#declare-it) to `sf.jsonc`, including `kind: "zero"`, `server`, and `client` entry paths. The server file is required; Zero can generate a client shell. Publish the app before querying its live database. A [Functions](/functions#what-is-on-env) worker also gets a database through `env.DB`, but the Zero table commands do not apply to it. @@ -18,7 +18,7 @@ Every Space that runs [Zero](/zero-runtime) gets one database, the MySQL that li You do not create it, size it, or connect to it. Your capsule declares the tables. The platform applies the migration when a version finalizes. :::warning[There is no external connection string] -No route, flag, or dashboard field returns a DSN, and none is coming. Your code reaches the database through `ctx.db` (Zero) or `env.DB` (Functions). For everything else there is the SQL console below. +No route, flag, or dashboard field returns a DSN. Your code reaches the database through `ctx.db` (Zero) or `env.DB` (Functions). For everything else there is the SQL console below. ::: ## Query it from code @@ -115,10 +115,10 @@ sf db dump --table notes --limit 100 ```bash sf db export -sf db export docs --out ./docs-backup.json +sf db export docs --output ./docs-backup.json ``` -`sf db export` walks every declared table in stable keyset pages of 500 rows and writes one JSON file. Without `--out` the file is `spacefast-backup--.json`. +`sf db export` walks every declared table in stable keyset pages of 500 rows and writes one JSON file. Without `--output` the file is `spacefast-backup--.json`. The write is atomic and mode `0600`. If the export fails part-way, an existing destination is left exactly as it was. @@ -180,7 +180,7 @@ Until the space runs a Zero app or a worker, the Database page shows **Database | Databases per Space | 1 | | `sf db dump --limit` | 1 to 100, default 25 | | Export page size | 500 rows, fixed | -| Field types you can declare | `string()`, `boolean()`, `id("table")` | +| Field types you can declare | `string()`, `number()`, `boolean()`, `userId()`, `id("table")` | | Reserved column names | `id`, `createdAt`, `updatedAt` | | Reserved index name | `by_creation` | diff --git a/content/(dynamic)/environment-variables.mdx b/content/(dynamic)/environment-variables.mdx index 35b238a0..7c2c3d94 100644 --- a/content/(dynamic)/environment-variables.mdx +++ b/content/(dynamic)/environment-variables.mdx @@ -23,9 +23,9 @@ Platform-provided `SPACEFAST_*` values also appear in reads, marked as system sc ```bash sf env set STRIPE_PUBLISHABLE_KEY pk_live_123 sf env set STRIPE_SECRET_KEY --value-from-stdin < ./key.txt -sf env ls -sf env ls --show-values -sf env rm STRIPE_SECRET_KEY +sf env list +sf env list --show-values +sf env remove STRIPE_SECRET_KEY ``` Pass the value as an argument or read it from stdin, never both and never neither. Stdin strips one trailing newline, and an empty stdin is an error. @@ -109,7 +109,8 @@ export default capsule({ A [Functions](/functions) worker reads the same values from `env`, its second handler argument. -`.env.lakebed.server` is accepted as an alias for capsule portability. +`.env.lakebed.server` is also accepted, for capsule portability. That file is treated as the full list: publishing also deletes Space-scope variables it doesn't name, even when the file is empty. + An anonymous first publish, before you have an account, syncs nothing and reports `skipped: "anonymous"`. @@ -143,10 +144,10 @@ sf env import .env --from vercel --no-secret `sf env import` reads a dotenv file and sends one write per entry, in file order. It strips a BOM and a leading `export `, and skips blank and `#` lines. It also requires quotes to close and strips an inline `#` outside quotes. A later duplicate overwrites an earlier one. A missing `=` or an empty value is an error naming the line. `--from` accepts `dotenv`, `vercel`, `netlify`, and `cloudflare`, which all export dotenv files. ```bash -sf env export-template +sf env template ``` -`sf env export-template` is fully local and makes no API call. It reads `package.json`, `vercel.json`, `netlify.toml`, and `wrangler.toml` from a directory and writes a dotenv template of the names those platforms expect. +`sf env template` is fully local and makes no API call. It reads `package.json`, `vercel.json`, `netlify.toml`, and `wrangler.toml` from a directory and writes a dotenv template of the names those platforms expect. ## Dashboard @@ -161,6 +162,7 @@ Team variables live at **Variables** in the team nav. Space variables live at ** | [`deleteSpaceVariable`](/api/reference/variables/deletespacevariable) | `DELETE /v1/spaces/{spaceId}/variables/{name}` | | [`listTeamVariables`](/api/reference/variables/listteamvariables) | `GET /v1/teams/{teamId}/variables` | | [`setTeamVariable`](/api/reference/variables/setteamvariable) | `PUT /v1/teams/{teamId}/variables/{name}` | +| [`deleteTeamVariable`](/api/reference/variables/deleteteamvariable) | `DELETE /v1/teams/{teamId}/variables/{name}` | Each mutation returns a possibly-null `operation` handle for the debounced re-finalize it coalesced into. diff --git a/content/(dynamic)/object-storage.mdx b/content/(dynamic)/object-storage.mdx index 58681a11..c87dc306 100644 --- a/content/(dynamic)/object-storage.mdx +++ b/content/(dynamic)/object-storage.mdx @@ -5,13 +5,13 @@ sidebar: order: 5 --- -Storage holds files uploaded by a running app, separate from published version files. Each object has a 32-character hexadecimal id; its returned read URL also carries a read key. +Storage holds files uploaded by a running app, separate from published version files. Each object has a 32-character hexadecimal id. Objects are private unless uploaded as public. ## What it is Storage holds files a running app uploaded, not the files you published. Only a Space with a runtime app has it. Version files are a different thing and live in [Publishing](/publish). -An object is addressed by a bare 32-character hexadecimal id. There is no key, no path, and no visibility flag. The id is the identity. +An object is addressed by a bare 32-character hexadecimal id. There is no key or path. The id is the identity. Uploads are private by default; set `public` at upload time to make an object readable by visitors. | Field | Notes | | --- | --- | @@ -22,9 +22,10 @@ An object is addressed by a bare 32-character hexadecimal id. There is no key, n | `sha256` | Content digest | | `uploaderId` | Who uploaded it | | `createdAt` | Timestamp | -| `url` | Path-relative, `/__stattic/u/?k=` | +| `public` | Whether visitors can read it | +| `url` | Path-relative. `/__stattic/u/?k=` for a public object, the authenticated `/storage/` path for a private one | -`url` is path-relative and carries the read key current at the time of the response. Absolutize it against whichever of the space's hostnames you are serving from. +A public object's `url` carries the read key current at the time of the response. Absolutize it against whichever of the space's hostnames you are serving from. `filename` is presentation only. Path separators, control characters, `.`, and `..` are refused rather than stripped, so the value you send is the value that comes back. @@ -36,7 +37,7 @@ The client SDK is the upload path for a [Zero](/zero-runtime) app. import { storage } from "@spacefast/zero/client"; async function onFile(file: File) { - const object = await storage.upload(file); + const object = await storage.upload(file, { public: true }); console.log(object.id, object.url); } ``` @@ -45,7 +46,7 @@ async function onFile(file: File) { | Method | Returns | | --- | --- | -| `upload(file: Blob)` | `{ id, contentType, size, url }` | +| `upload(file: Blob, options?: { public?: boolean })` | `{ id, public, contentType, size, url }`. Private unless `public: true` | | `get(id: string)` | A `Response`, or `null` | | `delete(id: string)` | Nothing | @@ -53,7 +54,7 @@ In local `sf dev`, uploads live in memory. ## Upload from the API -The request body is the file itself. The `Content-Type` header becomes the object's content type, and `?filename=` sets the display name. +The request body is the file itself. The `Content-Type` header becomes the object's content type, `?filename=` sets the display name, and `?public=true` makes the object public. Without it, the object is private. ```bash curl -X POST "https://api.spacefast.com/v1/spaces/$SPACE_ID/storage?filename=receipt.pdf" \ @@ -64,25 +65,26 @@ curl -X POST "https://api.spacefast.com/v1/spaces/$SPACE_ID/storage?filename=rec A successful upload answers `201`. -## List and delete +## Upload, list, and delete from the CLI ```bash +sf storage put receipt.pdf --content-type application/pdf sf storage -sf storage ls -sf storage ls --limit 100 -sf storage ls --cursor -sf storage rm 0f3a2c19b74e4d0f8c6e5a2b1d9f4c73 +sf storage list --limit 100 +sf storage list --cursor +sf storage download 0f3a2c19b74e4d0f8c6e5a2b1d9f4c73 +sf storage delete 0f3a2c19b74e4d0f8c6e5a2b1d9f4c73 ``` -`sf storage` and `sf storage ls` do the same thing. When there is another page, the output ends with a `Next cursor:` line to pass back through `--cursor`. +`sf storage` and `sf storage list` (alias `ls`) do the same thing. When there is another page, the output ends with a `Next cursor:` line to pass back through `--cursor`. -`sf storage rm` confirms first. The id must be the 32-character id the list prints. A prefixed value like `private/` is refused. Delete is idempotent, so removing an object that is already gone prints ` was already gone.` rather than failing. +`sf storage delete` confirms first. The id must be the 32-character id the list prints. A prefixed value like `private/` is refused. Delete is idempotent, so removing an object that is already gone prints ` was already gone.` rather than failing. -There is no `sf storage upload`. Uploads go through the client SDK, the API, or the dashboard. +`sf storage put` uploads a private object unless you pass `--public`. `sf storage download` saves to `--output` or a file named after the id, and never overwrites an existing file. ## Dashboard -Open **Storage** for the space. It has a **Choose files to upload** input and an **Upload files** button. It also prints the per-file limit inline. Deleting asks first, because it removes the object for every visitor. +Open **Storage** for the space. It has a **Choose Files** picker and an **Upload Files** button. It also prints the per-file limit inline. Deleting asks first, because it removes the object for every visitor. ## Limits @@ -113,4 +115,4 @@ Listing needs the `versions:read` scope. As the Space owner you can delete any o ## Next steps -See [CLI storage](/cli/storage) for upload, list, and download commands. +See [CLI storage](/cli/storage) for every flag. diff --git a/content/(dynamic)/wordpress.mdx b/content/(dynamic)/wordpress.mdx index 8457f5ee..90ba858a 100644 --- a/content/(dynamic)/wordpress.mdx +++ b/content/(dynamic)/wordpress.mdx @@ -5,7 +5,7 @@ description: Every Space runs a WordPress behind its static files. Run WP-CLI ag Every Space includes a WordPress install behind its published files. Reach it through `sf wp` or its published Abilities. -Your published files serve in front of WordPress, so a static Space never touches it and never pays for it. It is there because it is what makes a Space more than a bucket: [Zero](/zero-runtime) apps run on it, [Storage](/object-storage) is its media library, and [Database](/database) is its MySQL. This page covers the two ways to reach that WordPress directly. +Your published files are served in front of WordPress, so a static Space never uses it or pays for it. WordPress runs the dynamic features: [Zero](/zero-runtime) apps run on it, [Storage](/object-storage) is its media library, and [Database](/database) is its MySQL. You can reach it directly in two ways. ## `sf wp` @@ -21,7 +21,7 @@ Everything after `sf`'s own flags is handed to `wp` unchanged. `--format=csv` ab ### The `--` rule -`sf` stops claiming flags at the first token that is not one of its own, and `--` ends the argument outright. So a `wp` flag can never collide with an `sf` flag by accident. A `wp` command that genuinely needs `--path` or `--space` is still reachable — just put it after `--` or after any positional. +`sf` stops claiming flags at the first token that is not one of its own, and `--` ends the argument outright. So a `wp` flag can't collide with an `sf` flag by accident. To pass `--path` or `--space` to `wp`, put it after `--` or after any positional argument. ```bash sf wp -- --version @@ -48,7 +48,7 @@ The host runs WP-CLI as a job and does not return its output; only success or fa Run with --local against a local WordPress to see what the command prints. ``` -When you need the bytes, run the same command locally, or reach for `sf db` and the database console. +When you need the bytes, run the same command locally, or use `sf db` and the database console. ```bash sf wp --local --path ./wordpress core version @@ -132,7 +132,7 @@ Send the token to the Space in `X-SF-Authorization`, never in `Authorization`: ```bash curl -X POST \ - https://my-site.view.fast/wp-json/wp-abilities/v1/abilities/zero/storage-list/run \ + https://my-site.space.fast/wp-json/wp-abilities/v1/abilities/zero/storage-list/run \ -H "X-SF-Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "perPage": 20 }' diff --git a/content/(dynamic)/zero-runtime.mdx b/content/(dynamic)/zero-runtime.mdx index f3998ae0..04f49d0d 100644 --- a/content/(dynamic)/zero-runtime.mdx +++ b/content/(dynamic)/zero-runtime.mdx @@ -34,13 +34,13 @@ Zero is never inferred. A runtime that owns a database does not spring into exis The fastest way to get that file plus a working app is the scaffold. ```bash -sf init my-app --runtime zero --template todo +sf init my-app --runtime zero cd my-app sf dev sf publish ``` -`--template` accepts `todo`, `guestbook`, or `contact`. The client entry is optional on disk. If no file backs it, the build generates a shell and the capsule is server-only. The server entry is not optional. +The client entry is optional on disk. If no file backs it, the build generates a shell and the capsule is server-only. The server entry is not optional. ## What you get @@ -62,7 +62,7 @@ The scaffold's `package.json` pins the package to the compiler's own version. No | --- | --- | --- | | `@spacefast/zero/server` | `server/` | `capsule`, `query`, `mutation`, `action`, `endpoint`, `table`, field constructors, response helpers | | `@spacefast/zero/client` | `client/` | `useQuery`, `usePaginatedQuery`, `useMutation`, `useAction`, `useAuth`, `storage`, `Router` and friends | -| `@spacefast/zero/kit` | `client/` | The component set: `Button`, `Card`, `Input`, `Dialog`, `Table`, and about 30 more | +| `@spacefast/zero/kit` | `client/` | The component set: `Button`, `Card`, `Input`, `Dialog`, `Table`, and about 40 more | | `@spacefast/zero/charts` | `client/` | `LineChart`, `BarChart`, `Sparkline`, `StatTile` | `action`, `useAction`, and the `actions` capsule field require compiler 0.5.0 or later. @@ -173,10 +173,10 @@ Only three source roots are read: `client/`, `server/`, and `shared/`. Beyond th | Limit | Value | | --- | --- | | Server bundle | 768 KiB | -| Client bundle, your code and your npm packages | 8 MiB | +| Client bundle, your code and your npm packages | 24 MiB | | Server imports | `@spacefast/zero/server`, `preact`, `preact/jsx-runtime`, `preact/jsx-dev-runtime` | | Client imports | Anything except the server SDK and `node:*` built-ins | -| Endpoint request body | 2 MiB | +| Endpoint request body | 1 MiB | | Rejected everywhere | `eval`, `Function`, `require()`, dynamic `import()`, `process`, `__dirname`, `__filename`, `Bun`, `Deno` | | Rejected in `server/` and `shared/` | `window`, `document`, `localStorage`, `WebSocket`, `Worker`, `XMLHttpRequest`, `globalThis` | diff --git a/content/(publish)/anonymous-and-claim.mdx b/content/(publish)/anonymous-and-claim.mdx index ff4e8009..362b63d7 100644 --- a/content/(publish)/anonymous-and-claim.mdx +++ b/content/(publish)/anonymous-and-claim.mdx @@ -34,7 +34,7 @@ The key is returned once, at creation, and once more if you rotate it. The CLI c CLI and MCP receipts include the preview URL, claim link, and message for you to relay. CI masks these links. The separate Space key is never printed on its own. -The claim link is a fragment URL on purpose. Browsers never send a fragment to a server, so the key reaches the claim page without being logged anywhere in between. +The key is in the claim link's URL fragment. Browsers don't send fragments to servers, so the key reaches the claim page without being logged on the way. From the dashboard, **Drop** does the same thing while signed out. The eyebrow reads **Anonymous drop · Claim it later**, and the result carries a **Claim this space** button. diff --git a/content/(publish)/ci.mdx b/content/(publish)/ci.mdx index 56161074..18b8e5f2 100644 --- a/content/(publish)/ci.mdx +++ b/content/(publish)/ci.mdx @@ -87,7 +87,7 @@ publish: -The CLI needs Node.js 20.3 or newer. `sf publish` waits by default, but a successful command can leave a version ready without making it live. Check the receipt's activation outcome, especially for previews or a manual promotion policy. +The CLI needs Node.js 22.19 or newer. `sf publish` waits by default, but a successful command can leave a version ready without making it live. Check the receipt's activation outcome, especially for previews or a manual promotion policy. ## What `CI` changes @@ -95,13 +95,13 @@ GitHub Actions and GitLab CI both set `CI` for you, and a truthy `CI` puts the C | Change | Detail | | --- | --- | -| `--json` is appended | Every command prints `{ data }` on stdout, `{ error }` on stderr. Passing `--json` yourself is redundant, and worth writing anyway so the pipeline reads the same locally | -| Prompts are off | The CLI never asks a question it cannot get an answer to | -| `--yes` is still yours | Agent mode never implies it | +| `--json` is appended | Every command prints `{ data }` on stdout, `{ error }` on stderr. Pass `--json` anyway so the command behaves the same when you run it locally | +| Prompts are off | The CLI doesn't prompt | +| `--yes` is not implied | Agent mode doesn't add it | -That last one bites. A destructive command in CI without `--yes` fails with `confirmation_required` and exit code 2, every time. Add `--yes` to the command that needs it rather than setting it globally. +A destructive command in CI without `--yes` fails with `confirmation_required` and exit code 2. Add `--yes` to the command that needs it rather than setting it globally. -Credentials also behave differently under `CI`. The plaintext credential store is the default there, so a locked or absent OS keyring never wedges a job. +Credentials also behave differently under `CI`. The plaintext credential store is the default there, so a locked or missing OS keyring doesn't block a job. ## Version provenance @@ -129,7 +129,7 @@ A preview on an existing Space refuses `--name`, `--mode`, and a non-`auto` `--s ## Reading the receipt -The fields worth branching on in a script: +The fields a script usually checks: | Field | Use | | --- | --- | @@ -143,4 +143,4 @@ A publish whose files reproduce the live version byte for byte creates no versio ## Rate limits -Publishing is capped per hour, per credential and per account, with the numbers set by your plan. A pipeline that publishes on every push to a busy repository can reach them. A `429` carries `Retry-After` in seconds. See [Rate limits](/api/rate-limits). +Publishing is capped per hour, both per person or API key and per account, with the numbers set by your plan. A pipeline that publishes on every push to a busy repository can reach them. A `429` carries `Retry-After` in seconds. See [Rate limits](/api/rate-limits). diff --git a/content/(publish)/frameworks.mdx b/content/(publish)/frameworks.mdx index 838b6a19..ab984c41 100644 --- a/content/(publish)/frameworks.mdx +++ b/content/(publish)/frameworks.mdx @@ -32,8 +32,8 @@ Detection uses this table for both paths. The output directory column is what to | Framework | Detected by | Default build command | Output directory | | --- | --- | --- | --- | -| Nextra | `nextra` dependency | `next build` | `out` | -| [Next.js](/recipes/next) | `next` dependency | `next build` | `out` | +| `vinext` | `vinext` dependency, unless the build script runs `next build`. If `next` is also installed, the build script must run `vinext build`, `vinext deploy`, or `vinext export` | `vinext build` | `dist/client` | +| [Next.js](/recipes/next) | `next` or `nextra` dependency | `next build` | `out` | | TanStack Start | `@tanstack/react-start` dependency | package script | `dist/client` | | Nuxt | `nuxt` dependency | `nuxt generate` | `.output/public` | | [Astro](/recipes/astro) | `astro` dependency or `astro.config.*` | `astro build` | `dist` | @@ -119,7 +119,7 @@ printf %s "$TOKEN" | sf env set BUILD_TOKEN --value-from-stdin --space docs Secrets are redacted from build logs. Every non-empty resolved value becomes a redaction string, along with its base64 and URI-encoded forms, so a value that gets encoded mid-build still comes out masked. What Spacefast stores about a variable on the build is its name, a hash of the value, whether it is secret, and which scope it came from. Never the value. -Two variables are injected for you, and only on builds that are not going to `live`, and only when you have not defined them yourself: +Two variables are injected for you on builds that target no channel, such as platform preview builds, when you have not defined them yourself: | Variable | Value | | --- | --- | @@ -149,7 +149,7 @@ A build whose output is byte-identical to the live version succeeds without mint ```bash -sf builds ls --space docs +sf builds list --space docs sf builds logs bld_7c3e0a19d84b42f0916d5ac8b7e21f34 --follow ``` @@ -184,7 +184,7 @@ Logs are capped at 500 entries and 512 KiB per build. Past that the oldest entri | Per-phase timeout | 180 seconds | | Build output archive | 512 MiB by default | -Your build commands are never retried automatically. A crashed run fails the build deterministically instead of silently running your commands a second time. Only infrastructure failures that happen before the build starts are requeued, at most twice. +Spacefast doesn't retry your build commands. If a run crashes, the build fails instead of running your commands again. Only infrastructure failures that happen before the build starts are requeued, at most twice. Retrying is explicit and makes a **new** build, linked back to the original and reusing its exact input and settings snapshot. @@ -224,13 +224,13 @@ export default defineConfig({ }); ``` -Same routing conventions as the Astro integration, plus a check that the build is actually publishable. `mode` defaults to `static`, and a static build with no `.html` file anywhere in the output fails rather than deploying a blank site. `mode: "spa"` writes an `/index.html` fallback for `/*` instead. A `build.ssr` config is refused outright unless you pass `allowSsrBuild`. Needs Vite 6 or newer. TanStack Start has its own entry point at `@spacefast/vite-plugin/tanstack-start`. +Same routing conventions as the Astro integration, plus a check that the build can be published. `mode` defaults to `static`, and a static build with no `.html` file anywhere in the output fails rather than deploying a blank site. `mode: "spa"` writes an `/index.html` fallback for `/*` instead. A `build.ssr` config is refused outright unless you pass `allowSsrBuild`. Needs Vite 6 or newer. TanStack Start has its own entry point at `@spacefast/vite-plugin/tanstack-start`. ### `@spacefast/next-adapter` -Wired for you. When `sf publish` runs `next build` on Next 16.2 or 16.3, it points Next at the bundled adapter through `NEXT_ADAPTER_PATH`, so there is nothing to add to `next.config`. The adapter opts the build into immutable static assets and writes down what Next produced for the classifier to read. +Wired for you. When `sf publish` runs `next build` on Next 16.4, it points Next at the bundled adapter through `NEXT_ADAPTER_PATH`, so there is nothing to add to `next.config`. The adapter opts the build into immutable static assets and writes down what Next produced for the classifier to read. -The adapter runs on Next 16.2 and 16.3, the releases with the `experimental.adapterPath` hook it needs. Server-rendered builds also work on Next 15.5.24 and later 15.5 releases without the adapter. Other releases from 14.2 through 16.4 build only with `output: "export"`. See the [Next.js recipe](/recipes/next) for the full table. +Automatic builds accept Next 16.4.5 and later 16.4 releases, which use the adapter, and Next 15.5.29 and later 15.5 releases, which build without it. Other releases are refused. See the [Next.js recipe](/recipes/next) for the export fallback. ## Next steps diff --git a/content/(publish)/git.mdx b/content/(publish)/git.mdx index b82d249d..b2805a85 100644 --- a/content/(publish)/git.mdx +++ b/content/(publish)/git.mdx @@ -7,9 +7,9 @@ sidebar: Keep your source in Git and publish from a Spacefast remote or a connected GitHub repository. Connected repository pushes queue builds only when auto-deploy is enabled for that branch; deleting a branch does not build it. -Two lanes. The Spacefast remote needs no external host and no app install. A GitHub connection keeps your repository where it is and reacts to its webhooks. +There are two ways to connect. The Spacefast remote needs no external Git provider and no app install. A GitHub connection keeps your repository where it is and reacts to its webhooks. -The `sf git` and `sf source` command families name the same two connection types in different words — on purpose, not a typo. +The `sf git` and `sf source` command families use different names for the same two connection types. ## Source and deployment files @@ -34,7 +34,7 @@ Spacefast hosts a Git endpoint. `sf git origin` mints a signed remote and instal ```bash - sf builds ls + sf builds list ``` Or open **Builds** for the Space. @@ -56,7 +56,7 @@ Treat that URL as a secret. It expires, and the `sf git origin` receipt reports sf git connect --space docs --provider github --repository owner/repo --production-branch main --sync ``` -GitHub connections resolve their installation and repository ids from your GitHub App installations, so `--repository owner/repo` is enough. When several installations grant the same repository, pass `--installation-id` to pick one. +GitHub connections resolve their installation and repository ids from your GitHub App installations, so `--repository owner/repo` is enough. When several installations grant the same repository, pass `--installation` to pick one. | Flag | Default | What it does | | --- | --- | --- | @@ -66,7 +66,6 @@ GitHub connections resolve their installation and repository ids from your GitHu | `--production-branch` | none | The branch that publishes to production | | `--default-branch` | none | The repository's default branch | | `--credential` | none | A clone token for a generic host, stored encrypted | -| `--detect-urls` / `--no-detect-urls` | on | Reads clone and upstream URLs from the `origin` remote | | `--auto-deploy-production` / `--no-…` | on | Builds pushes to the production branch | | `--auto-deploy-previews` / `--no-…` | on | Builds preview branches and pull requests | | `--apply-best` | off | Detects and saves the highest-ranked build settings after connecting | @@ -106,7 +105,7 @@ sf git build --space docs --ref main --target production --wait The platform builds your repository and publishes the output. It detects the framework and fills in the commands, so an unconfigured repository usually works. -Detected presets include Astro, Next, Nuxt, SvelteKit, Remix, TanStack Start, Vite, Solid Start, Qwik, Angular, Ember, Gatsby, Docusaurus, Eleventy, VitePress, Nextra, Hugo, Jekyll, Zola, MkDocs, and Sphinx. See [Frameworks](/frameworks). +Detected presets include Astro, Next, Nuxt, SvelteKit, Remix, TanStack Start, Vite, Solid Start, Qwik, Angular, Ember, Gatsby, Docusaurus, Eleventy, VitePress, Hugo, Jekyll, Zola, MkDocs, and Sphinx. See [Frameworks](/frameworks). Override any of it in `sf.jsonc` or on the connection. @@ -129,7 +128,7 @@ Every run appears under **Runs** on the Builds page, and a run's detail view car From the CLI: ```bash -sf builds ls +sf builds list sf builds logs bld_123 --follow ``` diff --git a/content/(publish)/migrate-from/vercel.mdx b/content/(publish)/migrate-from/vercel.mdx index ef41d8fe..22649825 100644 --- a/content/(publish)/migrate-from/vercel.mdx +++ b/content/(publish)/migrate-from/vercel.mdx @@ -64,9 +64,8 @@ A Spacefast cron is a scheduled `GET` against a path on your own Space, like a V | Next.js | What runs | | --- | --- | -| 16.2.x, 16.3.x | Server-rendered builds, through the adapter `sf publish` wires in for you | -| 15.5.24 and later 15.5 releases | Server-rendered builds | -| 14.2, 15.0 to 15.5.23, 16.0, 16.1, 16.4 | `output: "export"` only | +| 16.4.5 and later 16.4 releases | Server-rendered builds, through the adapter `sf publish` wires in for you | +| 15.5.29 and later 15.5 releases | Server-rendered builds | Other versions are refused before anything builds. The [Next.js recipe](/recipes/next) has the details and the export fallback. diff --git a/content/(publish)/publish.mdx b/content/(publish)/publish.mdx index 27199e93..55a5f106 100644 --- a/content/(publish)/publish.mdx +++ b/content/(publish)/publish.mdx @@ -1,6 +1,6 @@ --- title: Publishing -description: What one sf publish actually does, which files it sends, how change-only uploads work, and what the receipt tells you +description: What one sf publish does, which files it sends, how change-only uploads work, and what the receipt tells you sidebar: order: 1 --- @@ -64,17 +64,17 @@ Publishing walks the directory and builds a manifest. Three things can happen to ### Dropped without complaint -Some paths are never worth failing a whole publish over, so they are dropped and counted instead. Exact names at any depth: +Some paths are dropped and counted instead of failing the publish. Exact names at any depth: ```text .DS_Store .gitignore .npmrc .netrc .env .env.local .env.production .env.development .env.test -_routes.json .spacefast/state.json .stattic/state.json +_routes.json .spacefast/state.json .spacefast/space.json .stattic/state.json ``` -Whole directories at any depth: `.git`, `.hg`, `.svn`, `.ssh`, `.aws`, `.cache`, `.turbo`, `.vercel`, `.netlify`, `.wrangler`, `node_modules`, and `.next/cache`. +Whole directories at any depth: `.git`, `.hg`, `.svn`, `.ssh`, `.aws`, `.cache`, `.turbo`, `.vercel`, `.netlify`, `.wrangler`, `.zero`, `node_modules`, `.next/cache`, and `__MACOSX`. -Anything that looks like a credential is dropped the same way: names starting `.env.`, SSH private keys (`id_rsa`, `id_ed25519`, and friends), files named like a private key, and any `.pem`, `.key`, `.p12`, or `.pfx`. +Anything that looks like a credential is dropped the same way: `.env`, `.envrc`, and `.dev.vars`, plus those names with a dot suffix such as `.env.local` or `.dev.vars.production` (a name like `.dev.vars-backup` is not dropped), SSH keys (`id_rsa`, `id_ed25519`, and friends), files named like a private key, and any `.pem`, `.key`, `.p12`, or `.pfx`. Symlinks are skipped, not followed. The CLI prints `Warning: skipped symlink (symlinks are not published).` for each one. @@ -89,11 +89,11 @@ These fail the publish rather than getting dropped, because silently ignoring th | Untrimmed, starting `/`, containing `\` or `//`, or not canonical | `invalid_file_path` | | A segment ending in `.` or a space | `invalid_file_path` | | Canonical path over 1,024 bytes | `path_too_long` | -| Named `.htaccess` or `.user.ini` | `static_control_file_not_supported` | +| Named `.htaccess`, `.user.ini`, or `spacefast.config.ts` | `static_control_file_not_supported` | | Under a runtime control prefix, such as a top-level `__sf` or `__spacefast` | `static_runtime_control_path_not_supported` | | Two entries that canonicalize to the same path | `manifest_duplicate_path` | -Two artifacts claiming the same request route also stop the publish, so a lookup-order coin flip never decides which one visitors get. +Two artifacts that claim the same request route also stop the publish, so visitors never get an arbitrary one of them. ### Size and count @@ -117,7 +117,7 @@ Every declared file carries a `sha256`. The server compares your declaration aga { "upload": 3, "reused": 41, "ignored": 0 } ``` -Deleting a file means leaving it out of the declaration. There is no delete list. That has one consequence worth knowing: +Deleting a file means leaving it out of the declaration. There is no delete list, which has one consequence: | Mode | What your file list means | | --- | --- | @@ -136,7 +136,7 @@ noop_publish That diagnostic is the only signal. There is no separate boolean. -One catch. A file declared without a `sha256` cannot prove it is unchanged, so a manifest missing any hash always materializes a new version. +A file declared without a `sha256` can't be shown to be unchanged, so a manifest missing any hash always creates a new version. ## Waiting, or not @@ -148,7 +148,7 @@ On the CLI it is `--wait` (on by default), `--no-wait`, and `--wait-timeout` in ## Reading the receipt -The parts you actually read: +The fields you'll use most: | Field | What it tells you | | --- | --- | @@ -208,7 +208,7 @@ An archive that needs a build returns a receipt with a `build` object and `next. | `slug_reserved`, `slug_unavailable` | The slug you asked for is taken or held | Take the `details.suggestion` | | `space_selection_conflict` | You passed both a Space and a creation-only flag such as `--access` | Drop the creation flag | -Every code, with whether it is worth retrying, is on [Error codes](/api/errors). +Every code, and whether to retry it, is on [Error codes](/api/errors). ## Next steps diff --git a/content/(publish)/recipes/astro.mdx b/content/(publish)/recipes/astro.mdx index 0f85f9d0..e3002ffc 100644 --- a/content/(publish)/recipes/astro.mdx +++ b/content/(publish)/recipes/astro.mdx @@ -54,7 +54,7 @@ export default defineConfig({ ## The gotcha -The integration's `failOnRoutingError` defaults to `true`. A malformed line in `_redirects` or `_headers` stops `astro build` with an error rather than shipping a site whose routing quietly does nothing. That is the point of it, but it does mean adding the integration can break a build that used to pass. Set `failOnRoutingError: false` to downgrade it to a log line while you fix the file. +The integration's `failOnRoutingError` defaults to `true`. A malformed line in `_redirects` or `_headers` stops `astro build` with an error instead of shipping a site whose routing silently doesn't work. This means adding the integration can break a build that used to pass. Set `failOnRoutingError: false` to downgrade it to a log line while you fix the file. The integration needs Astro 6 or newer. Everything else on this page works on any Astro version, because publishing `dist` is a file upload. diff --git a/content/(publish)/recipes/next.mdx b/content/(publish)/recipes/next.mdx index f0c806e6..33edabdd 100644 --- a/content/(publish)/recipes/next.mdx +++ b/content/(publish)/recipes/next.mdx @@ -3,21 +3,20 @@ title: Next.js description: Build a Next.js app with the bundled Spacefast adapter, or publish a static export from an older Next --- -Next.js is detected by its `next` dependency. A project that also depends on `nextra` matches the Nextra row instead, which builds and outputs the same way. +Next.js is detected by its `next` or `nextra` dependency. ## What to build -The default `next build`. On Next 16.2 and 16.3, the CLI first points Next at the bundled `@spacefast/next-adapter` through the `NEXT_ADAPTER_PATH` environment variable, so there is nothing to add to `next.config`. The adapter opts the build into immutable static assets and writes down what Next produced for the classifier to read. +The default `next build`. On Next 16.4, the CLI first points Next at the bundled `@spacefast/next-adapter` through the `NEXT_ADAPTER_PATH` environment variable, so there is nothing to add to `next.config`. The adapter opts the build into immutable static assets and writes down what Next produced for the classifier to read. ## Supported Next versions | Next.js | Server-rendered build | `output: "export"` | | --- | --- | --- | -| 16.2.x, 16.3.x | Yes, through the bundled adapter | Yes | -| 15.5.24 and later 15.5 releases | Yes | Yes | -| 14.2, 15.0 to 15.5.23, 16.0, 16.1, 16.4 | No | Yes | +| 16.4.5 and later 16.4 releases | Yes, through the bundled adapter | Yes | +| 15.5.29 and later 15.5 releases | Yes | Yes | -Only stable releases count; canary and other prerelease versions are refused. +Every other release is refused, including canary and other prerelease versions. Older floors are refused because they have published security advisories. ## The output directory @@ -42,15 +41,13 @@ Published: https://quiet-harbor.space.fast ## The gotcha -Both refusals fail with this code: +A refused version fails with this code: ```text next_version_unsupported ``` -A version outside the table stops before anything builds. A server-rendered config on an export-only version runs `next build` first, then stops once the CLI sees the output is not an export. Both exit with code 2. There is no guessing fallback, because a publish classified from guessed facts is worse than a refused one. - -On an export-only version, set `output: "export"` and let `sf publish` build it. On an unsupported version, do the export yourself and upload it: +It stops before anything builds and exits with code 2. On an unsupported version, do the export yourself and upload it: ```js next.config.js module.exports = { output: "export" }; @@ -61,4 +58,4 @@ npx next build sf publish ./out --prebuilt ``` -One related failure mode on Next 16.2 and 16.3. If a custom build command runs `next build` in a way that loses the environment the CLI set, the adapter never runs. The publish then stops with `build_failed`, saying `.spacefast/next-build.json` was not written. Let the CLI invoke the build, or pass its environment through your wrapper. +One related failure mode on Next 16.4. If a custom build command runs `next build` in a way that loses the environment the CLI set, the adapter never runs. The publish then stops with `build_failed`, saying `.spacefast/next-build.json` was not written. Let the CLI invoke the build, or pass its environment through your wrapper. diff --git a/content/(publish)/recipes/vite.mdx b/content/(publish)/recipes/vite.mdx index 5c3c872e..bcc1da6a 100644 --- a/content/(publish)/recipes/vite.mdx +++ b/content/(publish)/recipes/vite.mdx @@ -57,6 +57,6 @@ For a single-page app, say so: spacefast({ mode: "spa" }); ``` -That writes an `/index.html` fallback for `/*` into the output, and then checks the fallback file actually exists. A `build.ssr` config is refused outright unless you pass `allowSsrBuild`. +That writes an `/index.html` fallback for `/*` into the output, and then checks that the fallback file exists. A `build.ssr` config is refused outright unless you pass `allowSsrBuild`. The plugin needs Vite 6 or newer. TanStack Start has its own entry point at `@spacefast/vite-plugin/tanstack-start`. More on [Frameworks and builds](/frameworks). diff --git a/content/(publish)/wordpress-data-sources.mdx b/content/(publish)/wordpress-data-sources.mdx index e4e7a511..f403a43d 100644 --- a/content/(publish)/wordpress-data-sources.mdx +++ b/content/(publish)/wordpress-data-sources.mdx @@ -3,7 +3,7 @@ title: Build from a WordPress site description: Point a Space's repository build at a public WordPress site, read its content over the REST API during the build, and publish the static output --- -Data sources only reach repository builds — a folder publish, or a local `sf publish` of a built directory, never sees them. +Data sources only reach repository builds. A folder publish, or a local `sf publish` of a built directory, doesn't get them. A data source is a public WordPress site a build reads content from. Nothing is copied into the Space and nothing is written back. The platform hands the build a URL and a source map. Your build code fetches over the WordPress REST API, and the output publishes like any other static build. @@ -83,7 +83,7 @@ Two variables are injected into every repository build on a Space that has at le | `WORDPRESS_URL` | The default source's canonical URL | | `SPACEFAST_DATA_SOURCES` | JSON: `{"dataSources":{"":{"kind":"wordpress","url":"..."}},"defaultDataSource":""}` | -Your own build variables win. Defining `SPACEFAST_DATA_SOURCES` yourself, or the older spelling `SPACEFAST_DATASOURCES`, suppresses the generated map entirely and no `WORDPRESS_URL` is injected either. Defining `WORDPRESS_URL` alone overrides just the default URL and leaves the map intact. Set them with `sf env set`, described in [Frameworks and builds](/frameworks). +Your own build variables win. Defining `SPACEFAST_DATA_SOURCES` yourself suppresses the generated map entirely and no `WORDPRESS_URL` is injected either. Defining `WORDPRESS_URL` alone overrides just the default URL and leaves the map intact. Set them with `sf env set`, described in [Frameworks and builds](/frameworks). The source map is serialized with names in bytewise order, so the value is stable across builds that changed nothing. diff --git a/content/(reference)/config-file.mdx b/content/(reference)/config-file.mdx index 5ee467e0..43138c50 100644 --- a/content/(reference)/config-file.mdx +++ b/content/(reference)/config-file.mdx @@ -1,6 +1,6 @@ --- title: Project config reference -description: Every key the project config accepts in spacefast.config.ts or sf.jsonc, how the CLI finds the file, and which defaults the finalizer actually computes +description: Every key the project config accepts in spacefast.config.ts or sf.jsonc, how the CLI finds the file, and which defaults Spacefast computes sidebar: order: 1 --- diff --git a/content/(reference)/glossary.mdx b/content/(reference)/glossary.mdx index 5e9aa0e0..b5feb5dc 100644 --- a/content/(reference)/glossary.mdx +++ b/content/(reference)/glossary.mdx @@ -29,15 +29,15 @@ The drag-and-drop publish flow at [drop.fast](https://drop.fast): drag a folder, ## Functions -The runtime for shipping a worker alongside your Space — npm packages, framework server output, outbound HTTP. The other option, alongside [Zero](#zero), for Spaces that need more than static files. See [Functions](/functions). +The runtime that runs a server worker next to your Space, with npm packages, framework server output, and outbound HTTP. It and [Zero](#zero) are the two options for Spaces that need more than static files. See [Functions](/functions). ## Grant -One rule in a Space's access list: it names an audience (public, team, one person, a link, a password, a machine, or an external identity) and what that audience can do. A Space has no public-or-private flag — its access is just the sum of its grants. See [Spacefast Share](/share). +One rule in a Space's access list: it names an audience (public, team, one person, a link, a password, a machine, or an external identity) and what that audience can do. A Space has no public or private switch. Its grants alone decide who can reach it. See [Spacefast Share](/share). ## Live (the live channel) -The pointer that selects the version served at the live URL. Promoting or rolling back moves it to a retained, ready version without rebuilding. Publishing can build a new version; preview publishes and manual promotion policies leave `live` unchanged. See [Versions and the live channel](/versions). +The pointer that selects the version served at the live URL. Promoting or rolling back points it at a retained, ready version without running a build. Moving it to an older version applies your current rewrites by default, which makes a new version from that version's files. Publishing can build a new version; preview publishes and manual promotion policies leave `live` unchanged. See [Versions and the live channel](/versions). ## Space diff --git a/content/(reference)/limits.mdx b/content/(reference)/limits.mdx index cc34f0b7..8862c054 100644 --- a/content/(reference)/limits.mdx +++ b/content/(reference)/limits.mdx @@ -28,7 +28,8 @@ See [Versions](/versions#how-many-versions-are-kept) for version cleanup. | Bandwidth per space per day | 100 GiB | Measured hourly and recorded | | Inline publish archive | 128 MiB | `publish_archive_too_large` | | Archive compression ratio | 100:1 | `publish_archive_compression_ratio_exceeded` | -| Archive expanded size | 2 GiB | `publish_archive_expanded_size_exceeded` | +| Inline archive expanded size | 2 GiB, the version limit | `publish_archive_expanded_size_exceeded` | +| Build output | 512 MiB | The build fails | | File path length | 1,024 bytes | `path_too_long` | | Manifest body | 16 MiB | `manifest_body_too_large` | | `sf.jsonc` file size | 256 KiB | Config validation error | @@ -107,4 +108,4 @@ Publishing, building, and creating spaces carry their own hourly budgets that sc Read the rate-limit headers and the error's retry information for the active budget. These safeguards are separate from the plan allowances above. -Full rate limit behavior, including what happens when the accounting backend is down, is on the [Rate limits](/api/rate-limits). For what each error code means and whether it is worth retrying, see [Error codes](/api/errors). +Full rate limit behavior, including what happens when the accounting backend is down, is on the [Rate limits](/api/rate-limits). For what each error code means and whether to retry it, see [Error codes](/api/errors). diff --git a/content/(serve)/caching.mdx b/content/(serve)/caching.mdx index 63704215..bb9477c0 100644 --- a/content/(serve)/caching.mdx +++ b/content/(serve)/caching.mdx @@ -4,26 +4,27 @@ description: Default cache policies for public static files, header overrides, r sidebar: { order: 4 } --- -Republish to request a fresh response from the edge. Public static files use two default cache policies, with exceptions for protected responses, conditional routing, and header overrides. +Public static files use one of three default cache policies. Protected responses, conditional routing, and header overrides change that. To get a fresh response from the edge, republish. -## Two policies +## Default policies Public static files use these defaults unless a header override or a [no-cache rule](#responses-that-are-never-cached) applies. | Policy | `Cache-Control` | | --- | --- | | Immutable | `public, max-age=31536000, immutable` | -| Everything else | `public, s-maxage=600, max-age=0, must-revalidate` | +| HTML | `public, s-maxage=600, max-age=0, must-revalidate` | +| Every other file | `public, s-maxage=86400, max-age=0, must-revalidate` | -The second one is worth reading closely. `max-age=0` means the browser revalidates on every load, and the ETag turns that revalidation into a 304 when nothing changed. `s-maxage=600` means shared caches hold a copy for ten minutes. So a visitor sees a new publish immediately once the shared copy is refreshed, and never serves a stale page out of their own browser cache. +In the last two, `max-age=0` makes the browser revalidate on every load, and the ETag turns that revalidation into a 304 when nothing changed. Shared caches keep HTML for ten minutes and other files for a day. A visitor's browser never serves a stale page from its own cache. Visitors see a new publish as soon as the shared copy refreshes. -**HTML gets the second policy, together with ordinary assets.** There is no separate HTML rule. +**HTML always gets the ten-minute policy**, so a missed purge never leaves a page stale for long. ## Which files are immutable A file gets the one-year immutable policy when either of these is true. -**Its name carries a content hash.** Detection is deliberately strict, so a rename does not accidentally freeze a file for a year. +**Its name carries a content hash.** Detection is strict, so a file with a version number or date in its name isn't cached for a year by mistake. | Filename | Immutable | Why | | --- | --- | --- | @@ -35,7 +36,7 @@ A file gets the one-year immutable policy when either of these is true. **Or it sits under a known build output directory** and is not `.html`, `.htm`, `.php`, `.txt` or `.xml`. Those directories are `_next/static/`, `_app/immutable/`, `_nuxt/`, `_astro/`, and `_spacefast/platform/`. -A build that emits unhashed filenames gets the ten-minute shared policy on everything. That is correct behavior for it, not a misconfiguration, but hashed filenames are what make repeat visits cheap. +Outside those directories, a file with an unhashed name gets the one-day shared policy. That works, but hashed filenames make repeat visits faster. A precompressed sidecar such as `app.js.gz` is served at its own literal URL and is never selected as the answer for `app.js`. @@ -60,44 +61,44 @@ Publish warns with `header_cache_control_platform_managed`, because the header y | Any URL a conditional routing rule touches | `no-store` | | The 405 page | `no-store` | -The non-GET rule is absolute. The shared cache in front of a Space keys on host, path and query without reading the method, so a cacheable answer to a `POST` could be replayed to a `GET`. +The non-GET rule has no exceptions. The shared cache in front of a Space keys on host, path, and query and ignores the method, so a cached answer to a `POST` could be replayed to a `GET`. ## Vary is not part of the cache key The edge keys a stored response on **host, path, and query**. It does not read `Vary`. -That single fact explains a behavior that surprises people. A routing rule with a `Country=`, `Language=`, `Cookie=` or `Agent=` condition would otherwise let one visitor's response reach the next visitor. So any URL a conditional rule touches is forced to `no-store` for everyone, whether the condition matched or not. +Because of this, a routing rule with a `Country=`, `Language=`, `Cookie=`, or `Agent=` condition could send one visitor's response to the next visitor. To prevent that, any URL a conditional rule touches is `no-store` for everyone, whether the condition matched or not. -If a page needs to differ by country, language or client, give each variant its own URL rather than one URL with a condition on it. That keeps the whole set shared-cacheable. +If a page needs to differ by country, language, or client, give each variant its own URL instead of putting a condition on one URL. Then every variant can be cached. ## What a publish does -Activating a new version repoints the Space's hostnames at it and purges the edge for every hostname the Space serves on. Purging is **whole-host**. There is no way to purge one URL, because the cache key includes the query string and an enumerated purge could not name every variant a page lives under. +Activating a new version points the Space's hostnames at it and purges the edge for every hostname the Space serves. Purges clear a **whole hostname**. You can't purge one URL, because the cache key includes the query string and a purge can't list every query a page might be requested with. -Immutable version hostnames are deliberately not purged. Their bytes never change. +Immutable version hostnames aren't purged, because their content never changes. -The purge is a best-effort accelerator, not the correctness mechanism. The ten-minute shared lifetime is the backstop, so the worst case for a page whose purge did not land is that it refreshes within ten minutes. +A purge can fail. If it does, HTML still refreshes within ten minutes and other files on the one-day policy within a day, when the shared copy expires. Files on the one-year policy, including unhashed files under the build output directories above, can stay stale for up to a year. -For the browser, a publish changes nothing that needs waiting on. `max-age=0` means every navigation revalidates, so a returning visitor picks up the new version on their next request. Files whose names carry a content hash are the exception, and they do not need invalidating: a new build emits new names. +Browsers don't need a purge. `max-age=0` makes every navigation revalidate, so a returning visitor gets the new version on their first request after the shared copy refreshes. Hashed files and files under the build output directories above are cached for a year. A new build gives changed hashed files new names, but an unhashed file in one of those directories keeps its URL, so browsers can keep the old copy. Rename it when its content changes. ## Getting a fresh response - A publish purges every serving hostname. This is the normal answer. + A publish purges every serving hostname. This is usually all you need. - + Every response carries `X-Spacefast-Runtime: 1`, and `X-Spacefast-Version` names the version that answered. ```bash - curl -sI https://my-site.view.fast/ | grep -i x-spacefast + curl -sI https://my-site.space.fast/ | grep -i x-spacefast ``` Add a unique query parameter. The query is part of the cache key, so `?cachebust=1` is a different entry. ```bash - curl -sI "https://my-site.view.fast/?cachebust=$(date +%s)" + curl -sI "https://my-site.space.fast/?cachebust=$(date +%s)" ``` diff --git a/content/(serve)/customization.mdx b/content/(serve)/customization.mdx index fdd33ac3..4f19f437 100644 --- a/content/(serve)/customization.mdx +++ b/content/(serve)/customization.mdx @@ -3,21 +3,21 @@ title: Customization description: Theme the pages Spacefast draws, set the title and image links unfurl with, add an analytics tag, and run one site-wide script --- -Everything you set here lives on the Space, not a version — it survives every publish, and it wins over whatever `theme` or `meta` your `sf.jsonc` declares. +Customization settings are saved on the Space, not on a version, and they override the `theme` and `meta` in your `sf.jsonc`. -Open the Space and go to **Customization**. Four tabs, in order: **Theme**, **Search & sharing**, **Google Analytics**, and **Custom JS**. A large live preview sits beside the controls, labelled **Visitor sees**, painted from your unsaved draft. +Open the Space and go to **Customization**. It has four tabs: **Theme**, **Search & sharing**, **Google Analytics**, and **Custom JS**. A preview labeled **Visitor sees** shows your unsaved changes beside the controls. ## What lives on the Space, not the version -Everything on this page is stored on the Space rather than on a version, so it survives a publish and a rollback alike. It also wins over the published `sf.jsonc`: the Space's `theme` replaces the file's rather than merging with it. So a project that sets `theme` in its config, then edits Theme here, keeps seeing the dashboard's answer until you clear it. The same holds for `meta`. +Because these settings are stored on the Space, they stay in place through publishes and rollbacks. They also override the published `sf.jsonc`: the Space's `theme` replaces the file's `theme` instead of merging with it. If your config sets `theme` and you also edit the Theme tab, the dashboard values win until you clear them. The same applies to `meta`. -Theme and share metadata apply without republishing. Save, and the next request gets them. **Custom JS** is the exception, and its own field note says so: a script change takes effect on the next publish. +Theme and share metadata apply without republishing: the next request after you save gets them. **Custom JS** is different. A script change takes effect on the next publish. -Everything the four tabs write is `meta`, `theme`, and `superpowers` in the Space's config. The same keys are documented in the [`sf.jsonc` reference](/config-file), and the [`updateSpace`](/api/reference/spaces/updatespace) operation is what the dashboard calls. +The four tabs write `meta`, `theme`, and `superpowers` in the Space's config. The same keys are documented in the [`sf.jsonc` reference](/config-file), and the [`updateSpace`](/api/reference/spaces/updatespace) operation is what the dashboard calls. ## Theme -Blank means the platform default. The tab's own lead says everything here is optional and suggests starting with an accent. +Every field is optional. A blank field uses the platform default. | Group | Field | Config key | What it does | | --- | --- | --- | --- | @@ -32,19 +32,19 @@ Colors accept hex, `rgb()`, `rgba()`, `hsl()`, `hsla()`, and CSS color names, up ### The background pins the color scheme -Leave **Background** blank and the pages follow each visitor's device, light or dark. The field's default note says exactly that. +With **Background** blank, pages follow each visitor's device setting, light or dark. -Set it, and it stops following. Spacefast reads the color you gave, decides whether it is light or dark, and serves that one scheme to everyone. The field flips to **Pinned.**, with a line saying the color reads as dark or light so every visitor gets that scheme. It also shows **Clear to follow visitors again**. The preview's Auto/Light/Dark switcher is replaced by a locked **Pinned · Dark** or **Pinned · Light** chip, because there is no longer anything to simulate. +Set a background and Spacefast decides whether that color is light or dark, then serves that one scheme to every visitor. The field shows **Pinned.** and a **Clear to follow visitors again** option. In the preview, a locked **Pinned · Dark** or **Pinned · Light** label replaces the Auto/Light/Dark switcher. ### Check the branding entitlement The dashboard enables badge removal when the team has the branding entitlement or the Space used badge removal before the new plans took effect. Other Spaces need the entitlement. -The gate is enforced at publish too. Publishing a version whose effective theme sets `hideSpacefastBranding` without either allowance fails with `hide_spacefast_branding_not_entitled` and the message "theme.hideSpacefastBranding is not included on this plan." +Publishing checks this too. Publishing a version whose effective theme sets `hideSpacefastBranding` without either allowance fails with `hide_spacefast_branding_not_entitled` and the message "theme.hideSpacefastBranding is not included on this plan." ### Code override -A page your version ships as its own file is not repainted by these controls. The preview badges it **Code override.** and says the page ships from that file, with a hint pointing at `_pages/.html`. See [Layout, theme, and site pages](/site-pages). +These controls don't restyle a page that your version ships as its own file. The preview marks that page **Code override.** and points at its `_pages/.html` file. See [Layout, theme, and site pages](/site-pages). ## Search and sharing @@ -57,7 +57,7 @@ What a browser tab, a link unfurl, and a search result show. | **Social image** | `meta.image` | 2000 characters | | **Favicon** | `meta.favicon` | 2000 characters | -The Title help text reads "Browser tabs, link unfurls, and search results." The Social image note says 1200 × 630 fills the card exactly, with placeholder `/og.png`. Favicon takes an upload or a path, placeholder `/favicon.ico`. A value longer than what previews show appends ", cut off in most previews" under the field rather than refusing it. +A 1200 × 630 social image fills the card exactly. Favicon takes an upload or a path. A value longer than most previews can show is still saved, with a note under the field that it will be cut off. **Import from a live page** under **Shortcut** pulls title, description, and image from a page you have already published. Give it a path and press **Fetch**. @@ -69,22 +69,22 @@ The **Google Analytics** tab holds two cards, **Google Analytics** and **Google | Card | Field | Config key | Accepted | | --- | --- | --- | --- | -| Google Analytics | **Measurement ID** | `superpowers.googleAnalytics.measurementId` | `G-` followed by 4 or more letters or digits | -| Google Tag Manager | **Container ID** | `superpowers.googleTagManager.containerId` | `GTM-` followed by 4 or more letters or digits | +| Google Analytics | **Measurement ID** | `superpowers.googleAnalytics.measurementId` | `G-`, `GT-`, `AW-`, `DC-`, or `UA-`, then letters or digits joined by single `_` or `-` | +| Google Tag Manager | **Container ID** | `superpowers.googleTagManager.containerId` | `GTM-`, then letters or digits joined by single `_` or `-` | -An id that does not match is refused on save with "Enter a valid GA4 measurement ID." or "Enter a valid web container ID.", and the card's badge reads **Invalid ID**. A card with its switch off reads **Off** and says nothing is sent until you turn it on. With it on and the id valid, the badge reads **Enabled** and the field note becomes "This tool loads on every published page." +Saving an ID that doesn't match fails, and the card shows **Invalid ID**. A card with its switch off shows **Off** and sends nothing. With the switch on and a valid ID, the card shows **Enabled** and the tag loads on every published page. ### Page enhancements has to be on first -Analytics and custom code both ride the Space's injection master switch. With it off, both tabs show the warning **Page enhancements is off.** / "Turn it on before analytics can load on published pages." and every control is disabled, with an **Enable page enhancements** button that flips it in place. +Analytics and custom code only load when the Space's **Page enhancements** switch is on. With it off, both tabs show **Page enhancements is off.**, every control is disabled, and an **Enable page enhancements** button turns it on. -The switch itself lives in **Settings** under **Page enhancements**, described as "Inject performance, SEO, analytics, and comment features into published pages." Turning it off keeps every saved setting ready to restore. When it is on, an **Active now** row lists what is being injected right now. +The switch is in **Settings** under **Page enhancements**. It controls the performance, SEO, analytics, and comment features Spacefast adds to published pages. Turning it off keeps your saved settings. When it's on, an **Active now** row lists what is being added. ## Custom JS One card, **Site-wide JavaScript**, with a **Run custom code** switch and a **JavaScript** textarea. The script applies to every published page view and is stored as the first entry in `superpowers.javascriptTags`. -Do not include `