Skip to article
Browse documentation

Developers

Embedded tables

Put a live grid inside your own app: sync each customer's data, sign people in with your login, and keep their views and notes.

A live grid inside your own app

FrostTable Embed puts a spreadsheet-style grid in your product. You sync each customer’s records to FrostTable, then open a grid scoped to that customer after they sign in to your app. They do not need a FrostTable account. They can filter, sort and page through the whole table, save views, and add notes that later syncs leave in place. Synced columns are read-only in the grid.

Set it up

  1. Create one workspace per customer, each with a table for that customer’s records. Add a column for each source field. The table’s id column must be text: it holds your source record IDs.
  2. As an organization owner or admin, open Advanced → Embedded tables. Create an integration and list the exact origins that may show the grid, such as https://app.example.com.
  3. Copy the server credential, which starts with fv_ and is shown once. Keep it on your backend. Never put it in a browser, mobile app or URL.
  4. Map each of your customer IDs to its workspace and table. A workspace serves only one customer.
  5. Import each customer’s data, add a launch route to your backend, and mount the grid in your page.

You can rotate or revoke the credential at any time. Either one ends all open embed sessions. Disabling a customer mapping ends that customer’s sessions.

Sync your data

Call the sync API from your backend with Authorization: Bearer fv_…. Every record has two values you control:

  • Source record ID: your stable ID for the record. Notes stay attached to it.
  • Source version: an integer that only increases for that record, such as a revision number or the source row’s modification time.

Each record you send is a complete copy of its source fields; a field you leave out becomes empty. A higher version is written. A lower version is skipped, so a delayed batch cannot overwrite newer data. The same version with the same data changes nothing. The same version with different data is refused, unless that version was never saved. Deleting records is not supported; send a status field instead.

Initial import

Upload a CSV, TSV, TXT or XLSX file with source_record_id and source_version columns plus your table’s column names. A file can hold up to 100,000 rows and 100 MB; send larger loads as several files.

curl -sS -H "Authorization: Bearer $FROSTTABLE_EMBED_CREDENTIAL" \
  -F "[email protected]" \
  "https://YOUR_FROSTTABLE_HOST/api/embed/vendor/v1/customers/acme-123/imports?batchId=initial-load"

Incremental batches

Send 1 to 1,000 changed records at a time with your own batchId.

POST /api/embed/vendor/v1/customers/acme-123/batches
{
  "batchId": "changes-0042",
  "records": [
    {"sourceRecordId": "SHP-1001", "sourceVersion": 7,
     "fields": {"carrier": "Northwind", "status": "Late", "eta": "2026-12-09"}}
  ]
}

Know what succeeded

Each batch reports a status. Check it again with GET /api/embed/vendor/v1/customers/{customerId}/batches/{batchId}.

  • SUCCEEDED: the records are saved, or were already replaced by newer versions.
  • APPLYING or PROCESSING: check again.
  • FAILED with retryable: true: send the same batch ID and content again.
  • FAILED with retryable: false: correct the data and use a new batch ID.

Retrying is safe. A batch that already succeeded is answered from its record: nothing is written or charged again. Reusing a batch ID for different content returns 409 BATCH_ID_REUSED. A 409 SOURCE_VERSION_CONFLICT needs a higher source version. For 409 SYNC_IN_PROGRESS, 429 rate limits and 5xx errors, wait and retry. 429 STORAGE_QUOTA_EXCEEDED succeeds on retry after you free or add storage. A 400 or 422 means nothing was stored.

Sign people in

After your app has signed a user in and confirmed that they may see this customer, your backend asks for a launch code. Take the customer and permissions from your own server-side records, never from the browser request.

POST /api/embed/vendor/v1/launches
{
  "externalCustomerId": "acme-123",
  "externalUserId": "user-789",
  "displayName": "Dana Diaz",
  "permissions": ["read", "notes:write", "views:write", "views:share"]
}

The response has launchCode and embedUrl. The code works once and expires after 60 seconds. Use ["read"] for a read-only user. notes:write adds notes, views:write saves private views, and views:share shares them with other users of the same customer. No permission allows editing synced data.

