clone

a deno framework for local-first web apps that open instantly, work offline and sync when users choose

feat/prf-provision-custody
lofi / apps / reference / src / app.ts
app.ts 1.6K
1import { defineLofiApp } from "@nzip/lofi";2import { app as schema } from "./schema.ts";34/** Author-owned composition. Vendor URLs and browser drivers remain in package runtime code. */5export const app = defineLofiApp({6 name: "lofi-prototype",7 databaseName: "lofi-prototype",8 schema,9 storage: "durable" as const,10 // Identity is local-first: first boot opens a private, on-device account with11 // no sign-in. When a managed Jazz app is configured (JAZZ_APP_ID / JAZZ_SERVER_URL —12 // see `deno task jazz:provision`), the AccountGate island lets the user elect to13 // back up and sync it, and recover it from a passkey or phrase. See the framework's14 // `docs/sync-and-recovery.md` guide.15 //16 // Hostnames you have committed to keeping stable, for the optional device-credential17 // primitive in `@nzip/lofi` (WebAuthn/PRF at-rest encryption). A credential binds18 // to its origin: localhost works for development without configuration, but a19 // deployed origin must be listed here before credentials can enroll on it. An20 // unlisted host is refused so a preview hostname cannot mint passkeys and21 // PRF-protected data that strand when the app moves to its production origin.22 credentialOrigins: [] as readonly string[],23 // Pin this to the canonical production hostname before users create recoverable24 // passkeys. Omit it in local development to use the current hostname.25 // passkey: { rpId: "app.example.com" },26 sync: { adapter: "jazz" as const },27 // Source/home link shown in the starter footer. Point it at your own repo.28 repositoryUrl: "https://github.com/FelineStateMachine/lofi",29});