Exporting and importing comments

Share comments as a file with no backend required

Pindrop can export all comments to a JSON file and import files shared by others. This is the built-in way to collaborate without a backend — share the file over email, Slack, or a shared drive.

Using the toolbar

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

Importing merges the file into your existing comments. Your comments are preserved — nothing is overwritten. New comments from the file appear as unread.

Programmatic export

typescript
const json = pindrop.export()
// Returns the JSON string and triggers a file download

Programmatic import

typescript
const result = pindrop.import(json)
// result: { added: number, merged: number, unanchored: number }

import() accepts the JSON string directly — no file picker. Useful for loading comments from a server response or automating a review workflow.

Merge behaviour

When a file is imported, Pindrop merges it with the local store:

  • New comments (ID not in local store) — added and marked unread
  • Existing comments (same ID) — the version with the newer updatedAt timestamp wins. Replies are merged by union — replies from both sides are kept
  • Conflicts — last write wins based on updatedAt. If timestamps are equal, the local version is kept

Comments that can't be re-anchored to a DOM element (because the page has changed since the file was exported) are still imported and counted in unanchored. They appear in the sidebar but won't show a pin on the page.

File format

The exported file is plain JSON:

json
{
  "version": 1,
  "url": "https://example.com/page",
  "createdAt": "2026-03-29T10:00:00.000Z",
  "comments": [
    {
      "id": "abc123",
      "author": "Alice",
      "text": "This button label is confusing",
      "createdAt": "2026-03-29T09:00:00.000Z",
      "updatedAt": "2026-03-29T09:00:00.000Z",
      "resolved": false,
      "anchor": { "selector": "#submit-btn", "offsetX": 0.5, "offsetY": 0.5, "viewportX": 0.5, "viewportY": 0.5 },
      "replies": []
    }
  ]
}

The url field is recorded at export time but not used during import — you can import a file on any page.

Last updated March 29, 2026