Skip to content

Goodspeed is in closed beta. Enter your email and we check your invite on the spot: invited accounts start free today, and everyone else joins the waitlist in one click. Get started

Skip to content
Goodspeed

Connect Offline Sync to your Goodspeed app

Write queue and replay logic that keeps user data safe when the device loses connectivity, built into every Goodspeed app via lib/offline.ts. Goodspeed wires Offline Sync into every app that needs it at generation time, so you start with a working integration, not a blank config and a documentation tab.

WHAT GETS WIRED IN

Built into every Offline Sync build

Every app Goodspeed generates with Offline Sync includes these wired integrations from the first build. No manual setup required.

ItemDescriptionStrength
Writes queued when offlinelib/offline.ts watches the network state and holds Supabase writes on the device when there is no connection.Data
Replayed in order, onceQueued work replays in the order it was made, with an idempotency key per write so a retry cannot duplicate it.Reliability
People can see it is queuedThe useNetworkStatus hook drives an indicator, so nobody is left wondering whether their edit was lost.Interface
Replay on reconnectThe realtime reconnect handler triggers the queue as soon as the connection comes back.Data

Source: the Goodspeed app foundation · offline/sync

REAL GENERATED CODE

A snippet from a Offline Sync integration the pipeline ships

This pattern is lifted from the engineered plumbing that ships inside every Goodspeed app. The studio generates Offline Sync integration code like this for every app that includes it, not a placeholder you have to fill in yourself.

  1. Offline write queue

    // lib/offline.ts
    export async function queueWrite<T>(
      table: string,
      operation: 'insert' | 'update' | 'delete',
      payload: T,
    ): Promise<void> {
      const queue = await getQueue();
      queue.push({ id: uuid(), table, operation, payload, createdAt: Date.now() });
      await AsyncStorage.setItem(QUEUE_KEY, JSON.stringify(queue));
    }
    
    export async function replayQueue(): Promise<void> {
      const queue = await getQueue();
      for (const item of queue) {
        await supabase.from(item.table)[item.operation](item.payload);
      }
      await AsyncStorage.removeItem(QUEUE_KEY);
    }
GDaily Allergens

Today's log

Gluten
Tree nuts
Shellfish
Dairy
HomeScanLogProfile

START WITH OFFLINE SYNC

Your Offline Sync integration, generated