Documentation

Set up Flidget in 10 minutes

One npm package (@flidget/web-sdk), one public key. Drift and Retention Copilot share the same install. Most teams are live in under an hour.

Two things Flidget does — together

Before someone cancels, drift scores how they use your product. When they hit cancel, Retention Copilot asks why. Same SDK, same user id — the full story in one account.

Drift detection

Dashboard → Drift

You name the actions that mean a user is “getting value.” Flidget ingests events and labels each person Healthy, Risky, or Drifting — with plain-language reasons, not a black box.

Retention Copilot

Cancel / downgrade page

On the page where they actually leave, a short in-page chat opens (text or voice). Their reason is tagged and stored next to everything else you know about that user.

Quick start

The shortest path to a working integration — then use the full steps below for drift and exit chat details.

  1. Install: npm install @flidget/web-sdk (or paste the script tags from Widget Studio).
  2. Init: call Flidget.init with your public key, userId, and email for every logged-in session.
  3. Trigger: add the Retention Copilot embed on your cancel route and put data-breakup="trigger" on the control that starts cancel.

Setup steps

Steps 1–3 connect your app once. Step 4 turns on drift; steps 5–6 turn on exit capture; step 7 polishes the chat in the dashboard.

  1. Step 1 — Create account and copy your keys

    Register free. Open Dashboard → Widget Studio. Both Drift and Retention Copilot studio generate ready-made snippets with your key pre-filled. Copy, don't type — wrong keys are the most common setup issue.

    • Use the copy buttons

      Wrong URLs or keys are still the #1 support topic — paste from the UI.

    • Same public key

      Drift and Copilot use the same key; you’ll paste it wherever the docs say appId / public key.

  2. Step 2 — Install the SDK

    In bundled apps run npm install @flidget/web-sdk. Without a bundler, use the script tags from Widget Studio on the routes where Flidget should run.

    • One install, both products

      init + track power drift; the same init loads Retention Copilot on pages where you enable it.

    • Browser only

      Call init and track from client code (e.g. useEffect), not during SSR.

  3. Step 3 — Initialize with user identity

    Call Flidget.init with your public key, userId, and email once you know who they are. Best practice: a shared client layout for the whole logged-in app so drift events and cancel-page behavior always attach to the right person.

    • Retention Copilot

      loadExitChat stays on by default so the cancel route can open the widget after you add the embed and trigger (steps 5–6).

    • Drift

      The same init session receives Flidget.track events from anywhere in the app (step 4).

  4. Step 4 — Configure drift signals

    In Widget Studio → Drift Detection, list the actions that prove a user is getting value (one per line) and the event name your code will send (e.g. feature_used). Save — that mapping is what makes dashboard reasons readable.

    • Track real behavior

      After init, call Flidget.track when those actions happen — same pattern as the samples below.

    • Richer signal

      session_start on login and page_view on navigation help show the user is still active.

    • Read the results

      Open Dashboard → Drift for labels (Healthy / Risky / Drifting) and plain-language explanations.

    Recommended for Next.js, Vite, and bundled apps: install once, init after login, track on success.

    npm (@flidget/web-sdk)

    Keep it short. Copy & paste.

    "use client";
    
    import Flidget from "@flidget/web-sdk";
    import { useEffect } from "react";
    
    // npm install @flidget/web-sdk
    
    const PUBLIC_KEY = process.env.NEXT_PUBLIC_FLIDGET_PUBLIC_KEY ?? "YOUR_PUBLIC_KEY";
    
    export function FlidgetDriftRoot({ userId, userEmail }: { userId: string; userEmail: string }) {
      useEffect(() => {
        Flidget.init({ appId: PUBLIC_KEY, userId, email: userEmail });
      }, [userId, userEmail]);
    
      const onInviteSuccess = () => {
        Flidget.track("feature_used", { feature: "invite_teammate" });
      };
    
      return <button onClick={onInviteSuccess}>Invite teammate</button>;
    }

    Healthy

    Active recently, using key features.

    Risky

    Engagement dropping — good time to reach out.

    Drifting

    High churn risk — act soon.

    Tracked users & pricing

    Free: 50 users during the 14-day trial · Starter: 500 · Growth: 1,500 · Scale: unlimited. After the trial or over limit, new drift rows pause until you upgrade — Dashboard → Billing. Pricing →

  5. Step 5 — Add exit chat to your cancel page

    Open Retention Copilot studio and copy the snippet. Place it only on the URL where people actually cancel — not on your entire marketing site.

    • React / Next / SPA

      Client code on the cancel route; same Flidget.init pattern as step 3.

    • Plain HTML

      Scripts before </body>: identity, then widget loader — order matters.

    • Verify

      Load the cancel URL in a private window; you should see Flidget network activity.

    Recommended: init loads widget.js and wires the overlay; add data-breakup="trigger" on your cancel control.

    npm (@flidget/web-sdk)

    Copy from Retention Copilot studio for your exact URL and key.

    "use client";
    
    import Flidget from "@flidget/web-sdk";
    import { useEffect } from "react";
    
    // npm install @flidget/web-sdk
    
    const PUBLIC_KEY = process.env.NEXT_PUBLIC_FLIDGET_PUBLIC_KEY ?? "YOUR_PUBLIC_KEY";
    
    export function RetentionCopilotCancelArea({ userId, userEmail }: { userId: string; userEmail: string }) {
      useEffect(() => {
        Flidget.init({
          appId: PUBLIC_KEY,
          userId,
          email: userEmail,
          loadExitChat: true,
        });
      }, [userId, userEmail]);
    
      return null;
    }
    
    // Add data-breakup="trigger" on your cancel button, or call Flidget.openExitChat() after load.

    Samples use https://flidget.com; your studio snippet uses your production origin.

  6. Step 6 — Connect your cancel button

    Retention Copilot must open before your existing cancel, portal, or confirmation flow.

    • Find the real control

      The button or link that starts churn or opens the billing portal.

    • Add the trigger

      On that element: data-breakup="trigger" (below).

    • Flow

      Chat first; when they finish or skip, your previous behavior runs unchanged.

    data-breakup="trigger"

    Stripe, Paddle, Chargebee hosted pages

    Put the trigger on your button that opens the portal — hosted pages can’t run your script.

    Overlay checkout? In the cancel callback call Flidget.openExitChat() or window.FlidgetBreakup?.open().

  7. Step 7 — Customize the chat in Widget Studio

    In Retention Copilot studio, adjust copy, colors, position, and voice vs text. Changes apply on the next page load — usually no new deploy.

Framework tips

  • React / Next / Remix: shared client layout for init + track; cancel route for embed; next/script for widget.js if you skip npm.
  • Vue / Nuxt: app layout + cancel-route template or index.html.
  • WordPress / Webflow: site-wide footer for init if needed; page-level embed on cancel URL for Copilot.
  • Mobile apps: WebView to your hosted cancel page with the same embed and trigger.

Get help

Stuck? Email hello@flidget.com — we reply same day on setup questions. Most issues are a wrong key or missing init call.