Skip to main content
Introducing packages.sweber.dev
All packages
StableMIT + Pro

InverseThe withdrawal button (§ 356a BGB) and the cancellation button (§ 312k BGB) for Next.js and React, with the two-step flow, the receipt e-mail and a page check.

pnpm add @sweberdev/inverse @sweberdev/inverse-react

Since 19 June 2026, every online business that concludes contracts with consumers in the EU needs a withdrawal button labelled "Vertrag widerrufen". German subscription businesses have needed a cancellation button labelled "Verträge hier kündigen" since 2022. Shopify, Shopware and WooCommerce have plugins for this; custom shops, SaaS products and booking apps built with Next.js or React mostly don't.

Inverse adds both buttons to your own app. It gets the details right that courts look at: the statutory labels, a second step with "Widerruf bestätigen" or "Jetzt kündigen", the time of receipt set by your server, an acknowledgement e-mail with the content of the declaration, and a copy the consumer can download. You keep the data and send the e-mail with your own provider. A CLI checks your pages for the buttons, so a redesign can't quietly remove them.

Example

A short exampleCopy it into your project.

app/api/inverse/route.ts

import { createInverseHandler } from "@sweberdev/inverse"

export const POST = createInverseHandler({
  company: { name: "Acme GmbH", email: "hallo@acme.de" },
  onDeclaration: (record) => db.declaration.create({ data: record }),
  sendReceipt: (receipt) => resend.emails.send({ from: "service@acme.de", ...receipt }),
})

// footer: <InverseLink kind="withdrawal" href="/widerruf" />
// app/widerruf/page.tsx: <WithdrawalForm endpoint="/api/inverse" />

Features

What you getFree under MIT, with Pro on top.

Free, MIT

  • Withdrawal and cancellation buttons with the statutory wording
  • Two-step forms with a receipt e-mail and a server-side record
  • Works as React components or one script tag for WordPress and Shopify
  • Deadline calculation and a page check for CI
  • 9 languages and legal areas for DE, AT and CH

Pro

  • Everything in Free
  • Tamper-evident evidence ledger with an evidence sheet per declaration
  • Site-wide audit with a report for clients
  • Branded receipts and team notification
  • Case inbox with deadline reminders
  • Server image and WooCommerce plugin for shops that are not Node.js
All features in detail

Free, MIT

  • <InverseLink> with the statutory labels "Vertrag widerrufen" and "Verträge hier kündigen"
  • <WithdrawalForm> and <CancellationForm>: details, review with the statutory confirm button, receipt with download
  • One script tag for WordPress, Shopify themes and static sites: the same forms without React
  • Server-side record with date and time of receipt, and the acknowledgement e-mail with the content of the declaration
  • Labels, errors and receipts in German, English, French, Italian, Dutch, Spanish and Polish
  • Withdrawal deadline with days left, and contract end date, with weekends and your public holidays
  • Request → Response handler for Next.js, Remix, Hono, SvelteKit and Astro, a Node handler for Express, Fastify and the Pages Router; form posts without JavaScript
  • Optional rate limit against scripted submissions, duplicate protection against double clicks, and a contract select for signed-in customers
  • inverse check: finds missing or mislabelled buttons on a page, exit code for CI
  • cors option for forms on another domain, and legalRevision / inverse legal: which legal state the kit reflects and what changed
  • inverse snippet: ready-to-paste integration for WooCommerce, Shopware, Shopify and WordPress, and example projects for the Next.js Pages Router, Remix, SvelteKit and Express, a WordPress plugin with a settings page, and axe accessibility tests for the forms, an Austria page, a stability policy with a frozen API, and an upgrade guide
  • Legal areas: a jurisdiction on every record (Germany, Austria, Switzerland note, France, Italy, Spain, the Netherlands, Poland), legal status per country with inverse legal --since for CI, and a migration guide to 2.0. France, Italy, Spain, the Netherlands and Poland follow the EU directive only; the national acts were not read

