DEV Community

Riya Sharma
Riya Sharma

Posted on

Add Churn Prevention to Your SaaS App in 10 Minutes with npm

Okay so I'll be upfront — churn was genuinely the last thing I was thinking about when I was in the middle of building.

Like I was in it. Head down, tunnel vision, the whole thing. Fixing bugs at 1am that honestly maybe two people would ever notice. Shipping features I thought were cool. Refreshing Twitter like that was somehow part of my job. Retention felt so far away. It felt like a problem that belonged to a future version of me — the one who had users, real traction, some kind of momentum. Not right now me.

And then one week I lost four paying users. In three days.

No email. No complaint. Not even an angry reply to one of my newsletters. They just — stopped. Logged in less, then not at all, then at some point clicked cancel and were gone. I sat there staring at the numbers genuinely not knowing what happened. Did something break? Did I raise the price wrong? Did someone launch a competitor I hadn't heard of yet? I had nothing. No idea whatsoever.

The silence was the worst part. Not the churn itself — the fact that I had zero signal about why.

So I finally — finally — sat down and actually thought about this. And what I realized was kind of embarrassing honestly. All that energy going into getting people to sign up, and I had zero. Like literally nothing set up to figure out why they were quietly disappearing.

The Thing Nobody Talks About (but Should)

Here's the thing about churn that took me embarrassingly long to figure out — it's not a moment. Here's the thing nobody told me — churn isn't really a moment. Like yeah, there's a cancel button and someone clicks it. But that's not when you lost them. That's just when the paperwork catches up.
It's more like... they just slowly stop showing up. It starts days before the cancel — sometimes weeks before. Logins get less frequent. The feature they used every single day, they just quietly stop opening it. Sessions get shorter. The person is already mentally somewhere else, and you have no idea because you're still sending them emails they stopped opening three weeks ago.

By the time they actually cancel — honestly, you've already lost them. Like way earlier. That cancel button is just the moment you finally find out.

That realization kind of wrecked me a little. Because it meant all the "retention" stuff I thought I was doing — the occasional check-in email, the feature announcement — was already too late. I was reaching out to people who had already moved on. Long gone.

And then there's the other thing. Even when people did cancel, I had no clue why. I had one of those dropdown menus on my cancel page. You know exactly which ones I mean because you've seen them everywhere.

  • Too expensive
  • Not using it enough
  • Missing features
  • Found a better alternative
  • Other

I looked at my cancellation data one afternoon and it was basically just split between "not using it enough" and "other." Okay. Great. What am I supposed to do with that? "Not using it enough" — but why weren't you using it? Was onboarding confusing? Did you not get what the product was actually for? DOr did something just come up and they forgot the tab was even open? I mean those are completely different situations. One's a product problem, one's a messaging problem, one's just life. I can't do anything with "not using it enough" as a reason. But if onboarding was confusing? That I can fix today. I just needed someone to actually tell me that.
And "other." I mean. Come on.

The people leaving knew exactly why they were leaving. They just had no good way to actually tell me. And I'd given them a dropdown that made it way easier to just pick anything and be done with it.

What I Actually Needed

Once I figured out what was actually going on, what I needed wasn't that complicated.

I needed to catch drift before it became a cancel. Something that would flag a user and basically say — hey, this one's slipping, talk to them now. Not a spreadsheet full of numbers I'd have to sit down and interpret every week. Just a label. "Drifting. Do something today."

And I needed real words from people at the moment they were leaving. Not a dropdown. Not stars out of five. Just — let them type what's going on. In whatever language they actually use. Because that's the stuff you can do something with.

I went back and forth on building it myself. The drift scoring logic isn't some crazy algorithm — you're basically just looking at when they last logged in, whether they hit the core features, whether usage is trending up or down. Combine those somehow, generate a score, put a label on it. I could probably hack together a first version over a weekend.

But then. Then I'd have to keep the thing running. Build a dashboard for it. Handle the cancel flow UI. Store feedback somewhere I could actually search later. Add notifications for when someone tips from Risky into Drifting. Handle edge cases. Write tests. Keep it all working while simultaneously trying to ship the actual product I'm supposed to be building.

That's not a weekend thing anymore. That's a whole second project that starts quietly eating the first one alive. I've watched that happen before.

So I went looking for something I could just drop in.

Finding Flidget

Found Flidget pretty late one night while going down a rabbit hole on retention tooling. What got me immediately was that it wasn't trying to be some enterprise customer success platform. No "book a demo." No sales team I'd have to talk to. No implementation guide that's 60 pages long. It was clearly built for developers. Install it, send some events, look at data. That's it.

And it handles exactly the two things I actually needed:

Drift detection — watches behavior, builds a score, labels every user Healthy, Risky, or Drifting. Tells you why in plain language. Not a number you have to go decode somewhere else.

Exit chat — when someone hits your cancel button, a small chat widget opens. Right there on the page. Not a redirect. Not some separate form URL. Right there. They can type or leave a voice response explaining why they're leaving. Everything goes into a searchable dashboard.

Both problems. One install. That was honestly enough.

The Setup (It Really Is 10 Minutes)

Okay here's what it actually looks like.

Install the package:

npm install @flidget/web-sdk

Then drop this somewhere early — main entry file, auth handler, wherever:

import Flidget from '@flidget/web-sdk';
Flidget.init({ publicKey: 'your_public_key' });

That's it for the exit chat. Like genuinely that's the whole thing. The second this is running, Flidget catches your cancel button and opens the chat automatically. You don't touch anything else for that part to work.

Setting Up Drift Detection

This part needs slightly more thought. Still not much more code though.

