# The manifest — pilvia.app.json

Every field of the deploy manifest. Everything defaults closed.

`pilvia.app.json` sits in the project root and is the app's declared
contract with the platform: who may call it, what it may touch, what it
ships. **Everything defaults closed**, and an unknown field is a
deploy-time error — a typo cannot open anything.

## Serving

| Field | Default | Meaning |
| --- | --- | --- |
| `name` | — | The app's name; also its platform hostname, `<name>.pilvia.app`. Lowercase `[a-z0-9-]`, at most 30 characters, never containing `--` (the [preview](/hosting/previews.md) separator). Omit it and the first deploy mints one. |
| `assets` | — | Directory of static files, served by the host. An `assets` dir with no server half is a complete [static site](/hosting/static-sites.md). |
| `fallback` | build's `404.html` | What an unmatched read gets: `"spa"` (serve `index.html` with 200) or `"404"`. |
| `custom_domains` | `[]` | Extra hostnames this app serves — declaring one routes and certifies it. Never a name under the platform zone, except the app's own `<name>.pilvia.app`, which makes that name indexable ([headers](/reference/headers.md#platform-names-are-unlisted)). |
| `canonical_host` | — | The one custom domain content is served on; the others 301 to it. Must be one of `custom_domains`; the platform hostname is exempt. See [Custom domains](/hosting/custom-domains.md). |

## Server code

One of these, at most:

| Field | Meaning |
| --- | --- |
| `server` | A file-routed [functions directory](/hosting/server-functions.md). The CLI bundles it and derives the routes list from the tree. |
| `build` | A build description written by a framework adapter (e.g. [`@pilvia/astro`](/hosting/astro.md) → `dist/pilvia.build.json`): entry, assets and on-demand routes, derived from the framework's own manifest. |
| `entry` / `bundle` | A hand-written fetch-handler entry point (built at deploy), or a prebuilt bundle. The escape hatch shape: `export default { fetch(request, env) }`. |

`routes` — the paths the server half answers — is always **derived**, never
hand-written: from the `server/` tree or the framework manifest. With a
routes list present, requests resolve asset → declared route → fallback; a
`:param` segment matches exactly one path segment, a trailing `*` takes the
rest.

## Access and capabilities

| Field | Default | Meaning |
| --- | --- | --- |
| `auth` | `"required"` | Who may call the app: `"required"`, `"public"`, or `"token"` (machine callers holding the app's `TRIGGER_TOKEN` secret). See [Authentication](/auth/overview.md). |
| `app_data` | `false` | Grants the app's **own** principal data access where no end-user is present (public routes, jobs). Declared privilege, never ambient. |
| `egress` | deny | Outbound network: `false`, `"all"`, or `{ "allow": ["api.stripe.com", "*.mailgun.net"] }`. Absent means the app has no network. The installation's own ceiling can only narrow this, never widen it. |
| `max_body_mb` | `1` | Request-body ceiling in MiB, clamped to 64. Raise it explicitly if you take uploads. |
| `jobs` | — | Opt in to the organization's [job queue](/data/jobs.md): `{ "path": "/sync" }` plus optional `kinds`, `lease_secs`, `max_slices`, `poll_secs`. Absent means the host never runs the app except on a request. |
| `kv` | `false` | The app's own key-value store, [`env.kv` and `env.cache`](/hosting/kv.md). Without it the ops throw. |
| `sql` | `false` | The app's own SQLite database, [`env.sql`](/hosting/sql.md). Without it the ops throw. |
| `entities` | — | [Cached `env.entities` reads](/data/entities.md#cached-reads): `{}` caches the reads the app makes as itself on public requests; `{ "mirror": ["member"] }` also keeps those types whole beside the app. Needs `app_data`. |

## Examples

A static site:

```json
{ "name": "my-site", "auth": "public", "assets": "dist" }
```

A site with a form handler:

```json
{
  "name": "my-site",
  "auth": "public",
  "assets": "dist",
  "server": "server",
  "egress": { "allow": ["api.eu.mailgun.net"] }
}
```

An internal dashboard (note what is *not* declared — sign-in required is
the default, and it needs an organisation: see
[Authentication](/auth/overview.md)):

```json
{ "name": "dashboard", "build": "dist/pilvia.build.json" }
```

A connector with no inbound surface at all:

```json
{ "name": "vendor-sync", "jobs": { "path": "/sync" }, "egress": { "allow": ["api.vendor.com"] } }
```
