Developers

Build it yourself.

The SDK is a classic script. It handles magic links, sessions, device tokens and versioned JSON writes. You keep the app as a single HTML file.

Looking for the full step-by-step? Start with the quickstart or the API reference.

SDK

Add the script before your app code:

<script src="https://iavica.com/sdk/iavica.js"></script>

Local POC: build with pnpm sdk:build and load ../packages/sdk/dist/iavica.js.

Connect

const db = Iavica.connect({
  appId: 'YOUR_STABLE_APP_ID',
  appName: 'Family Expenses',
  locale: 'en' // 'en' | 'es' or custom labels
});

const expenses = db.collection('gastos');
await db.ready();

Keep the appId stable. It identifies the app, not the data, and must survive app updates. Do not hardcode the user's email or secrets.

Collections

// Create
await expenses.add({
  date: '2026-11-18',
  concept: 'Coffee',
  amountCents: 250
});

// List
const page = await expenses.list({ limit: 50 });

// Update with optimistic concurrency
await expenses.update(recordId, {
  data: { concept: 'Coffee', amountCents: 300 },
  version: 1
});

// Delete
await expenses.remove(recordId, { version: 2 });

Conflicts

Writes carry the record version. A stale write returns 409 VERSION_CONFLICT and the current version. Refresh the record, show the conflict and let the user retry.

try {
  await expenses.update(id, { data, version });
} catch (err) {
  if (err.code === 'VERSION_CONFLICT') {
    // reload and ask the user to retry
  }
}

Multi-device

// Same appId on another device:
Iavica.connect({
  appId: 'YOUR_STABLE_APP_ID',
  appName: 'Family Expenses',
  locale: 'en'
});

// If the user has several projects, the SDK shows a selector.
// A "Switch project" control should call db.logout() and reload.

Errors

StatusMeaningWhat to do
401Session expiredThe SDK refreshes from the device token; otherwise start the email flow.
403No access / blockedShow a clear message; do not retry in a loop.
409Version conflictRefresh and retry.
429Rate limit or quotaBack off and inform the user.
410Expired link/invitationStart the flow again.