@ketapay/checkout, which does the work; this package fits it to React. React 18 or later. Source on GitHub.
url, as in How it works.
The button
Anything else a
<button> takes (className, style, disabled, id) is passed through. The button has no styles of its own, and its default label is “Pay with KetaPay”.
The hook
For your own button, a menu item, or opening the checkout after something else happens:open takes the same options as KetaPay.open and returns the same { close, result }. A checkout still showing when the component unmounts is closed for you.
Next.js and server rendering
Both are client components (the package is marked'use client'), and nothing touches the browser until the checkout opens, so they render on the server without errors. Call open from an event handler or an effect, never during render.
Errors and everything else
Errors (KetaPayCheckoutError with code invalid_url, not_in_browser or load_failed), branding, Content Security Policy, the sandbox and supported browsers are the same as in JavaScript. KetaPayCheckoutError and the types are re-exported from @ketapay/react.