You need to figure out which 3 to 5 actions in your app actually mean someone is getting value. Not every click. Not every page view. The specific things that separate users who stick around from users who don't.

For most SaaS apps it ends up being something like:

  • Finishing onboarding
  • Using the core feature the first time
  • Inviting someone from their team
  • Creating something real — a project, a workflow, a report
  • Coming back on their own on day 7 or day 30

Once you have that list, tracking is just:

Flidget.track('complete_onboarding', { userId: user.id });
Flidget.track('used_core_feature', { userId: user.id });
Flidget.track('invite_teammate', { userId: user.id });
Flidget.track('created_first_project', { userId: user.id });

Give it a few days of data. After that, every user in your app gets a score. Dashboard shows you the full list sorted by risk level, with a reason attached.

Something like: "Drifting — 11 days inactive, never used core feature."

Okay so — what do you actually do with that? You know exactly where they got stuck. So instead of firing off some "hey we miss you!" blast that goes straight to the promotions tab, you send something specific. "Hey — I saw you signed up a couple weeks ago but never got a chance to try [core feature]. Honestly that's where most people have their first real moment with the product. Want me to walk you through it?"

That email gets replies. I've sent enough of them. It works.

What the Dashboard Actually Gives You

Once both pieces are running the dashboard becomes something you actually want to open. Which, for an analytics tool, is kind of rare.

Drift side: live list, sorted by risk. Filter to just Drifting users, see why each one got flagged, decide what to do. Some you reach out to directly. Some you put in a sequence. Some you watch for a few more days before doing anything.

The point is you're moving before they cancel. Not reacting after.

Exit side: feed of cancellation reasons in actual human words. Searchable, filterable. After a few weeks you start seeing things you wouldn't have found in any dropdown. Multiple people using almost identical phrasing to describe the same problem. The thing you assumed was driving churn — usually price — barely showing up. But something else showing up constantly.

That's the kind of thing that changes what you build next. Not a pie chart of dropdown selections. Real sentences from real people explaining what didn't work.

Oh and the rescue emails — when someone hits Drifting, Flidget can automatically fire an email from your own domain. Not a marketing blast. A specific message, timed to when they're most likely to actually respond. That part alone is probably worth the whole subscription cost.

Why I Didn't Just Build It Myself

I know exactly what some people reading this are thinking. "I could just build this." I had that same thought for like two weeks.

You probably could build a version 1. The drift scoring really isn't complicated — days since last login, did they use the key feature, is usage going up or down. Weight those somehow, generate a score, slap a label on it. Exit chat is maybe a day's work. Overlay on the cancel click, simple input, store the response somewhere.

Version 1 is always easy.

Version 2 needs a real dashboard. Version 3 needs search and filtering. Version 4 needs notifications. Version 5 needs the email automation. And somewhere in there something breaks in production on a random Thursday evening and you spend three hours debugging your own internal analytics tool instead of the feature three users have been asking about for a month.

I've done this. I have the internal tools to prove it. Things that started as "quick weekend project" and slowly turned into things I dreaded having to touch.

Flidget costs money. That's genuinely fine. Paying for it means someone else is handling the edge cases and the infrastructure and the 3am production incidents. My job is to build my product. That's the whole trade.

Honestly Wish Someone Had Told Me This Earlier

Set it up before you need it. Like way before.

I set it up after I already had a visible churn problem. By then I'd lost weeks of data that would've been really useful. And — worse — I'd lost users I probably could've kept if I'd known they were drifting even a few days earlier.

When you have 50 users it feels completely overkill to worry about retention tooling. But those 50 people are honestly your most valuable resource. Every single one of them looked at your product and decided it was worth trying instead of just doing nothing. Understanding why some of them stay and some of them leave — while you can still have an actual conversation with all of them — is data you can't just buy back later.

By the time you've got 500 users and churn is visibly hurting your MRR, you've already burned through months of signal you could've had. You're playing catch-up instead of being ahead of it.

The signals were in my users' behavior the whole time. I just wasn't collecting them.

Quick Rundown of What You're Getting
Okay so just to make it concrete — here's what actually happens when you add Flidget:
Your users are getting watched in the background. Not in a creepy way — just logins, are they using the thing, how long are sessions, that kind of stuff. And based on that it builds a score. When someone drops below a threshold, they move from Healthy to Risky to Drifting, and you get notified.

When someone tries to cancel, a chat opens right there on the page. No redirect. No separate form. Right where they are. They type or record why they're leaving. That lands in your dashboard tagged to their account.

One place to see who's at risk and why people are actually leaving. Not vanity metrics. Not just raw event counts. Actual information you can do something with today.

And all of it runs off one npm package and a few tracking calls.

Last Thing

I spent too long treating retention as something I'd deal with later. There was always a more urgent bug, always another acquisition thing to try, always a reason to push it off one more week.

Here's the uncomfortable part: acquisition without retention is just an expensive treadmill. You're working hard just to stay in the same place. Every user you lose is a user you have to go find again before you can actually grow. That costs money and time and energy that could've gone into building something better.

Churn isn't a billing problem. It's not a marketing problem. It's a signal that something in your product isn't clicking — and catching that signal early is so much cheaper than catching it after six months of wondering why growth feels stuck.

If you're building a SaaS right now and you don't have any visibility into who's drifting or why people are cancelling, seriously just go look at Flidget. Ten minutes of setup. Data that's actually useful from day one, not after some long drawn-out onboarding.

And if you've built your own version of this — especially the drift detection piece, I'm always curious how other people approach that part — drop it in the comments. Genuinely want to know.

Top comments (0)