@churnkey/react · v0.3

An open-source cancel flow for React.

Survey, offers, feedback, and confirmation in one component. Optionally connects to Churnkey for analytics, A/B testing, and AI retention features.

$npm install @churnkey/react
CancelButton.tsxtsx
import { CancelFlow } from '@churnkey/react'
import '@churnkey/react/styles.css'

<CancelFlow
  steps={[
    {
      type: 'survey',
      reasons: [
        {
          id: 'expensive',
          label: 'Too expensive',
          offer: { type: 'discount', couponId: 'SAVE20', percentOff: 20 },
        },
        { id: 'not-using', label: "Not using it" },
      ],
    },
    { type: 'feedback' },
    { type: 'confirm' },
  ]}
  handleDiscount={async (o) => myBilling.applyCoupon(o.couponId)}
  handleCancel={async () => myBilling.cancel()}
/>
How it grows

Three integration levels, one component.

The SDK has three integration levels: open source, analytics, and connected. Open source and analytics are free; connected requires a paid Churnkey plan (Starter or higher). Each level adds props on top of the one before.

01

Open source

Free

A production-ready open source cancel flow, built from years of industry expertise. Completely customizable, no Churnkey account required.

Five step types and six offer types out of the box, plus custom step and offer types. Headless hook for full UI control. Themable via CSS variables, classNames, and component overrides. MIT licensed.

CancelButton.tsxtsx
<CancelFlow
  steps={steps}
  handleDiscount={async (o) => myBilling.applyCoupon(o.couponId)}
  handleCancel={async () => myBilling.cancel()}
/>
+ appId, customer
02

Analytics

Free with a Churnkey account

Sign up for a free Churnkey account, then pass your appId and customer through props. Sessions stream to the retention dashboard.

Save rate by reason and offer. Cancel-reason trends. Test mode for staging traffic.

CancelButton.tsxtsx
<CancelFlow
  appId="app_xxx"
  customer={{ id: 'cus_123', email: 'jane@acme.com' }}
  steps={steps}
  handleDiscount={async (o) => myBilling.applyCoupon(o.couponId)}
  handleCancel={async () => myBilling.cancel()}
/>
+ session token + billing provider
03

Connected

Paid plan — Starter and up

Connect your billing provider in your Churnkey dashboard and pass a server-signed session token to the SDK. The dashboard now drives the flow, and Churnkey applies billing actions through your provider.

Boosted revenue — track what happens to customers after each offer accept. No-Code Editor for editing reasons, offers, and copy without a deploy. A/B tests on offer order and copy. Segments by plan, tenure, MRR, and metadata. Offer cooldowns. Adaptive Offers, Feedback AI, and Automatic AI Translations on the Intelligence tier.

CancelButton.tsxtsx
<CancelFlow
  appId="app_xxx"
  session={token}
  onAccept={(offer) => analytics.track('offer_accepted', offer)}
  onCancel={() => router.push('/goodbye')}
/>
At a glance

What each level includes.

Open source
no props
Free
Analytics
+ appId, customer
Free
Connected
+ session + provider
Starter and up
Level 01
The cancel flow component
Custom step + offer types
Headless hook for full UI control
Themable (CSS vars, classNames, overrides)
Level 02 · + appId, customer
Save rate dashboard
Cancel-reason breakdown with trends
Test mode for staging traffic
Level 03 · + session + billing provider
Boosted revenue — track outcomes after each offer accept
No-Code Editor for flow edits without a deploy
A/B tests on offer order and copy
Segments by plan, tenure, MRR, metadata
Offer cooldowns
+ Intelligence tier (paid add-on)
Adaptive Offers (AI-optimized offer selection)
Feedback AI (sentiment and themes)
Automatic AI Translations

Why did we open source our flagship product?

Rob MooreNick FogleScott HurffBaird Hall

A competent engineer with an LLM can stand up a “good enough” cancel flow in days. If you're going to build one anyway, we'd rather you have one that's already saved over 2 million customers and get your weekend back.

The part that can't be vibe-coded is what we're here to sell. We'd rather earn that than gate the front door.

Read the full story
Documentation

Read by topic.

Open the quickstart →

The SDK works without an account. Add Churnkey when you need it.

No account required for the open source SDK. Sign up for a free Churnkey account to record every session and see save rates. Upgrade to a paid plan (Starter or higher) to let Churnkey apply billing actions and edit the flow in the No-Code Editor.