When a user signs out or loses access, call POST /api/embed/vendor/v1/sessions/revoke with their externalUserId.

Add the grid to your page

<div id="grid" style="height: 600px"></div>
<script src="https://YOUR_FROSTTABLE_HOST/js/embed-host.js"></script>
<script>
  FrostTableEmbed.mount({
    container: document.getElementById('grid'),
    embedUrl: 'https://YOUR_FROSTTABLE_HOST/embed/INTEGRATION_ID',
    getLaunch: () => fetch('/your/launch-route', {method: 'POST'}).then(response => {
      if (!response.ok) throw new Error('launch failed');
      return response.json();        // {launchCode}
    }),
    theme: {mode: 'auto', accentColor: '#6750a4', density: 'comfortable', borderRadius: 8},
    viewId: lastViewId,               // optional: reopen a saved view
    onViewChange: viewId => remember(viewId)
  });
</script>

Sessions last 15 minutes. When one ends, the grid hides the data, asks your app for a new launch and reopens the current view. If you pass onSessionExpired: renew => …, your app decides when to call renew(). If your page has a Content Security Policy, allow your FrostTable host in frame-src and script-src.

Style the embedded grid

Pass an optional theme object to FrostTableEmbed.mount(). It styles the table, toolbar, filters, notes, and loading, error and session states. Host page CSS cannot reach inside the iframe.

// Add this property to your FrostTableEmbed.mount({...}) options.
theme: {
  mode: 'light',
  accentColor: '#6750a4',
  backgroundColor: '#ffffff',
  textColor: '#202124',
  borderColor: '#dadce0',
  fontFamily: 'Arial, system-ui, sans-serif',
  fontSize: 14,
  density: 'comfortable',
  borderRadius: 8
}
OptionAccepted valuesDefault
modelight, dark, auto (follows browser preference and changes)light
accentColorHex color: #RGB or #RRGGBBBlue, adapts to mode
backgroundColor, textColor, borderColorHex colorsAdapt to mode
fontFamilyLocal font stack, e.g. Inter, system-ui, sans-serif; at most 200 letters, digits, spaces, commas, quotes or hyphensSystem font
fontSizeNumber, 10–24 pixels14
densitycompact (32px rows), comfortable (40px rows)compact
borderRadiusNumber, 0–24 pixels0

Use mode: 'auto' and omit backgroundColor, textColor and borderColor for the built-in light and dark palettes. Explicit colors stay fixed when the mode changes. Automatic mode follows the browser’s color preference, not your app’s theme toggle or CSS classes. Pass your app’s light or dark setting explicitly if it has its own theme.

Fonts must be available inside the iframe. Fonts loaded only by your page are not inherited; include a system fallback. fontSize sets the base size; table text and controls scale relative to it. borderRadius rounds the outer corners; control corners use the same value capped at 8px.

Unknown options and invalid values are ignored. CSS rules, URLs and remote font loading are not supported. Choose readable text and background colors. Button text automatically contrasts with the accent; secondary surfaces derive from your colors. Options are copied at mount and resent on session renewal. Remount to change them. Themes belong to your app, are separate from saved views and are not stored by FrostTable.

How access is protected

  • Browsers will show the grid only on the origins you configure.
  • The launch code reaches the grid through a checked browser message. Neither it nor the session token is put in a URL, cookie or browser storage, and the grid does not need third-party cookies.
  • On every request, FrostTable takes the customer, table and user from the session, not from anything the browser sends.
  • You decide who may open which customer. Check that in your launch route.

Usage and limits

Usage counts against your organization’s plan. Grid queries use managed query compute and your concurrent-query limit. The initial import is metered like a file import, and synced data counts toward storage. Saving notes and views is paused while the organization is over its storage allowance. See plans and billing.

The grid shows one table per customer with up to 200 rows per request. It does not show linked, lookup, rollup or calculated fields. Very deep paging stops at the query engine’s offset limit, 100,000 rows by default; use a filter to narrow the results. Notes can be edited by their author but not deleted. Your organization members can still open synced tables in FrostTable; avoid editing synced fields there, because a later sync replaces them.