Skip to content
App
Markdown

Working with data

One governed door to your organization's data plane — no drivers, no connection strings, authorization included.

Preview. This works today, but the surface may still change.

Apps on Pilvia App do not connect to databases. There is no connection string to leak, no driver to bundle, no pool to size. Instead, the platform gives an app bindings — capability objects on env — and every data operation goes through one governed door to your organization's data plane, Pilvia Mieli.

// a handler on an authenticated route
export async function GET(request: Request, env, ctx) {
  const projects = await env.entities.list({ type: 'project', limit: 20 });
  return Response.json(projects);
}

That call carries the signed-in user's identity. Row-level security scopes the result to what that person may see, and the organization's governance gates apply — with no authorization code in the app. This is what "run your code next to your data" means in practice: the hard part of every internal tool, handled by the platform.

The surface

What an app can hold is exactly what its manifest granted:

Binding What it is
env.user The authenticated end-user, built by the host
env.entities Structured business records — get, list, upsert, link
env.memory The organization's free-text memory stream — search, get, write
env.ai Chat through the organization's gateway, rate-limited

Not available yet, and they say so when called: env.vector, embeddings under env.ai, env.extract and env.transcribe. Outbound HTTP is the ordinary global fetch, under the manifest's egress grant.

The bindings are identical whether the data plane runs in the same rack or across a network — co-locating changes a URL, not your code. And the list is deliberately short: every binding is a capability grant and a policy boundary, so the surface grows by product decision, not by accumulation.

Who is acting

Every operation runs as a principal, and the auth page defines which:

  • On authenticated routes: the signed-in user — per-user rows, per-user audit.
  • On public routes and jobs: the app's own principal, and only with the manifest's "app_data": true grant.

If the user channel is broken or absent, data capabilities are absent — never silently downgraded to the app's own, wider access.

Scope of these docs

These pages document the platform bindings — the contract your app codes against. The data plane itself (entity types, the write pipeline, governance) is its own product with its own documentation; you do not need it to build an app, and nothing here duplicates it.

Type to search. ↑↓ to move, Enter to open, Esc to close.