Differences from web Lakebed
Lakebed Native targets the same hosted backend (api.lakebed.dev, *.lakebed.app) as web capsules. Server authoring accepts web-style schema, ctx.db.todos, and ctx.auth.userId — use capsule-api.md as the canonical reference.
Web → native translation
| Web Lakebed | Lakebed Native |
|---|---|
client/index.tsx |
app/index.tsx |
<form onSubmit={...}> |
Input state + Button onPress |
<ul>{items.map(...)}</ul> |
<List data={items} renderItem={...} keyExtractor={...} /> |
<input type="checkbox"> |
<Checkbox checked={...} onChange={...} /> |
<a href="/path"> |
<Link to="/path"> inside <Router> |
ctx.auth.userId |
ctx.auth.userId (same) |
ctx.auth.displayName |
ctx.auth.displayName (same) |
useAuth() (web) |
useAuth() → { userId, displayName, picture, isGuest, loading, error } |
Browser fetch to /query |
useQuery / useMutation (WS on local dev + hosted) |
Still different today
| Topic | Web | Native |
|---|---|---|
| UI | DOM / web components | lakebed-native/ui + React Native |
| Local dev client | Browser | Universal shell + deep link or packed .app |
Web lakebed dev server |
Serves browser client | Does not expose native /query routes — use lakebed-native dev for native clients |
| One deploy, two clients | Web page + (future) | Production *.lakebed.app serves native client.js OTA; browser UI is still the web deploy format |
| Clerk OAuth | Full Clerk | Dev authAs() + Google PKCE on hosted; template stubs removed |
| Image storage | Upload APIs | v0: store URI strings from camera/imagePicker in your DB; no built-in blob CDN |
CLI extras (native only)
npx lakebed-native shell fetch— universal shellnpx lakebed-native pack— embed capsule in shell APK/IPAnpx lakebed-native hosted start— persistent local runner on:4000npx lakebed-native doctor— packages, shell, simulators, dev portsnpx lakebed-native typecheck— capsule TypeScript check
Cross-platform starter
npx lakebed-native new my-habit --template cross-habit
Mirror shared/ and query/mutation names in a web Lakebed capsule. Server dialects can match (web-style schema).
See dev-loop.md for the agent workflow.