Installation
npm install stablezact-payThe package ships a React build and a standalone browser build. Both talk to the same API.
import { StablezactPayment, PaymentAPI } from 'stablezact-pay';import 'stablezact-pay/dist/style.css';The stylesheet is required. Without it the checkout renders unstyled.
Install the latest release (npm install stablezact-pay@latest). Version 0.75.0
and later require a server-created checkout reference:
a checkout opened without one shows “Checkout unavailable”.
Next.js
Section titled “Next.js”The checkout touches window on mount, so it cannot be server-rendered. Import
it dynamically:
import dynamic from 'next/dynamic';
const StablezactPayment = dynamic( () => import('stablezact-pay').then((mod) => mod.StablezactPayment), { ssr: false });
// PaymentAPI has no browser dependency and imports normally.import { PaymentAPI } from 'stablezact-pay';import 'stablezact-pay/dist/style.css';Plain JavaScript
Section titled “Plain JavaScript”Load the standalone build and use StablezactVanilla. It has no framework
dependency and attaches itself to the page. Like the React component, it opens a
checkout by reference; see the Quickstart.
TypeScript
Section titled “TypeScript”The package ships its own types. If your setup does not pick them up, declare the module:
declare module 'stablezact-pay' { export const StablezactPayment: any; export const PaymentAPI: any;}