FormalyFormaly
FeaturesWhyComparePricingBlog
All articles
Product Deep Dive/ Mar 5, 2026

In-Product Targeting: How We Built a Tiny Survey SDK for Formaly

The product and technical decisions behind the Formaly SDK: a small runtime, deliberately boring triggers, respectful cooldowns, and surveys that show up in context instead of in your inbox.

11 min read

Arindam Majumder

Arindam Majumder

Formaly

Share this article

HN

I have a simple opinion about product feedback: if you ask at the wrong time, you get worse answers.

The research bears this out, feedback collected at the moment of friction beats the same question asked days later, and timing often moves response quality more than copy does. That is why we built in-product targeting for Formaly.

The hard part was not rendering a popup. That part is easy. The harder part was building an SDK that is small, predictable, respectful, and genuinely useful for real product teams.

The constraints

Before writing a line of the SDK, I wrote down the constraints:

ConstraintWhy it mattered
Small runtimeNobody wants a survey SDK that slows their app
Simple installOne script tag, not a project
Clear triggersTeams should understand why a survey appeared
CooldownsUsers should not be chased around the product
Manual escape hatchTeams need full control for important moments

These constraints forced the product to stay focused, which, with feedback tooling, is most of the battle.

Why triggers are intentionally boring

It is tempting to build a huge targeting engine. The problem is that huge targeting engines become impossible to reason about, and a rule nobody understands is a rule nobody trusts.

We shipped the triggers teams actually need:

  • Page view
  • Delay
  • Scroll depth
  • Exit intent
  • Element click
  • Manual call (Formaly.show())

…plus targeting conditions that match on URL and user attributes, so a trigger only fires for the right segment. A product manager can understand "show after the user clicks this button, but only for trial accounts" without reading documentation for an hour. Boring primitives are predictable primitives.

Display modes are different social contracts

The SDK supports popup, slide-in, and widget, and each one is a different agreement with the user:

DisplayUse it whenAvoid it when
PopupThe feedback moment is importantThe user is mid-flow in something delicate
Slide-inYou want visibility with less interruptionThe question is long or sensitive
WidgetFeedback should be user-initiatedYou need a high response rate immediately

"Show a survey" is not one UX pattern, so the SDK does not pretend it is.

Cooldowns are product quality, not a setting

Cooldowns are not a nice-to-have. They are how the SDK respects the user.

If someone dismisses a survey, the SDK remembers. If someone completes one, it stops asking. If a team runs several surveys at once, the product should still feel calm rather than like a popup carousel. This is one of those details users only notice when it is wrong, which is exactly why it has to be right by default.

Why small matters

An SDK that runs on a customer's site has to earn its place. The runtime's whole job is to fetch config, evaluate triggers and conditions, render the chosen display mode in an isolated iframe, send events, and otherwise stay quiet.

No giant framework assumptions. No unnecessary dependencies. No surprise behavior. The survey loads in an iframe so it cannot interfere with the host page's styles or scripts, the host app stays exactly as fast and as stable as it was.

What I am optimizing for

In-product surveys are not about asking more questions. They are about asking fewer, better-timed ones.

The best implementation disappears when it should disappear and shows up only when the user's context makes the question worth asking. That is the bar for the Formaly SDK, and it is the same philosophy behind the public SDK announcement and the broader idea that static forms are overused, not dead.

On this page

The constraintsWhy triggers are intentionally boringDisplay modes are different social contractsCooldowns are product quality, not a settingWhy small mattersWhat I am optimizing for
› Keep readingAll articles →
Essay

Completion Rate Is a Vanity Metric

7 min read
Essay

The Form Is Dying. The Interview Is Replacing It.

7 min read
Engineering

How We Chose Our AI Provider: Why Formaly Runs on Nebius Token Factory

9 min read
FormalyFormaly

Talk to build. Talk to answer.

© 2026 Formaly

BlogPrivacyTermsContact

Made by Arindam

Formaly