Skip to Content
WidgetOverview

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:

PageDescription
Next.js App RouterRoute 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 integrationsresolveUser examples for Clerk, NextAuth, Supabase Auth, and custom headers

Reference

PageDescription
InstallationHow to add the widget via CDN script tag or the @unchurn.dev/widget npm package, including all three export paths
Auth TokensHow server-signed HMAC tokens work, when they are required, and how to generate them using createUnchurnHandler
Test & Live ModesHow to point the widget at Stripe test mode or live mode, and how modes are enforced per merchant
ConfigurationAll showCancelFlow options: offers, pause durations, copy overrides, theming, and callbacks
Last updated on