docs · reference

Reference

The full capsule contract: server, data API, client, auth, env, deploy.

Capsule

A capsule is one complete app: source, server API, client UI, state, auth, logs, and deploy URL.

Server API

import { boolean, capsule, mutation, query, string, table } from "@luminaweb/runtime/server";

Tables

todos: table({
  text: string(),
  done: boolean(),
  ownerId: string(),
})

Field types (v0)

  • string()
  • boolean()
  • number()
  • text() — same as string(), semantically free-form
  • json<T>() — stored as JSON

Every row has

  • id
  • createdAt
  • updatedAt

Table methods

  • where(field, value)
  • orderBy(field, "asc" | "desc")
  • limit(count)
  • all()
  • get(id)
  • insert(value)
  • update(id, patch)
  • delete(id)

Client API

import {
  Link, Route, Router, Routes, SignInWithGoogle,
  signOut, useAuth, useMutation, useNavigate, useParams, useQuery,
} from "@luminaweb/runtime/client";

Auth

Every capsule starts with guest auth. ctx.auth.userId is the stable per-user identifier. ctx.auth.provider is "guest" or "google".

Deploy

Anonymous deploys are first-class. luminaweb claim upgrades to env + fetch + stable subdomain.