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.
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.
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;}