Pro

  • Evidence ledger: every declaration and receipt in a SHA-256 hash chain, evidence sheet per declaration, stored as JSON Lines, PostgreSQL or SQLite, erasure and a retention period that keep the chain verifiable, RFC 3161 time stamp anchors, and an evidence dossier for your lawyer, the ledger CLI on SQLite or PostgreSQL, the dossier as PDF, anchors on a schedule, one ledger per client for agencies, the audit report as PDF, and ending a subscription at Stripe or Paddle after a cancellation, case management with status, refund date and history in the chain, the ledger storage format field with a migrate command, and Lemon Squeezy next to Stripe and Paddle, and a web inbox for the cases (the API is stable from 3.0) with status changes, refund day, overdue marks and German and English reply templates
  • Site audit: every page from the sitemap, buttons followed to the form without login, HTML report for clients that prints to PDF, a CSV overview of all sites, many sites in one run, and a comparison with the last run that flags what got worse, and continuous monitoring (the API is stable from 3.0): a scheduled check with a webhook or failing-workflow alert when a button goes missing, plus a generated GitHub Actions workflow
  • Branded receipts, a team notification with the refund or end date, a weekly digest of refunds and contract ends that are due, one reminder per case before a deadline, and transports for Resend, Postmark, SendGrid, Brevo, Mailgun and SMTP
  • Server in a Docker image for shops that are not Node.js: POST /v1/declarations with the ledger behind it, receipt mail, the case inbox, reminders before refund and contract-end deadlines, and a page watcher with webhook and mail alerts, all set by environment variables (SQLite in a volume; the case inbox and the watcher are stable from 3.0)
  • WooCommerce plugin: an order-bound withdrawal button with a lookup by order number and e-mail address or the link from My Account, an order note, and the declaration sent to your Inverse server (tested with WordPress 7.1 and WooCommerce 11.2; no Shopware or Magento plugin)
FeatureFreePro
Buttons, two-step forms and receipt e-mailIncludedIncluded
Deadlines, handler and page check CLIIncludedIncluded
Tamper-evident evidence ledgerNot includedIncluded
Site-wide audit with client reportNot includedIncluded
Branded receipts, team notification, mail transportsNot includedIncluded
Server image and WooCommerce pluginNot includedIncluded
LicenceMITPer person
SupportGitHub issuesAgency and Lifetime

Pro

Pro packagesAdd-ons on top of the core.

  • @weber-development/inverse-ledger

    Stores declarations and receipts in a hash chain, so later changes are detected, and prints an evidence sheet per declaration.

  • @weber-development/inverse-audit

    Checks every page of a site for both buttons, follows them to the form without login and writes a report for clients.

  • @weber-development/inverse-mail

    Sends receipts in your branding, notifies your team with the next due date, and ships transports for the common mail providers.

  • @weber-development/inverse-server

    Inverse Pro as one Docker image for WooCommerce, Shopware and every other stack: POST /v1/declarations, a hash-chained ledger in SQLite, receipts by SMTP or Resend, Postmark, SendGrid and Brevo, the case inbox, reminders before deadlines and a page watcher with webhook alerts. Ships with a WooCommerce plugin as a ZIP in each release.

Pricing

PricingPrices are in CHF.

Inverse Pro is also part of the Compliance Bundle. See the Compliance Bundle

Freelancer

For one person working on client projects.

CHF 190

per year

2 months free

  • 1 person
  • No support entitlement
Subscribe

Agency

Recommended

For teams of up to ten named people, one price.

CHF 590

per year

2 months free

  • Up to 10 people
  • Support included
Subscribe

Lifetime

Pay once for up to ten people and keep updates and repository access.

CHF 1’990

one-time

  • Up to 10 people
  • Support included
Buy lifetime licence

11 people or more: get in touch

  • Pay yearly and get two months free: CHF 190 instead of CHF 228 for Freelancer, CHF 590 instead of CHF 708 for Agency.
  • After cancelling, every version you already received keeps working. Only updates and repository access end.
  • No licence key, no phone-home. The packages never contact a server to check your licence.
  • Agency and Lifetime cover up to ten named people for one price: you choose the number of seats at checkout and assign them in Polar. Your clients and their websites need no licence of their own.
  • Checkout, invoices and VAT are handled by Polar as merchant of record.
Read the licence terms

FAQ

QuestionsShort answers.

Do I need both buttons?

The withdrawal button is needed wherever consumers can conclude a contract on your site or app, including shops, bookings and subscriptions. The cancellation button is needed in Germany for continuing contracts such as subscriptions and memberships that can be concluded online. Many SaaS products need both.

Does Inverse store anything or send data to you?

No. The handler calls your own function to store the declaration and your own mail provider to send the receipt. Nothing goes to Inverse or to us.

Can I change the labels?

Yes, every text can be overridden. The law allows an equivalent, unambiguous wording, but the statutory labels are the safe choice, so they are the default.

Does it work without Next.js?

Yes. The handler takes a Fetch API Request and returns a Response, so it runs on Remix, Hono, SvelteKit, Astro and any Node server. The forms need React; without React you can render your own and post to the same handler.

Is this legal advice?

No. Inverse implements the published wording and process of § 356a and § 312k BGB and explains its reasoning in the docs. For your specific case, ask a lawyer or your trade association.

Does Inverse work with WooCommerce or Shopware?

For WooCommerce there is a plugin in Inverse Pro 3.0: an order-bound withdrawal button that sends the declaration to the Inverse server, a Docker image you run yourself. For Shopware, Magento and other shops the server takes the declaration over HTTP (POST /v1/declarations), but there is no plugin for them yet and we have not tried them.

Articles

ArticlesGuides and release notes.