Widget
The Unchurn widget is a self-contained cancel flow that runs inside your app. It renders as an overlay, communicates with Unchurn’s servers to evaluate and execute retention offers, and reports the outcome back to your code via a callback.
The widget is available as a CDN script (window.unchurn.showCancelFlow) and as an npm package with dedicated exports for React and Next.js.
Integration guides
Pick the guide that matches your stack:
| Page | Description |
|---|---|
| Next.js App Router | Route handler placement, 'use client' boundaries, multi-environment env vars, middleware |
| React (any framework) | useUnchurn hook with a non-Next.js backend — Express, Hono, Remix, Astro |
| Vanilla JS / CDN | <script> tag integration for Rails, Laravel, or plain HTML pages |
| Auth integrations | resolveUser examples for Clerk, NextAuth, Supabase Auth, and custom headers |
Reference
| Page | Description |
|---|---|
| Installation | How to add the widget via CDN script tag or the @unchurn.dev/widget npm package, including all three export paths |
| Auth Tokens | How server-signed HMAC tokens work, when they are required, and how to generate them using createUnchurnHandler |
| Test & Live Modes | How to point the widget at Stripe test mode or live mode, and how modes are enforced per merchant |
| Configuration | All showCancelFlow options: offers, pause durations, copy overrides, theming, and callbacks |
Last updated on