view) decides which screen you mount.
Installation
TypeScript types ship with the package. You do not need to install anything else.
Entrypoints
<TapipayWidget /> is the recommended path in React: it loads the SDK, mounts the widget and cleans it up on unmount. useTapipay() is the low level hook, for when you need to control initialize() and destroy() yourself.
If you are not using a bundler, you do not need to install anything: load the script and work with window.tapipay.
Identify your company
Pass one of these two options, not both:string
Your company’s
slug or alias (for example, acme-corp). It matches the Alias field under Settings → Organization in the dashboard. In data-attrs: data-organization.string
The company code configured for your organization in TapiPay (for example,
MX-S-12345). The format varies between integrations: if you do not know yours, confirm it with your TapiPay contact. In data-attrs: data-company-code.organization: "acme-corp" with companyCode: "MX-S-12345".
Quick start
- Script tag
- Data-attrs
- React
No bundler. The script makes
window.tapipay available once loaded.Options
initialize(options)
If
container, identifier or both company identifiers are missing, the SDK mounts nothing and warns in the console.
destroy(container)
Unmounts the widget: removes the iframe, the skeleton and the internal listeners.
<TapipayWidget /> already does it for you. If you call initialize() again on a container that already has a widget, the SDK destroys it and mounts it again.
loadTapipay(options)
It is idempotent per environment: calling it several times returns the same promise and never injects the script twice. It is compatible with React Strict Mode.
Events
Payloads
In React
Events are passed as props. Watch out for the third name: the event is calledpaymentCancelled, but the prop is onCancelled.
<TapipayWidget /> also accepts every initialize() option (except container), plus environment, className and style for the container.
Other frameworks
- Next.js
- Vue 3
- Angular
"use client".Staging environment
- npm
- React
- Script tag
What the SDK mounts
Knowing which URL the SDK builds helps you debug: if the widget stays blank, open that URL directly in the browser and you will see the real error.externalRequestId and selectionStrategy are added as query params. For example, initialize() with organization: "acme-corp", identifier: "CLI-00042" and externalRequestId: "INV-2026-001" mounts:

