Realtime & mobile apps
Web tabs and mobile apps share live queries, cursors and file uploads.
Generated hooks for Next.js, Expo and Flutter subscribe to your deployed read queries over one connection. Edits push compact row diffs, open records host in-memory presence rooms, and phones upload media straight to storage.
Read the Next.js guide- Replaces
- Pusher or Ably pub-sub servers
- Liveblocks presence services
- Custom WebSocket fan-out
- Separate media upload backend
Snapshot handoff
Server-rendered pages subscribe from their initial commit.
Load the first render in a Next.js Server Component and pass the session bookmark to generated React hooks. Live row patches pick up from that exact commit without a loading flash or missed write.
Next.js and React'use client'import { useListBoardCards } from '@/napalm/hooks'import type { RowOf } from '@/napalm/live' export function BoardClient({ initialRows,}: { initialRows: readonly RowOf<'listBoardCards'>[]}) { const { rows } = useListBoardCards() return <KanbanColumns cards={rows ?? initialRows} />}Live cursors
Any readable record can host an in-memory presence room.
usePresence shares cursors, selection ranges and status over the existing live stream without writing to disk, and useWatchedRooms shows active viewer counts across a board.
import { usePresence } from 'napalm-client/react' export function CardPresence({ cardId }: { cardId: string }) { const { people, update } = usePresence(cardId, { state: { status: 'viewing' }, }) return <AvatarStack people={people} onMove={(xy) => update({ xy })} />}Board ordering
Moving a card between columns updates a single row.
Store a float64 sort_key on each card instead of re-numbering sibling rows. Dragging a card updates one record and sends a single patch to open browsers and phones.
# Reorder or move a Kanban card without rewriting sibling rowsupdate BoardCardfilter .id = <uuid>$cardset { column_key := <str>$column_key, sort_key := <float64>$sort_key,}Web and mobile SDKs
One query folder generates React hooks and Flutter streams.
Run napalm generate to output typed TypeScript hooks for Next.js and Expo alongside Dart streams for Flutter. Web and mobile apps stay typechecked against the same deployed queries.
Flutter and mobilenapalm queries push studionapalm generate studio --deployed --lang ts -o src/napalmnapalm generate studio --deployed --lang dart -o lib/napalmMobile sign-in
Passkey and OAuth sessions persist in Keychain and Keystore.
Sign users in with native passkeys, magic-link codes or browser OAuth PKCE. NapalmClient stores credentials in secure device storage, renews expiring tokens and reconnects live streams when the app reopens.
final signIn = SignIn(address, store: KeychainStore(secureStorage));final napalm = NapalmClient(address, signIn: signIn); await signIn.withPasskey(email);Media uploads
Phones send photos and video straight to object storage.
Multipart uploads stream directly from the device with byte-level progress, and Napalm checks the file header before marking media ready. Every account includes 500 GB of monthly edge delivery.
$0.04 / GBedge media delivery to web and mobile clients