tode

tode compared with other tools

PostHog in a Figma plugin, compared with tode

PostHog runs in the plugin iframe with memory persistence and brings funnels, flags and replay. What that buys a plugin developer, and what it asks in return.

, by Ilia

PostHog is the most capable thing you can put inside a plugin iframe: events, funnels, retention, feature flags, surveys and session replay from one SDK. It runs there once you tell it to keep state in memory. Whether you want all of that in a side panel is the real question, and it is a question about your plugin, not about PostHog.

Running PostHog in a plugin

posthog-js defaults to cookies plus localStorage for its distinct id. Both are unavailable in a null-origin frame, so you switch persistence to memory and identify the user yourself. Pageviews are meaningless in a plugin, so turn them off; autocapture is your call.

// ui.ts
import posthog from 'posthog-js';

posthog.init('phc_...', {
  api_host: 'https://us.i.posthog.com',   // or eu.i.posthog.com
  persistence: 'memory',
  capture_pageview: false,
  autocapture: false,
});

window.onmessage = (e) => {
  const msg = e.data.pluginMessage;
  if (msg?.type === 'identity' && msg.userId) posthog.identify(msg.userId);
};

posthog.capture('fonts_replaced', { count: 12 });
"networkAccess": { "allowedDomains": ["https://us.i.posthog.com"] }

With memory persistence a new anonymous id is created on every open until identify runs, so call it before the first capture or you will see one-event anonymous users next to your real ones. Session duration follows PostHog's own session rules, which are built around a tab staying open and the user staying active. For a plugin that is open for forty seconds those rules mostly work; just do not expect the number to match "time the UI was open" exactly.

Side by side

PostHogtode
Works in the null-origin iframeYes, with memory persistenceYes
User identityYou pass the Figma user id to identifyRead from figma.currentUser at init
Session lengthPostHog's session modelTime the UI connection is open
Retention and stickinessYes, configurableYes, fixed definitions
Funnels, flags, surveys, replayYesNo
Figma editor and modeSend them as propertiesAttached to every event
Data regionUS or EU cloud, or self-hostedOne region
Event typesUnlimited2 on Free, 20 on Starter, unlimited above
Price modelFree tier, then by usage per productFree for 1 plugin, then one flat price for all your plugins
Bundle weight in the UIThe full SDK, more if replay is onA small adapter

Pick PostHog if

You want to watch a replay of someone getting stuck in your plugin. Nothing else on this list does that, and for a UI-heavy plugin it is worth a lot. Or you want feature flags to roll a change out to a tenth of your users. Or you already use PostHog for the rest of your product.

Pick tode if

You want the usage numbers for a plugin or a handful of them, you do not want replay or flags, and you would rather have session length and identity handled than configured. The narrower data model is also the privacy story: there is no way to send more than a name and a number, which is easy to describe in a Community listing. See what a plugin knows about its users for the full list of what is stored.