How offline mode works

Pindrop works fully offline by default — no backend required

Pindrop is offline-first. Without an adapter, everything is stored in the browser's localStorage and works with no network connection at all.

Default behaviour (no adapter)

When you call Pindrop.init() without an adapter, comments are saved to localStorage under the storageKey you provide. They persist across page reloads, survive browser restarts, and never touch a server.

typescript
Pindrop.init({ storageKey: 'my-app' })
// All comments stored in localStorage — fully offline

Nothing is lost if the user goes offline mid-session. Every action (add, edit, resolve, delete) is written to localStorage immediately.

Sharing comments without a backend

Use the built-in export/import flow to share comments as a file — no server needed.

  • Export — toolbar menu → "Share comments" → downloads a .json file
  • Import — toolbar menu → "Load comments" → opens a file picker

The recipient's existing comments are preserved. Pindrop merges the imported file with what's already in their store, deduplicating by ID. New comments from the file appear as unread.

This is the recommended approach for small teams who don't need live sync — share the file over email, Slack, or a shared drive.

When an adapter is connected

With an adapter, Pindrop loads from your backend on init and saves to it after every change. If a save fails (network down, server error), the failure is logged to the console and the comment remains in the in-memory store for the current session — but it won't be persisted to the server until the next successful save.

There is no automatic retry or offline queue. If you need guaranteed delivery, implement retry logic in your adapter's save method:

typescript
const adapter = {
  load: async () => {
    const res = await fetch('/api/comments')
    return res.json()
  },
  save: async (comments) => {
    // Simple retry — attempt twice before giving up
    for (let attempt = 0; attempt < 2; attempt++) {
      try {
        await fetch('/api/comments', {
          method: 'POST',
          headers: { 'Content-Type': 'application/json' },
          body: JSON.stringify(comments),
        })
        return
      } catch {
        if (attempt === 1) throw new Error('Failed to save comments after retrying')
      }
    }
  },
}

localStorage keys

Pindrop writes three keys to localStorage, all prefixed with your storageKey:

KeyContents
{storageKey}-commentsComment array (only used when no adapter is connected)
{storageKey}-themeUser's theme preference (auto, light, or dark)
{storageKey}-read-idsIDs of comments the user has read (only used when an adapter is connected)

Last updated March 29, 2026