streamable-httpMITupdated 11d ago
A production-ready cancel flow for React. Open source. Optionally connects to Churnkey for analytics and AI-powered retention.
O que dá para fazer com churnkey?
Churnkey SDK
A production-ready cancel flow for React. Open source. Optionally connects to Churnkey for analytics and AI-powered retention.
Packages
| Package | Description |
|---|---|
@churnkey/react |
The cancel flow. Drop-in component, headless hook, or core state machine. React 18 and 19. |
@churnkey/node |
Server-side token generation. Only needed if Churnkey is handling billing actions for you, or if you're using the hosted embed. |
@churnkey/mcp |
Model Context Protocol server. Lets Claude, Cursor, and other AI agents query your Churnkey data (sessions, analytics, DSR) using a Data API key. |
Quick start
npm install @churnkey/react
import { CancelFlow } from '@churnkey/react'
import '@churnkey/react/styles.css'
<CancelFlow
steps={[
{
type: 'survey',
title: 'Why are you leaving?',
reasons: [
{
id: 'expensive',
label: 'Too expensive',
offer: { type: 'discount', couponId: 'STRIPE_SAVE20', percentOff: 20, durationInMonths: 3 },
},
{ id: 'not-using', label: 'Not using it enough', offer: { type: 'pause', months: 2 } },
{ id: 'missing', label: 'Missing features' },
],
},
{ type: 'feedback', title: 'Anything else?' },
{ type: 'confirm' },
]}
handleDiscount={async (offer) => myBilling.applyCoupon(offer.couponId)}
handlePause={async (offer) => myBilling.pause({ months: offer.months })}
handleCancel={async () => myBilling.cancel()}
onClose={() => setOpen(false)}
/>
Documentation and resources
@churnkey/react— full API reference, customization, headless usage, custom step types@churnkey/node—createTokenandauthHash@churnkey/mcp— MCP server for Claude / Cursor / Claude Desktop- Create a free Churnkey account — get an
appIdfor analytics - churnkey.co — dashboard, hosted embed, AI retention features
Repo layout
sdk/
├── packages/
│ ├── react/ @churnkey/react
│ ├── node/ @churnkey/node
│ └── mcp/ @churnkey/mcp
├── apps/
│ └── playground/ internal dev playground
└── scripts/ release + tooling helpers
Local development
pnpm install
pnpm --filter @churnkey/react build
pnpm --filter @churnkey/react test
To work against the playground:
pnpm --filter @churnkey/react dev # rebuilds on change
pnpm --filter @churnkey/playground dev # runs the playground app
License
MIT
Instalação
Adicione churnkey ao seu cliente. Escolha o que você usa.
claude mcp add --transport http churnkey https://mcp.churnkey.co/mcpcodex mcp add churnkey --url https://mcp.churnkey.co/mcp{
"mcpServers": {
"churnkey": {
"url": "https://mcp.churnkey.co/mcp"
}
}
}Add to `~/.cursor/mcp.json`, or `.cursor/mcp.json` for a single project.
{
"servers": {
"churnkey": {
"type": "http",
"url": "https://mcp.churnkey.co/mcp"
}
}
}Add to `.vscode/mcp.json` in your workspace.
{
"mcpServers": {
"churnkey": {
"url": "https://mcp.churnkey.co/mcp"
}
}
}Add to `claude_desktop_config.json`, then restart Claude Desktop.
{
"mcpServers": {
"churnkey": {
"serverUrl": "https://mcp.churnkey.co/mcp"
}
}
}Add to `~/.codeium/windsurf/mcp_config.json`.
Pontuação
39 / 100
Incompleta
- Documentação17/25
- Manutenção25/25
- Confiança16/20
- Capacidade0/15
- Instalação12/15
- Documents what it does and how to connect
- Has a resolvable package or endpoint
- Exposes at least one tool, prompt or resource
- README has substantive content
- Includes a code example
- Documents its configuration
- Mentions credentials or security posture
- Last commit 3 days ago
- Has a release history
- Repository is not archived
- Licensed MIT
- Namespace verified in the official MCP registry
- Claimed by its owner
- Published under an organisation
- 0 tool(s) documented
- Provides prompt templates
- Provides resources
- 6 documented install method(s)
- Published to a package registry
- Offers a hosted endpoint — no local install
Histórico de versões
| Versões | Publicada |
|---|---|
| 2.2.0Mais recente | 13 de ago. de 2026 |
| 2.1.0 | 12 de ago. de 2026 |
| 2.0.0 | 12 de ago. de 2026 |